How to Use structs in COM interfaces when Automation
compatibility is not an issue?
Answer / krishna akkulu
Structs, also known as User Defined Types (UDTs), can be
used in Automation- compatible interfaces
An Automation- compatible struct may contain only primitive
Automation types as its members.
Nesting structs is not allowed, but VARIANT is allowed thus
enabling nested structs (you can store a struct in a
VARIANT).
In order for a struct to be usable for Automation-
compatible interfaces, the struct must be described in a
type library and it must be declared with its own GUID:
[uuid(21602F40-CC62-11d4-AA2B-00A0CC39CFE0)]
struct MyStruct
{
[helpstring("A long value")]
long nLongValue;
[helpstring("A string")]
BSTR bstrStringValue;
};
// Later in the IDL file
[uuid(...), version(...), helpstring(...)]
library MyLib
{
...
struct MyStruct;
};
For more info see : http://vcfaq.mvps.org/com/4.htm
Is This Answer Correct ? | 0 Yes | 3 No |
How do you make a NET component talk to a COM component?
How to Use structs in COM interfaces when Automation compatibility is not an issue?
What are the purposes of AddRef, Release and QueryInterface functions
Define and explain about COM?
How can would you create an instance of the object in COM
Which tool is used to configure the port range and protocols for DCOM communications?
Can you explain what is dcom?
What is the difference between aggregated and contained objects?
hi,I have applied for NIC test plz if any one have test paper pattrn plz send me on "mn_mayank38@yahoo.co.in"
How does a DCOM component know where to instantiate itself?
how to call a dll as a COM dll?
What is dcom?