Solved

Creating DLLs vb.net 2005 to reference in vbscript

Posted on 2006-10-24
9
411 Views
Last Modified: 2008-02-01
Forgive the relatively simple question, but i cant seem to find any information on it.

I normally write activeX controls with vb6 as it exports them to ocx which I find easier to work with. However, I have decided to move up and start using vb 2005 for this, but it saves the control as DLL which i cant seem to register with regsrv32.exe, which means i cant reference it in my scripts.

Am i doing something wrong to stop it from registering, or do we deal with these DLL librarys differently now?
0
Comment
Question by:DjDezmond
9 Comments
 
LVL 10

Expert Comment

by:MrClyfar
ID: 17794612
Hi there.

.NET compiles the control in a .NET Assembly file (.DLL). This is different to the old ActiveX DLL's from the VB 6 days. You can't register these .NET Dll's, to use them with a .NET project, you must add a reference to them in the project.

Jas.
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17794637
To use .NET Dll in VBScript, it is necessary to register it for COM interoperability. In the project settings, select Compile tab and check "Register for COM interop". .NET Dll is registered as COM library and can be used by COM clients. See also: regasm.exe program.
0
 
LVL 9

Author Comment

by:DjDezmond
ID: 17794638
I need to create them to use with VbScript, so i need to reference them externally, ill never be using them with another .net project.

Can this not be done?
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17794656
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 17794886
We are working on what is arguably the largest VB6/VB.NET application in the world - over 5,000,000 (Yes, I said 5 MILLION) total lines of code.  The majority of the Client layer (The application runs on Windows Workstations distributed to more than 130 sites world-wide - this is NOT a Web-based application) is written in VB6, while the Business and Datalayer code is written entirely in VB.NET 2005 (The client workstations commnicate with a single, centalized database, via Web Services).  The Business and Datalayer DLLs are all compiled as COM_Compatible DLLs, which are 'registered' using REGASM, so thast the .NET code can be accessed from the VB6 Front-end.  This same configuration would be accessible, in almost the same way, from VBScript, it that were necessary.

AW
0
 
LVL 9

Author Comment

by:DjDezmond
ID: 17795108
OK boys, thanks alot.

I've used that link alex and it explained it pretty well. Just one more question...

To avoid using REGASM (this dll will be deployed everytime we build an image, so id rather cut down on un-needed exes) what is my component ID?

CreateObject("  ")

The DLL info is as follows:

Assembly name : CapBuildControl
Root namespace: CapBuildControl
ComClass : ControlClass
Filename : CapBuildControl.dll

Or is it something else?
0
 
LVL 9

Author Comment

by:DjDezmond
ID: 17795118
BTW... it wont register still with regsvr32.exe, so im assuming if its in the same directory as the script, it should still create?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17795173
I don't think that you can avoid using regasm. It must be part of installation process: registering .NET Dll as COM component. On developer computer, this is done by Visual Studio in the end of project build, but on target computer you must register library.
0
 
LVL 9

Author Comment

by:DjDezmond
ID: 17795195
Yea, ive just worked that out. It was working all along on my developing machine, i was just struggling on my test machine. I didnt first realise that REGASM would already be on the target machines, so it wont be a problem.

Again, thanks alot lads.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now