|
-
Mar 13th, 2008, 02:32 PM
#1
Thread Starter
New Member
VB6 COM Object can't register in Vista
I created a COM object (DLL) with VB6 originally under Windows XP and everything worked fine. After upgrading my laptop to Vista the COM object appeared to still be working. I made a few very minor changes to the code and recompiled it. But now I cannot register the DLL anymore. I get the following error:
"The module mydll was
loaded but the call to DLLRegisterServer failed with
error code 0x80004005."
Any ideas why I might be getting this error all of a sudden?
Thanks.
-
Mar 13th, 2008, 02:36 PM
#2
Re: VB6 COM Object can't register in Vista
Welcome to the Forums.
Its not all of a sudden as you made a change.
Did you try unregistering and reregistering it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 13th, 2008, 03:03 PM
#3
Thread Starter
New Member
Re: VB6 COM Object can't register in Vista
Yeah I guess that was a bit of an overexaggeration :P but it's got me totally boggled why it was working before but now it won't register.
I did unregister it first using the regsvr32.exe /u command and then reregistering. Funny thing is now when I try to unreg and rereg I get the same error message both ways.
-
Mar 13th, 2008, 04:54 PM
#4
Re: VB6 COM Object can't register in Vista
hmm, what is the compatibility of the ocx set to in its project when you compilied it? Project or Binary compatibility? I believe Project wil not change the guid for it.
Also, when you registered it or installed your app with it, did you run the install/register as Administrator?
It could be a broken link in the registry if the guid changed and/or not run as administrator
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 13th, 2008, 05:30 PM
#5
Thread Starter
New Member
Re: VB6 COM Object can't register in Vista
Thanks for the replies! 
It's a DLL and it's set to compile to native code optimized for fast code. I did try to register it as an administrator too. I'm beginning to think that it is a problem with my registry too. If so, is there a safe way to fix it?
-
Mar 13th, 2008, 09:01 PM
#6
Re: VB6 COM Object can't register in Vista
It sounds as if it could be related to AppCompat registry virtualization.
If you haven't yet, try to first unregister it with regsvr32 elevated (most easily via an elevated command prompt).
You may have to do this again unelevated logged on as every user that has ever run the code which calls it. I'm not sure that even this will take care of it, because regsvr32 probably tests as "Vista aware" and it may never reach your virtualized component registration. You may have to hack away at this via regedit looking within the HKCU hive of each such user. Take a look at Registry Virtualization.
One way to avoid this in the future is to stop running regsvr32. This statement may be too strong, but use regsvr32 with caution. If you must manually register via regsvr32, always do it elevated.
Another thing you must do (if you insist on developing under Vista) is to make sure that you always run the VB6 IDE elevated. Preferably through the use of an application manifest with a <trustInfo> element in it, which tells Vista not to apply AppCompat shims such as registry virtualization.
Thirdly, never copy a VB application with component libraries in the app folder to Vista and run it. You risk self-registration at the time the program first runs, almost certainly with virtualization. Use proper installer packages.
-
Mar 14th, 2008, 02:12 PM
#7
Thread Starter
New Member
Re: VB6 COM Object can't register in Vista
Okay thanks for that info. This COM object is legacy code originally designed for Win95 but has served well right up to XP which is the platform that it is still being used on. I'll try registering it on an XP system again and see if that works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|