Home   Index   About
Ultimate Pack


Custom Search
IMarshal::GetUnmarshalClass

Returns the CLSID that should be used to create an uninitialized proxy on the receiving side (that is, the side doing the unmarshaling).

HRESULT IMarshal::GetUnmarshalClass(

REFIID riid,
//Identifies the interface being marshaled
void * pv,
//Points to the interface pointer being marshaled
DWORD dwDestContext,
//Identifies the destination process
void * pvDestContext,
//Reserved for future use
DWORD mshlflags,
//Specifies reason for marshaling
CLSID * pCid
//Receives CLSID of proxy
);

Parameters

riid

[in]Specifies the IID of the interface pointer to be marshaled.

pv

[in]Points to the interface pointer to be marshaled; can be NULL.

dwDestContext

[in] Specifies the destination context, that is, the process in which the unmarshaling will be done. Different marshaling can be done depending on whether the unmarshaling will happen on the local workstation or on a workstation on the network; it's possible for an object to do custom marshaling in one case but not another. The legal values for dwDestContext are taken from the enumeration MSHCTX. For information on the MSHCTX enumeration, see the "Data Structures" section.

pvDestContext

[in] Reserved for use with future MSHCTX values.

mshlflags

[in] Specifies why marshaling is taking place. Values for mshlflags are taken from the enumeration MSHLFLAGS. For information on the MSHLFLAGS enumeration, see the "Data Structures" section.

pCid

[out] Receives the CLSID to be used to create a proxy on the receiving side (that is, the side doing the unmarshaling).

Return Value

Returns S_OK if successful; otherwise, S_FALSE.

Comments

This method is called from the originating side (that is, the side doing the marshaling).

Notes to Implementors

The CLSID returned by this method identifies the class of the proxy object. This CLSID is typically written to a stream on the originating side and then read from the stream on the receiving side. Note that if you are creating a copy of the original object in the client process (that is, you are implementing custom marshaling for immutable objects), the CLSID returned is the same one as for the original object.

Your implementation can delegate some destination contexts to the standard marshaling implementation, available by calling the CoGetStandardMarshal API function. You should always delegate if the dwDestContext parameter contains a value that your implementation does not understand; this allows new destination contexts to be defined in the future.

You may want your implementation to use the pointer passed through the pv parameter, and, based on information retrieved from that pointer, determine the appropriate CLSID to return. If the pv parameter is NULL and your implementation needs that interface pointer, it can call IUnknown::QueryInterface on the current object to get it. The pv parameter exists merely to improve efficiency.


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun