Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb6 dll on windows 7 64 bit

Status
Not open for further replies.

griffitd

Programmer
Aug 20, 2002
189
GB
Hi

I have a vs2008 .net app which has a declaration in a module to a vb6 dll

Private SecMain as New SpecSec.ObjSecOptions 'SpecSec.dll vb6

If i put a break point on think line athen press F11 to execute i get the following error:

System.TypeInitializationException was unhandled
Message="The type initializer for 'CM_ERP.modMainModule' threw an exception."
Source="CM_ERP"
TypeName="CM_ERP.modMainModule"
StackTrace:
at CM_ERP.modMainModule.Main(String[] args)
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Runtime.InteropServices.COMException
Message="Retrieving the COM class factory for component with CLSID {27B5F28B-92A7-467C-8878-4571F7C80448} failed due to the following error: 80040154."
Source="CM_ERP"
ErrorCode=-2147221164
StackTrace:
at CM_ERP.clsSecurity..ctor() in D:\Projects\NET\CM_ERP\CM_ERP\CM_ERP\Classes\clsSecurity.vb:line 3
at CM_ERP.modMainModule..cctor() in D:\Projects\NET\CM_ERP\CM_ERP\CM_ERP\Modules\modMainModule.vb:line 25
InnerException:

This only happens on windows 7 64 bit. It work fine on XP and the compiled exe works fine on windows 7 32 bit.

Can some one help please

Thanks
 
You cannot directly use 32bit COM dlls from a 64bit program, I'm afraid.

This article suggests a couple of workarounds.
 
You will have to forcibly compile the app in 32 bit mode to make it work and the app will run in "Windows on Windows" I believe. Otherwise, you would need a 64 bit version of the old DLL (which is probably not very likely)...

Walt
Ciber/NES
 
Tried that and that has solved the problem.

Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top