imalloc

WinForms: Why do I get InvalidCastException when showing folder browser dialog?

I am randomly getting InvalidCastException when showing FolderBrowserDialog and also many clients have reported this. I have not been able to find anything relevant on the internet. Does anyone know what causes this/how to fix this? My code: using (FolderBrowserDialog fbd = new FolderBrowserDialog()) { fbd....

How to use IMalloc::Free ?

I'm using ICommandText::GetCommandText method. According to the MSDN documentation (http://msdn.microsoft.com/en-us/library/ms709825(v=VS.85).aspx) I need to use IMalloc::Free to release the memory allocated for LPOLESTR *ppwszCommand output parameter. How do I use this interface to do that? ...