Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Ersan on November 22, 2006, 04:52 AM

Title: [SOLVED] (VB6+Vista) Creating Objects
Post by: Ersan on November 22, 2006, 04:52 AM
So yeah, I write an ActiveX DLL with a class that has multiuse instancing, register it (successful), and try to use its class as an object, but I get ActiveX component can't create object when I run Object = CreateObject("ProjName.ClassName") in Vista only, works fine in all previous versions of windows.  It's a shot in the dark but I figure I'll ask here if anyone knows why, or what I can do.
Title: Re: (VB6+Vista) Creating Objects
Post by: Grok on November 22, 2006, 10:10 AM
Is the DLL signed with a trust chain that leads to one of your trusted root providers?  Vista may have additional security requirements on COM creation and usage previously not seen in Windows.
Title: Re: (VB6+Vista) Creating Objects
Post by: Ersan on November 22, 2006, 04:48 PM
Guess I have some reading to do...
Title: Re: (VB6+Vista) Creating Objects
Post by: Warrior on November 23, 2006, 05:01 PM
Have you tried putting the ActiveX in the cwd? As a last resort you can try turning User Account Control off, I've had issues with UAC and ActiveX files anyhow..

Or maybe it's a reason to stop using VB6? :D
Title: Re: (VB6+Vista) Creating Objects
Post by: Ersan on November 23, 2006, 09:23 PM
I don't for anything new, I wonder if it would work if I used "Run as Administrator".  I'll tell you when I get home.

EDIT: nope.

EDIT: It seems to work with User Account Control turned off, probably a problem with my implementation of DllRegisterServer (I use the API, but the program won't work with UAC on either) - When I get some time I'll set it to manually do the regkeys.  UAC won't let you modify the HKLM section of the registry (without Administrator priveleges, no not the "My account is in the Administrators group" kind), so if you want to implement DllRegisterServer with UAC turned on you need to use HKCU for the regkeys, not HKLM.
Title: Re: [SOLVED] (VB6+Vista) Creating Objects
Post by: Warrior on November 24, 2006, 01:44 PM
Quote from: Ersan on November 23, 2006, 09:23 PM
I don't for anything new, I wonder if it would work if I used "Run as Administrator".  I'll tell you when I get home.

EDIT: nope.

EDIT: It seems to work with User Account Control turned off, probably a problem with my implementation of DllRegisterServer (I use the API, but the program won't work with UAC on either) - When I get some time I'll set it to manually do the regkeys.  UAC won't let you modify the HKLM section of the registry (without Administrator priveleges, no not the "My account is in the Administrators group" kind), so if you want to implement DllRegisterServer with UAC turned on you need to use HKCU for the regkeys, not HKLM.

There is a page on MSDN on programming with UAC in mind (Installation, Paths, etc..) I could link it to you if you want.
Title: Re: [SOLVED] (VB6+Vista) Creating Objects
Post by: Ersan on November 24, 2006, 03:26 PM
Please do.
Title: Re: [SOLVED] (VB6+Vista) Creating Objects
Post by: Warrior on November 24, 2006, 05:47 PM
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/UxGuide/UXGuide/Environment/UAC/UAC.asp

http://msdn.microsoft.com/windowsvista/reference/default.aspx?pull=/library/en-us/dnlong/html/AccProtVista.asp

http://www.microsoft.com/technet/windowsvista/security/uacppr.mspx

Some may be older than others so just keep that in mind although I doubt much has changed conceptually.