Click here to Skip to main content
15,891,033 members
Home / Discussions / COM
   

COM

 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz28-Sep-05 3:47
morenz28-Sep-05 3:47 
GeneralRe: How to put a struct into a VARIANT? Pin
Mike Dimmick28-Sep-05 5:09
Mike Dimmick28-Sep-05 5:09 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz29-Sep-05 1:27
morenz29-Sep-05 1:27 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz30-Sep-05 0:36
morenz30-Sep-05 0:36 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz30-Sep-05 3:28
morenz30-Sep-05 3:28 
AnswerRe: How to put a struct into a VARIANT? Pin
Rory Solley29-Sep-05 0:49
Rory Solley29-Sep-05 0:49 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz30-Sep-05 0:42
morenz30-Sep-05 0:42 
GeneralRe: How to put a struct into a VARIANT? Pin
Rory Solley30-Sep-05 4:10
Rory Solley30-Sep-05 4:10 
Yes, use sizeof(YourStruct). If you have embedded structs, you're going to have to be more creative e.g.

sizeof(YourStruct) + (sizeof(YourEmbeddedStruct) * NumberOfEmbeddedStructs)

etc.
It can get tricky if your structs contain "variable" data, such as strings. In the past, I've either defined the maximum size of the string (and therefore constrained the array inside the struct definition) or I've added a counter then a pointer, e.g.

...
unsigned long ByteCount;
unsigned char* pByteData;
};

The count tells the caller how big the variable data is. Hope that helps.
GeneralRe: How to put a struct into a VARIANT? Pin
Jörgen Sigvardsson3-Oct-05 6:22
Jörgen Sigvardsson3-Oct-05 6:22 
GeneralRe: How to put a struct into a VARIANT? Pin
Rory Solley3-Oct-05 22:20
Rory Solley3-Oct-05 22:20 
GeneralRe: How to put a struct into a VARIANT? Pin
morenz4-Oct-05 3:09
morenz4-Oct-05 3:09 
QuestionCustomizing IE Pin
babai27-Sep-05 20:52
babai27-Sep-05 20:52 
QuestionThorwing a event with a collection Pin
GizzoF27-Sep-05 7:53
GizzoF27-Sep-05 7:53 
QuestionMixing COM and non-COM property pages Pin
DolphLundgren27-Sep-05 5:03
DolphLundgren27-Sep-05 5:03 
GeneralRe: Mixing COM and non-COM property pages Pin
Jörgen Sigvardsson27-Sep-05 9:56
Jörgen Sigvardsson27-Sep-05 9:56 
QuestionDynamically switching between DLLs Pin
Divick26-Sep-05 20:41
Divick26-Sep-05 20:41 
AnswerRe: Dynamically switching between DLLs Pin
prasad_som26-Sep-05 21:18
prasad_som26-Sep-05 21:18 
GeneralRe: Dynamically switching between DLLs Pin
Divick26-Sep-05 21:28
Divick26-Sep-05 21:28 
GeneralRe: Dynamically switching between DLLs Pin
Divick27-Sep-05 20:47
Divick27-Sep-05 20:47 
GeneralRe: Dynamically switching between DLLs Pin
rwestgraham28-Sep-05 19:08
rwestgraham28-Sep-05 19:08 
QuestionActiveX Controls Pin
Ashwin kumar Gurujala26-Sep-05 18:14
Ashwin kumar Gurujala26-Sep-05 18:14 
QuestionITypeInfo - Method parameter names Pin
mpuerto26-Sep-05 15:55
mpuerto26-Sep-05 15:55 
AnswerRe: ITypeInfo - Method parameter names Pin
Lim Bio Liong27-Sep-05 0:24
Lim Bio Liong27-Sep-05 0:24 
GeneralRe: ITypeInfo - Method parameter names Pin
mpuerto27-Sep-05 11:38
mpuerto27-Sep-05 11:38 
QuestionMultithreaded COM Pin
tajbender25-Sep-05 9:52
tajbender25-Sep-05 9:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.