Solved

Creating DLLs vb.net 2005 to reference in vbscript

Posted on 2006-10-24
9
424 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17794656
0
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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