473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using VB.NET object in VB 6.0 project

Hello, My company is experimenting with adding VB.NET classes to currently
existing VB 6 code. The idea is to gradually migrate to a purely object
oriented solution. When I run the code in development environment it works
fine - but when I sent the dll (NET) I created and the Interop.dlls along
with the exe to be reviewed, the reviewer got an error "Could not create
ActiveX control". I asked if he had registered them and it turned out
registering gave an error (~ could not load library...).
I assume if the entire .NET framework was installed on the test machine it
would work but I would like to know what could be done outside of running a
full 'install' of the application to be tested. ie. we want to just 2
click on the exe, run it and have it invoke the .NET dll.
Also, do we have to register the tlb file on the target machine?

Any help would be GREATLY appreciated!

Nov 22 '05 #1
3 2411
Mr Sir,

Did you know that there is a special upgraders newsgroup for vb

microsoft.public.dotnet.languages.vb.upgrade

Probably you find your answer there faster.

It is not very active however I thought, that almost every question is
answered.

I hope you get your solution.

Cor

"Mr Sir" <so*****@somewhere.com>
Hello, My company is experimenting with adding VB.NET classes to currently
existing VB 6 code. The idea is to gradually migrate to a purely object
oriented solution. When I run the code in development environment it
works
fine - but when I sent the dll (NET) I created and the Interop.dlls along
with the exe to be reviewed, the reviewer got an error "Could not create
ActiveX control". I asked if he had registered them and it turned out
registering gave an error (~ could not load library...).
I assume if the entire .NET framework was installed on the test machine it
would work but I would like to know what could be done outside of running
a
full 'install' of the application to be tested. ie. we want to just 2
click on the exe, run it and have it invoke the .NET dll.
Also, do we have to register the tlb file on the target machine?

Any help would be GREATLY appreciated!


Nov 22 '05 #2
"Mr Sir" <so*****@somewhere.com> wrote:
Hello, My company is experimenting with adding VB.NET classes to currently
existing VB 6 code. The idea is to gradually migrate to a purely object
oriented solution. When I run the code in development environment it works
fine - but when I sent the dll (NET) I created and the Interop.dlls along
with the exe to be reviewed, the reviewer got an error "Could not create
ActiveX control". I asked if he had registered them and it turned out
registering gave an error (~ could not load library...).
I assume if the entire .NET framework was installed on the test machine it
would work but I would like to know what could be done outside of running a
full 'install' of the application to be tested. ie. we want to just 2
click on the exe, run it and have it invoke the .NET dll.
Also, do we have to register the tlb file on the target machine?

Any help would be GREATLY appreciated!


Sounds like you already created the CCW (COM Callable
Wrapper) and moved it with the assembly over to the Testing
Machine. However I see no evidence that you registered the
assembly on the test machine with Regasm.exe (analogous to
using regsrv32.exe for a COM Component). This really is a
step that should be performed by the application's setup
project.

In general:

To make .NET assemblies available to applications that use
COM you need to use this:

NET Framework Tools Assembly Registration Tool (Regasm.exe)
http://msdn.microsoft.com/library/de...lregasmexe.asp

..NET Framework Developer's Guide Registering Assemblies
with COM
http://msdn.microsoft.com/library/de...ieswithcom.asp
see also
..NET Framework Tools Type Library Exporter (Tlbexp.exe)
http://msdn.microsoft.com/library/de...rTlbExpexe.asp

You may also have to add some code/attributes to the .NET
code to supply additional COM metadata/functionality.

..NET Framework Developer's Guide: Exposing .NET Framework
Components to COM
http://msdn.microsoft.com/library/de...nentstocom.asp

Visual Studio: Deployment Projects
http://msdn.microsoft.com/library/de...entproject.asp

This article might also illuminate some of the issues you
are dealing with

Microsoft Office and .NET Interoperability
http://msdn.microsoft.com/library/de...ce11012001.asp
Nov 22 '05 #3
Best help for you and your coworkers on the project is to go to your local
bookstore today and get Rockford Lhotka and BIlly Hollis' "Professional
Visual Basic Interoperability: COM and VB6 to .Net"

I think it only had a .Net1.0 version ... if it's at your store get it
anyway. The main stuff you need is in it and the differences will be more
easy to figure out after you've read the first several chapters of this
book.

If it's not at your store then rush it from amazon, they've got a deal on it
because of the death of WROX press.

There are other Interop books, some with lots more neat-geeky code that will
make you think that your money will go farther on them ... but it sounds
like you need a crash course and you need it in a syntax that will make it
work for you. This is the book.

Robert Smith
Kirkland, WA
www.smithvoice.com.
"Mr Sir" <so*****@somewhere.com> wrote in message
news:Ch*********************@read2.cgocable.net...
....

Any help would be GREATLY appreciated!


Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
14
by: Curtis Tammany | last post by:
Hello- Can someone tell me if DSOFile.dll can be accessed within ASP.NET? DSOFile.dll is registered and I have no problem using it in my .ASP scripts. I have tried the following: Dim...
4
by: Terry | last post by:
I'm building some dll assemblies that have in them the implementation of an abstract class defined in a different assembly. I'm trying to create objects of the type defined in the dlls with...
3
by: Ben Terry | last post by:
I have imported a legacy C++ project into a VisualStudio.NET 2003 solution. I have some new C# projects in the solution as well. I am using the managed extensions in my C++ project so that I can...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
0
by: Al Fatykhov | last post by:
Using MABLE logic engine with existing .NET applications. MABLE web services provide an interface to MABLE business objects and logic. Let us review some technical details of the MABLE web...
1
by: Diffident | last post by:
Hello All, I have a question as to why my users are noticing error when I am building the project on the production system. Here is the problem's background. In order to build the project on...
0
by: tony | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. In this user control we have a class...
4
by: Praveen Chandra | last post by:
Hi, I just wanted to put down the issue with more detailed information so that you can help us get to the right Microsoft resource for a solution! Here is the problem description... Our...
5
by: jehugaleahsa | last post by:
Hello: I am trying to find what is the very best approach to business objects in Windows Forms. Windows Forms presents an awesome opportunity to use DataTables and I would like to continue doing...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.