Re: Problem Using VB.net Class Library DLL in VBScript
- From: Brian Kudera <BrianKudera@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 29 Oct 2007 10:11:01 -0700
Finally was able to get it to work. Also had to specify the /codebase option
as my DLL is in a DLL specific path and not in the path of the exe calling it
(wscript.exe or cscript.exe).
The command line I used to register a DLL named DIS.DLL and that exists in
the following directory C:\INGEN\DISPROG\ was:
=====================================================
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Monitor>cd c:\ingen\disprog
C:\INGEN\DISPROG>c:\windows\microsoft.net\framework\v2.0.50727\regasm
dis.dll /codebase
Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
Types registered successfully
C:\INGEN\DISPROG>
=====================================================
"Brian Kudera" wrote:
Ok I think I might be making some progress. The problem with using Regasm.
was that I was using the regasm from the 1.0 framework folder. After
switching to the Regasm.exe in the 2.0 framework folder it says it registered
successfully.
I'm still having some issues creating and using one of the classes in my DLL
but I'll post more detail later.
I do have one other question right now- is there any way that I can automate
the registration of this like Visual Studio does to make it more user
friendly for deployment? If the user double clicks on the DLL I would like it
to automatically search for the appropriate regasm tool in the necessary
directory and make the entries in the registry. Is this possible?
=====================================================
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Monitor>cd c:\ingen\disprog
C:\INGEN\DISPROG>c:\windows\microsoft.net\framework\v1.1.4322\regasm dis.dll
Microsoft (R) .NET Framework Assembly Registration Utility 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
RegAsm error: Failed to load 'C:\INGEN\DISPROG\dis.dll' because it is not a
vali
d .NET assembly
C:\INGEN\DISPROG>c:\windows\microsoft.net\framework\v2.0.50727\regasm dis.dll
Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.42
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
Types registered successfully
C:\INGEN\DISPROG>
=====================================================
"Phill W." wrote:
Brian Kudera wrote:
I am trying to create one DLL that I can use in vbscripting that has all of
the common codes and other additional input forms, controls, etc. I have
DIS.DLL, namespace is DLL, and so far have written four COM Classes (Project
| Add Item | Com Class) so it automatically generates the GUID's for each of
my classes. Sample code for one of my classes is below.
On my integration machine I tried dropping the DLL in C:\DIS and:A .Net assembly, even one designed for Interop, is not a valid 32-bit
1. Double clicking on it to register to regsvr32 but get the error that the
entry point cannot be found
executable and can't be fed directly into Regsvr32.
2. Using a regasm.exe tool that I have read about for COM classes, but get
an error saying -Failed to load DIS.DLL because it is not a valid .NET
assembly
That's worrying. Your .Net Assembly is not a valid .Net assembly???
3. Tried using gacutil.exe but am getting an error saying -Failure addingGacUtil and Regasm are entirely different tools for entirely different
assembly to the cache: unknown error.
different purposes.
Running regasm on your development machine (which the "Register for
InterOp" option does for you) should create you a Type Library (.tlb).
This contains all the COM definitions required.
Use RegTLib.exe on the target machine to "register" the .tlb.
HTH,
Phill W.
- References:
- Problem Using VB.net Class Library DLL in VBScript
- From: Brian Kudera
- Re: Problem Using VB.net Class Library DLL in VBScript
- From: Phill W.
- Re: Problem Using VB.net Class Library DLL in VBScript
- From: Brian Kudera
- Problem Using VB.net Class Library DLL in VBScript
- Prev by Date: Re: The way of creating a settings / config form?
- Next by Date: Re: The way of creating a settings / config form?
- Previous by thread: Re: Problem Using VB.net Class Library DLL in VBScript
- Next by thread: CASE or IF statement in Datacolumn.Expression
- Index(es):
Relevant Pages
|