?
Solved

Creating DLLs vb.net 2005 to reference in vbscript

Posted on 2006-10-24
9
Medium Priority
?
436 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:Jason Evans
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Accepted Solution

by:
AlexFM earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 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