Monday, July 26, 2010

Marshaling BSTRs in COM/Interop

After struggling so many days for a right implementation after all I got a right approach to deal with it.
Actually I'd completed with the implementation ( calling BSTR from C# client), but at the peer-review , we discussed about the potential memory leak.

After google so many things, MSDN is not having so much collective information and example. 
the best thing I found, what is want to share all of you guys...


http://www.codeproject.com/Articles/66243/Marshaling-with-Csharp-Chapter-3-Marshaling-Compou.aspx
Marshaling BSTRs in COM/Interop or P/Invoke

So I came to follow below links.
http://social.msdn.microsoft.com/Forums/en-US/clr/thread/9a4e8bbb-efbd-4a90-9549-4e1795198800

http://dotnet.itags.org/dotnet-c-sharp/86388/

http://objectmix.com/dotnet/103378-how-return-string-array-com-c.html

http://objectmix.com/dotnet/257081-marshaling-array-into-com-server-ok-but-cant-return-array-invalid-procedure-call-argument.html

http://stackoverflow.com/questions/1300122/marshalling-bstrs-from-c-to-c-with-com-interop
Infact all are help ful.

http://www.codeproject.com/KB/COM/binbstr.aspx
http://msdn.microsoft.com/en-us/library/aa645736(VS.71).aspx



Looking for a sample code:
http://msdn.microsoft.com/en-us/library/aa664431(v=VS.71).aspx

If you are a VB developer :
http://objectmix.com/dotnet/102955-problem-passing-string-bstr-string-c-dll-nullreference-exception.html


COM Interop is causing a horrible CLR crash


http://bytes.com/topic/c-sharp/answers/248396-com-interop-causing-horrible-clr-crash

MONO
Mono 1.0 and Mono 1.1.xx do not have support for COM, it is a known missing feature of Mono. Initial work has begun on supporting MS COM on Windows. The long term goal is to support a variety of unmanaged component technologies including MS COM, XPCOM, and UNO.
http://www.mono-project.com/COM_Interop

No comments:

Post a Comment

Health Benefits of Cashews

  Benefits of Cashews. Healthy food is an integral part of healthy body. Regular exercises such as Yoga and healthy diet is important to...