Re: use customized data type in IDispatch.Invoke
"George" <George@discussions.microsoft.com> wrote in message
news:9F0F4707-4572-4D46-9C7A-3C0489950C4B@microsoft.com
struct Foo {
long abc;
VARIANT goo;
};
struct Goo {
long type;
};
Foo foo;
VARIANT vntfoo;
VARIANT vntgoo;
// construct inner variant goo
hr = GetRecordInfoFromGuids(LIBID_MyLib, 1, 0, 0x409, uuidof(Goo),
&pRI);
pRI is never declared. I assume it's a IRecordInfo*.
VariantInit(&vntgoo)
Missing semicolon.
vntgoo.vt = VT_RECORD;
vntgoo.pvRecord = &foo.goo;
&foo.goo is a VARIANT*, not a Goo*. A VARIANT of type VT_RECORD is
supposed to hold a pointer to UDT, not a pointer to another VARIANT.
Don't you find it strange that you don't actually have an instance of
Goo anywhere in your code?
I am confused about IRecordInfo Interface. My question is for all the
same interface type instances, they all have the same IRecordInfo?
What's "interface type instance"?
As should be obvious from GetRecordInfoFromGuids call, an instance of
IRecordInfo is uniquely identified by a LIBID of the type library and a
GUID of the struct defined in that type library.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925