Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Windows Server 2008, CreateObject and a VB6 dll

Reply
 
Old 08-12-2008   #1 (permalink)
Anthony Jones


 
 

Windows Server 2008, CreateObject and a VB6 dll

I wonder if anyone has come across the following:-

Create an empty ActiveX dll project and just compile it as is.

Drop the dll somewhere on a 2008 server and register it.

In VBScript use:-

Set o = CreateObject("Project1.Class1")

I get the classic "can't create" 800A01AD error.

Now create a Standard Exe project in the Form_Load place similar code:-

Dim o As Object

Set o = CreateObject("Project1.Class1")

Build the Exe and place it on the 2008 server

Run the Exe, no problem works fine.

Add a MsgBox "Hello" to the Class_Initialise in the DLL just to be sure.

From the Exe all is well, but VBScript is unable to instance the class.

Any one know whats going on here? Whats changed in VBScript on 2008 to
cause this problem?

Specifically I'm getting this problem in ASP hosted VBScript with some but
not all of my VB6 dlls and I can't see what it is that allows some to work
and not others.


--
Anthony Jones - MVP ASP/ASP.NET



My System SpecsSystem Spec
Old 08-12-2008   #2 (permalink)
Ralph


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll


"Anthony Jones" <Ant@xxxxxx> wrote in message
news:%23hW0yLI$IHA.3756@xxxxxx
<snipped>
Quote:

> Specifically I'm getting this problem in ASP hosted VBScript with some but
> not all of my VB6 dlls and I can't see what it is that allows some to work
> and not others.
>
>
As an MVP you have probably already done this, but since you didn't say so,
and just in case ... <g>

Are you sure you have a ProgID with that name in the Registery? It contains
the correct CLSID to dereference the correct component? And it is in a Hive
the VBScript can see?

Also check for versions - project.component.<version>. Is the default
(non-versioned) entry correct?

-ralph


My System SpecsSystem Spec
Old 08-12-2008   #3 (permalink)
JC


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll

"Anthony Jones" wrote...
Quote:

>Specifically I'm getting this problem in ASP hosted VBScript with some
>but not all of my VB6 dlls and I can't see what it is that allows some
>to work and not others.
Thinking along the lines that you are using IIS 5 or 5.1, make sure the
permissions on the the ActiveX file are proper, that is if you use a
special account name for IIS, make sure that compiled file gets proper
rights.

--
Jim Carlock


My System SpecsSystem Spec
Old 08-12-2008   #4 (permalink)
Anthony Jones


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll

"Ralph" <nt_consulting64@xxxxxx> wrote in message
news:eCacdXJ$IHA.4800@xxxxxx
Quote:

>
> "Anthony Jones" <Ant@xxxxxx> wrote in message
> news:%23hW0yLI$IHA.3756@xxxxxx
> <snipped>
Quote:

> > Specifically I'm getting this problem in ASP hosted VBScript with some
but
Quote:
Quote:

> > not all of my VB6 dlls and I can't see what it is that allows some to
work
Quote:
Quote:

> > and not others.
> >
> >
>
> As an MVP you have probably already done this, but since you didn't say
so,
Quote:

> and just in case ... <g>
>
> Are you sure you have a ProgID with that name in the Registery? It
contains
Quote:

> the correct CLSID to dereference the correct component?
Yes I've checked whats in the registry and it matches what I would expect.
The entries are identical to the entries as I see them on the Windows 2003
server that I use to compile on.
Quote:

>And it is in a Hive the VBScript can see?
I'm not sure how I would do that, the only true hive involved is
HKEY_LOCAL_MACHINE.

Its strange that very nearly identical usage of the dll compiled into an Exe
works but the VBScript usage doesn't. I suspect that is some kind of
additional security feature that I need to work through yet that doesn't
explain why other dlls manage to work. (I've tried it in JScript but it
fails there as well).

Quote:

> Also check for versions - project.component.<version>. Is the default
> (non-versioned) entry correct?
>
There are no versioned ProgIDs

Thanks for the ideas.


--
Anthony Jones - MVP ASP/ASP.NET


My System SpecsSystem Spec
Old 08-12-2008   #5 (permalink)
Anthony Jones


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll

"JC" <news@xxxxxx> wrote in message
news:uhkEZmJ$IHA.4124@xxxxxx
Quote:

> "Anthony Jones" wrote...
Quote:

> >Specifically I'm getting this problem in ASP hosted VBScript with some
> >but not all of my VB6 dlls and I can't see what it is that allows some
> >to work and not others.
>
> Thinking along the lines that you are using IIS 5 or 5.1, make sure the
> permissions on the the ActiveX file are proper, that is if you use a
> special account name for IIS, make sure that compiled file gets proper
> rights.
>

Being Server 2008 this wiil be under IIS7. However I'm just experimenting
with VBScript running as the machine administrator. Permissions should not
be an issue. However there are all sorts of new protocols for security, I'm
fairly sure I'm missing something very Server 2008 specific but I've no clue
what that is.


--
Anthony Jones - MVP ASP/ASP.NET


My System SpecsSystem Spec
Old 08-12-2008   #6 (permalink)
JC


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll

"Anthony Jones" wrote...
Quote:

>Being Server 2008 this wiil be under IIS7. However I'm experimenting
>with VBScript running as the machine administrator. Permissions
>should not be an issue. However there are all sorts of new protocols
>for security, I'm fairly sure I'm missing something very Server 2008
>specific but I've no clue what that is.
I think I've heard that things need to get placed into the "Program
Files" folder to get executable permissions. And IF there's a way to
let the IIS server know that an executable resides somewhere else,
then perhaps you need to go back into the server configuration and
tell it to accept the "newly compiled" file. When the file gets
compiled it should get the default permissions for that folder it
resides in. You may need to reset the permissions during a
recompile.

Just curious, how do you configure IIS 7 to use a particular .dll?

--
Jim


My System SpecsSystem Spec
Old 08-14-2008   #7 (permalink)
Anthony Jones


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll

"Anthony Jones" <Ant@xxxxxx> wrote in message
news:%23hW0yLI$IHA.3756@xxxxxx
Quote:

> I wonder if anyone has come across the following:-
>
> Create an empty ActiveX dll project and just compile it as is.
>
> Drop the dll somewhere on a 2008 server and register it.
>
> In VBScript use:-
>
> Set o = CreateObject("Project1.Class1")
>
> I get the classic "can't create" 800A01AD error.
>
> Now create a Standard Exe project in the Form_Load place similar code:-
>
> Dim o As Object
>
> Set o = CreateObject("Project1.Class1")
>
> Build the Exe and place it on the 2008 server
>
> Run the Exe, no problem works fine.
>
> Add a MsgBox "Hello" to the Class_Initialise in the DLL just to be sure.
>
> From the Exe all is well, but VBScript is unable to instance the class.
>
> Any one know whats going on here? Whats changed in VBScript on 2008 to
> cause this problem?
I knew it had to be embarrasingly simple.

A VBS file will by default be executed by the WScript.exe in System32 folder
but on a 64 bit system this is a 64 bit process. Trying to instance the
class fails since the dll is 32 bit. Using the WScrpt.exe in the SysWOW64
folder works fine.
Quote:

>
> Specifically I'm getting this problem in ASP hosted VBScript with some but
> not all of my VB6 dlls and I can't see what it is that allows some to work
> and not others.
>
I suspect that I thought had this problem in ASP but it was really only a
registration problem however since after registration I still had a problem
with VBS I thought it was the same problem. I should've have re-tested in
ASP also.


--
Anthony Jones - MVP ASP/ASP.NET


My System SpecsSystem Spec
Old 08-14-2008   #8 (permalink)
Ralph


 
 

Re: Windows Server 2008, CreateObject and a VB6 dll


"Anthony Jones" <Ant@xxxxxx> wrote in message
news:%23RcGqyg$IHA.4032@xxxxxx
Quote:

>
> I knew it had to be embarrasingly simple.
>
90% of the time they are. <g>

Quote:

> A VBS file will by default be executed by the WScript.exe in System32
folder
Quote:

> but on a 64 bit system this is a 64 bit process. Trying to instance the
> class fails since the dll is 32 bit. Using the WScrpt.exe in the SysWOW64
> folder works fine.
>
Quote:

> >
> > Specifically I'm getting this problem in ASP hosted VBScript with some
but
Quote:
Quote:

> > not all of my VB6 dlls and I can't see what it is that allows some to
work
Quote:
Quote:

> > and not others.
> >
>
> I suspect that I thought had this problem in ASP but it was really only a
> registration problem however since after registration I still had a
problem
Quote:

> with VBS I thought it was the same problem. I should've have re-tested in
> ASP also.
>
Thanks for reporting back. Your 'discovery' is sure to help others.

-ralph


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Error when installing SQL Express 2008 on Windows Server 2008 PowerShell
Windows Server 2008 hosted on Virtual Server 2005 R2 very slow Virtual Server
Cna't Install Windows Server 2008 under Virtual Server SP1 Virtual Server
Error installing Windows Server 2008 as Virtual Server Virtual Server
Bug: Windows Modules Service Is Broken In Windows Server 2008 Beta 3 Web Server Addition. Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46