|
| Manually implement COM interface in C#? |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.interop.
| Zhenxin Li |
Hello,
I want to implement IUPnPServiceCallback in C#. This interface is not in the typelib of UPnP dll, so I must implement it myself. Are there any references to implement COM interface in C# manually?
Best regards, Zhenxin Li
|
|
|
| |
|
| |
| |
| Mattias Sjögren |
[Original message clipped]
Try this declaration
[ComImport, Guid("31fadca9-ab73-464b-b67d-5c1d0f83c8b8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] interface IUPnPServiceCallback { void StateVariableChanged(IUPnPService pus, [MarshalAs(UnmanagedType.LPWStr)] string pcwszStateVarName, object vaValue); void ServiceInstanceDied(IUPnPService pus); }
Mattias
-- Mattias Sjögren [MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup.
|
|
|
| |
|
| |
| |
| Zhenxin Li |
Thanks! Every function works well. I also use Marshal::QueryInterface to test it. It returns non-zero interface pointer.
But I don't get any notification from UPnP. I doubt whether my UPnP router supports callback.
Best regards, Zhenxin Li
"Mattias Sj?gren" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|