Deploy .Net library ????

G

Guest

Dear all,

I have build a dll using visual .Net
I have an old application build with VB5 that I need to extend
functionnalities with this created .Net DLL.

How can I do to be able to access my .Net dll inside my VB5 project, as it
is not an ActiveX for VB5 and this library can be register for VB5 used in
the computer where it will run?

thnaks fro your answer
Regards
Serge
 
R

Relaxin

I know nothing about VB, but try registering it like a COM object by using
RegAsm.exe.
Then use it like any other COM object.
 
C

Cor Ligthert

Serge,

You cannot the .Net library is reall a library full of Net intermidiate
code.

At the development of VB5 that did not exist than.

Cor
 
G

Guest

In fact I have two different primary partition environement
On the first partition C I have Windows 2000 pro and Vb5
ON second partition D I have Windows 2000 pro and VB.net

Each enviroenemtn are really separated and cannot see ecah other, this in
order to get a clean developement enviromenet, casue by experience I get bad
behaviour when mixing.

I have copy the .Net dll and the generated Reg file by RegAsm.exe to a
folder under C drive, then I have apply my reg file

I cannot see my new register library in object browser and if I add it from
project component browse button it fails.

Do I have to get the .net framework also installed on my VB5 partition ?

thnaks for your help

regards
serge
 
G

Guest

Some more information, here is how I have done it..
I have copy manually the assembly that I want to acces from COM to my VB5
environement

I place it under my application folder
I run the Regasm.exe utility with my assembly as parameter
It reports that types successfully register

Then I open my application
Then what ever I do, point manually to my component browse button to add the
new type to my project or calling the object library broswer, I could not see
my type.

If I add add a refence to my assembly, I get error saying it can not add
file data

How can I access my libraray as son as it reports that it is properly
register by asmreg.exe utility

thanks for your reply
Serge
 
G

Guest

You said that it is not possible!!! But then why microsoft provide in .Net
the commande line tool RegAsm.exe <assembly name> which is able to create
assembly registry entry to be recognize d by COM components.
I ma able to generate properly those entry but I do not know how to get
those types visible in VB5. I know from difference sourec that it is
possible, but I am doing surely something wrong

Regards
Serge
 
M

Michael Groeger

But com existed, so you surely can expose .net assemblies as an com
interface
 
M

Michael Groeger

Serge,

When creating a com callable wrapper all you do is create a thin class which
wraps your .net assembly providing a com interface to the com world. the
logic behind that assembly still is .net so you must install the proper
framework (1.0, 1.1) to be able to use your assembly.

Michael
 
G

Guest

Hi,

I got it, I finally get it to work by using the TLBEXP tool to generate the
tlb file.
Then from my COm application I can brows to my library type and be able to
use it and see all function it contains

I did not use at all the RegAsm tool but I guess the same thing can be doen
with the use of the /tlb switch

regards
serge
 
M

Michael Groeger

Hi Serge,

yes I think that both methods should work the same way. I think TLBEXP was
designed for simply exporting the interface to carry it out on a remote
machine (for dcom?). I exposed .NET assemblies only once in a practice
lesson, but never really digged deeper into it. Maybe soon we need to do so,
as we try to boost some old Excel applications.

Michael
 
G

Guest

hi micheal,

That s exactly the same thing for me, I do this as a practice test also
becasue I have started to go to my MCAD certification.

I have try the RegAsm.exe with /tld and it extract the tlb file and register
it in one shot.

regard
Serge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top