Hello,
I have a doubt regarding sharing memory between two COM-based exe’s.
If an application wants to send data to another application which is of
the following structure,
struct s
{
Byte *b;
int nBufLen;
};
then how does the application pass such data?
If the application attempts to pass the structure as a whole then
passing size of the structure will not help as it is only 8 bytes and
does not reflect the actual data pointed by the byte pointer. How does
the application with the help of IDL file(s) transfer data to another
application?
Any guidelines or hints will be highly appreciated.
Thanks,
Venky
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
use [size_is] attribute to describe the no. of bytes pointed by b.
Manish
-----Original Message-----
From: Varadan Venkatesh [mailto:xxxxx@tataelxsi.co.in]
Sent: Wednesday, September 05, 2001 12:05 PM
To: NT Developers Interest List
Subject: [ntdev] Doubts in IDL (Memory sharing)
Hello,
I have a doubt regarding sharing memory between two COM-based exe’s.
If an application wants to send data to another application which is of
the following structure,
struct s
{
Byte *b;
int nBufLen;
};
then how does the application pass such data?
If the application attempts to pass the structure as a whole then
passing size of the structure will not help as it is only 8 bytes and
does not reflect the actual data pointed by the byte pointer. How does
the application with the help of IDL file(s) transfer data to another
application?
Any guidelines or hints will be highly appreciated.
Thanks,
Venky
You are currently subscribed to ntdev as: xxxxx@zensar.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> struct s
{
Byte *b;
int nBufLen;
};
then how does the application pass such data?
If the application attempts to pass the structure as a whole then
passing size of the structure will not help as it is only 8 bytes and
does not reflect the actual data pointed by the byte pointer. How does
the application with the help of IDL file(s) transfer data to another
application?
You must declare the structure properly in your IDL file with all necessary
qualifiers.
MIDL will auto-generate the marshalling functions for it which will pack the
structure to the byte stream as necessary.
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hello Max,
Let me try to rephrase my question so that I will be in sync with what you
are explaining.
Lets assume that there are two components (A & B) both implemented in
the form of exes. Lets also assume that component A has the following
interface defined in its own idl file according to IDL specifications:
interface Ix
{
void f (BYTE *b, int nByteLen) = 0;
}
Now, component B wants to call this interface function f () with the
user-defined structure as given below as parameter 1:
struct s
{
Byte *b;
int nBufLen;
};
In such a scenario, should component B also use an IDL file for
translating the data in structure s for passing it as an BYTE * to the
interface function f ()?
Any idea about what ideally should be done in such a scenario?
Regards
Venky
–>-----Original Message-----
–>From: xxxxx@lists.osr.com
–>[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
–>Sent: Wednesday, September 05, 2001 2:11 PM
–>To: NT Developers Interest List
–>Subject: [ntdev] Re: Doubts in IDL (Memory sharing)
–>
–>
–>> struct s
–>> {
–>> Byte *b;
–>> int nBufLen;
–>> };
–>>
–>> then how does the application pass such data?
–>>
–>> If the application attempts to pass the structure as a whole then
–>> passing size of the structure will not help as it is only 8 bytes and
–>> does not reflect the actual data pointed by the byte pointer. How does
–>> the application with the help of IDL file(s) transfer data to another
–>> application?
–>
–>You must declare the structure properly in your IDL file with
–>all necessary
–> qualifiers.
–>MIDL will auto-generate the marshalling functions for it which
–>will pack the
–>structure to the byte stream as necessary.
–>
–> Max
–>
–>
–>—
–>You are currently subscribed to ntdev as: xxxxx@tataelxsi.co.in
–>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
This is way off topic. Might I suggest any of the 1,000 or so books on
COM/DCOM/OLE/whatever? Transferring BLOBs is well documented.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Varadan
Venkatesh
Sent: Wednesday, September 05, 2001 5:19 AM
To: NT Developers Interest List
Subject: [ntdev] Re: Doubts in IDL (Memory sharing)
Hello Max,
Let me try to rephrase my question so that I will be in sync
with what you are explaining.
Lets assume that there are two components (A & B) both
implemented in the form of exes. Lets also assume that
component A has the following interface defined in its own
idl file according to IDL specifications:
interface Ix
{
void f (BYTE *b, int nByteLen) = 0;
}
Now, component B wants to call this interface function f ()
with the user-defined structure as given below as parameter
1: struct s {
Byte *b;
int nBufLen;
};
In such a scenario, should component B also use an IDL file
for translating the data in structure s for passing it as an
BYTE * to the interface function f ()?
Any idea about what ideally should be done in such a scenario?
Regards
Venky
–>-----Original Message-----
–>From: xxxxx@lists.osr.com
–>[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S.
–>Shatskih
–>Sent: Wednesday, September 05, 2001 2:11 PM
–>To: NT Developers Interest List
–>Subject: [ntdev] Re: Doubts in IDL (Memory sharing)
–>
–>
–>> struct s
–>> {
–>> Byte *b;
–>> int nBufLen;
–>> };
–>>
–>> then how does the application pass such data?
–>>
–>> If the application attempts to pass the structure as a
whole then
–>> passing size of the structure will not help as it is
only 8 bytes
–>> and does not reflect the actual data pointed by the byte
pointer.
–>> How does the application with the help of IDL file(s)
transfer data
–>> to another application?
–>
–>You must declare the structure properly in your IDL file with all
–>necessary qualifiers.
–>MIDL will auto-generate the marshalling functions for it which
–>will pack the
–>structure to the byte stream as necessary.
–>
–> Max
–>
–>
–>—
–>You are currently subscribed to ntdev as:
xxxxx@tataelxsi.co.in To
–>unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as:
xxxxx@hollistech.com To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
When you describe the structure in IDL, you tell the system that the nBufLen
member contains the number of bytes of data in the b member. COM then knows
to marshal that many bytes across. This all depends upon your setting
everything up correctly in the IDL.
Greg
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Varadan Venkatesh
Sent: Wednesday, September 05, 2001 1:35 AM
To: NT Developers Interest List
Subject: [ntdev] Doubts in IDL (Memory sharing)
Hello,
I have a doubt regarding sharing memory between two COM-based exe’s.
If an application wants to send data to another application which is of
the following structure,
struct s
{
Byte *b;
int nBufLen;
};
then how does the application pass such data?
If the application attempts to pass the structure as a whole then
passing size of the structure will not help as it is only 8 bytes and
does not reflect the actual data pointed by the byte pointer. How does
the application with the help of IDL file(s) transfer data to another
application?
Any guidelines or hints will be highly appreciated.
Thanks,
Venky
You are currently subscribed to ntdev as: xxxxx@pdq.net
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> Lets assume that there are two components (A & B) both implemented in
the form of exes. Lets also assume that component A has the following
interface defined in its own idl file according to IDL specifications:
interface Ix
{
void f (BYTE *b, int nByteLen) = 0;
}
Try this:
interface Ix
{
void f ([size_is(nByteLen)] BYTE *b, int nByteLen) = 0;
}
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com