Switching between Platform-Configurations breaks COM-Compatibility

-1

I have an rather odd problem with Visual Studio once more. I have a library which depends on one COM-Library. Out of the blue the COM-Library depending on MDAC 2.7 suddenly1 produced this Compile-Error:

Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

Together with this error others showed up that Properties were not found on the designated object. After much investigation into my system, I could figure out that for some reason some MDAC libraries were not registered anymore2. Registering them by hand (because the setup wouldn't let me reinstall it anymore) fixed the error, but the errors about the not found Properties stayed. It boiled down to this:

Me.prv_comObject.Value = aValuePassedIn ' This throws the error that the
                                          Property "Value" could not be found '

' This works instead: '
Me.prv_comObject.set_Value(aValuePassedIn)

Now comes the clue, this only breaks in x86 configuration, in Any CPU I can still use the Properties. I was also unable to reproduce this with SharpDevelop, SD is always expecting Properties. I'm also not sure if this is related to the MDDAC-Thingy in any way.

It's a VB.NET project, the COM Library is VB6 and OS is Windows XP. Any ideas what might cause this behavior?

1: Yes, suddenly. I was normally developing, then switched to Release mode and then it was there and wouldn't go away anymore.

2: Yes, I was messing around with MDAC, because I tried to help pinpoint the problem which was now introduced with Windows 7 SP1 (yes, we were unaware of that). But I did not mess around the registration of the MDAC libraries.

visual-studio-2008
com
asked on Stack Overflow Apr 26, 2011 by Bobby

1 Answer

0

After three days of wondering what that is, it is gone.

I've cleaned up the projects, removed the obj and bin and suddenly everything turned back to normal. Seems like the object files were corrupted.

answered on Stack Overflow Apr 29, 2011 by Bobby

User contributions licensed under CC BY-SA 3.0