Running under Win7 SP1 with VS2010 and Microsoft SDK v7.0a. If I create a VS2010 project for a Win32 console application, a CreateInstance on a regsvr32.exe registered COM DLL succeeds. If I create a VS2010 project for an MFC GUI, the identical CreateInstance fails with E_NOINTERFACE. Have tried both Unicode and multi-byte, works both ways for Win32 console application, fails both ways for MFC GUI. How is this possible?
If I F11 through the Win32 console application, I eventually see the CreateInstance get to a QueryInterface on IUnknown [which succeeds]. If I F11 through the MFC GUI, it never gets to the QueryInterface.
I've seen some talk about ADO versions/upgrades being relevant, but here is one system that succeeds for Win32 console application and fails for MFC GUI. How?
Update: I was mistakenly allowing the WinDDK comip.h to be used instead of the VS2010 comip.h. But even after correcting that, the problem remains.
Also discovered that the same MFC GUI project and source compiled on a 64 bit machine does NOT fail. Only my 32 bit machine does. Both get to QueryInterface in the CreateInstance call stack, but the 32 bit machine returns failure, whereas the 64 bit machine returns success.