all groups > inetserver asp components > october 2003 >
You're in the

inetserver asp components

group:

marshalling C++


marshalling C++ Serve Laurijssen
10/23/2003 4:55:41 PM
inetserver asp components:
I have a function with the following signature

HRESULT func([in]BSTR id, [out, retval] VARIANT *retval);

The variant gets filled with a SAFEARRAY of IDispatch pointers, but COM
doesn't know that until after the function is run of course.
When I installed the components in the COM+ catalog it didn't work anymore,
probably because retval can't be marshalled correctly. Can somebody tell me
or give me a link on how to correctly marshal such a safe array of IDispatch
*?

Thanks in advance

Re: marshalling C++ Onega
10/24/2003 1:01:19 PM
See if marshal by value helps you out.
http://www.sellsbrothers.com/tools/mbvimpl.h

Here is an example in ATL Internals

class ATL_NO_VTABLE CDemagogue:
....
public IPersistStreamInitImpl2<CDemagogue>,
public CSupportDirtyBit,
public IMarshalByValueImpl<CDemagogue>
{
....
BEGIN_COM_MAP(CDemagogue)
COM_INTERFACE_ENTRY2(IPersist,IPersistStreamInit)
COM_INTERFACE_ENTRY(IPersistStreamInit)
COM_INTERFACE_ENTRY(IMarshal)
END_COM_MAP()
....
}

Best Regards
Onega

[quoted text, click to view]

Re: marshalling C++ Serve Lau
10/24/2003 8:21:04 PM
[quoted text, click to view]

Say, is that book still going strong if you use VS.NET 2003?

--
Looking for a C(99) compiler for windows?
Download lccwin32.
http://www.cs.virginia.edu/~lcc-win32/

AddThis Social Bookmark Button