Sign in
MSDN Blogs
Microsoft Blog Images
More ...
Browse by Tags
Search
Archives
Archives
February 2013
(1)
January 2013
(2)
March 2011
(1)
December 2010
(2)
Tags
.NET
C#
C++
CLR
COM
Interop
PInvoke
Tips
WinDbg
Windows Phone 7
Common Tasks
Blog Home
Email Blog Author
About
RSS for posts
RSS for comments
Tagged Content List
Blog Post:
Avoiding C++ types in your P/invokes
Yi Zhang - CLR
It's easier to explain this in an example. Let’s say you have a export function in your native DLL: void WINAPI MyFunction(_com_ptr_t<IMyInterface> ptr) { // ... do something with ptr ptr->Func(); } And the DllImport would be something like this: [DllImport( "mydll.dll"...
on
7 Feb 2013
Blog Post:
WARNING: VS 2012 might break your broken P/Invoke
Yi Zhang - CLR
I'm seeing many people reporting that they are seeing strange P/invoke issues when they moved their code to VS 2012. Typically, they have P/invokes like this: [DllImport( "Win32Project2.dll" , PreserveSig = true , CharSet = CharSet.Unicode)] static extern int MyPInvoke( out string ret); ...
on
24 Jan 2013
Blog Post:
Marshal.GetHRForException does more than just Get-HR-For-Exception
Yi Zhang - CLR
Let's first start by looking at a small code snippet: if (Marshal.GetHRForException(myException) == E_SOME_COM_ERROR) DoSomething(); This looks perfectly fine, right? Not really. It turns out this API is actually poorly named, and it actually does more than just retrieving the HR from the exception...
on
18 Jan 2013
Page 1 of 1 (3 items)