|
-
May 25th, 1999, 02:10 AM
#1
HOW to pass ARRAY OF STRUCTURES in COM DYNAMICALLY thru interface methods
Can any body tell me how do i pass ARRAY OF STRUCTURES IN COM DYNAMICALLY FROM A outproc server to client.
eg..
I have a structure A { int x, float y, char z} of size [n] .. i would like to fire this data through my outgoing interface . Is there any way please
reply me.
srini s ([email protected])
-
May 25th, 1999, 03:45 AM
#2
Re: HOW to pass ARRAY OF STRUCTURES in COM DYNAMICALLY thru interface methods
Look at COleSafeAray. You can create a 1 dimensional byte array COleSafeArray::CreateOneDim
copy your structure byte-per-byte into the array, then get the VARIANT out of the array using ColeSafeArray: etach()
. You now have your structure in a VARIANT, which can be marshalled by both COM & DCOM. Also you have to free the memory allocated manually (since you called Detach()); call VariantClear() to do the job.
MJA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|