473,320 Members | 1,828 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.

Register a .NET DLL???

I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would be
just as easy...
Thanks in advance for any help you can give me,
J.
Jan 31 '06 #1
7 7393

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would be
just as easy...
Thanks in advance for any help you can give me,
J.

If you select Project->Add Reference, then click the .NET tab in the Add
Reference dialog, do you then see your DLL?
Jan 31 '06 #2
No, I do not see it... In either the .NET, or COM. I really want to see it
in the COM tab...

"pvdg42" <pv****@newsgroups.nospam> wrote in message
news:eE**************@TK2MSFTNGP11.phx.gbl...

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would
be just as easy...
Thanks in advance for any help you can give me,
J.

If you select Project->Add Reference, then click the .NET tab in the Add
Reference dialog, do you then see your DLL?

Jan 31 '06 #3
If I understand you right, why are you trying to use a .NET assembly as a
COM component in a client .NET application? Why are you not using it
directly as a .NET component?

Visual Studio will not allow you to import a .NET DLL into a .NET project as
a COM component. What's the point?

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would be
just as easy...
Thanks in advance for any help you can give me,
J.

Jan 31 '06 #4
I am trying to create a .NET DLL to use in NAVISION. I am using .NET
Executable as an example as not many people know Navision.
We have created VB6 DLL's in the past, but I would like to see if .NET would
be easier as the deployment would be much simpler.

When we create a VB6 DLL, we would just REGSVR32 it and that is it. We can
select it as a reference within Navision, but with .NET I am not able to do
this.

Thanks,
"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
If I understand you right, why are you trying to use a .NET assembly as a
COM component in a client .NET application? Why are you not using it
directly as a .NET component?

Visual Studio will not allow you to import a .NET DLL into a .NET project
as a COM component. What's the point?

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would
be just as easy...
Thanks in advance for any help you can give me,
J.


Jan 31 '06 #5
Like I said, VS does not let you do it, neither does tlbimp.exe allow you to
generate an interop assembly from a tlb which was generated from an
assembly. Why have a middleman when you can use it directly?

You could try using the TypeLibConverter class to see if that would do it,
but I wouldn't bank on it. If that doesn't work I'm not sure what you can do
apart from writing your own interop assembly, but what would be the point of
that? Maybe you could tinker with the tlb in some way to fool tlbimp.exe,
but I wouldn't know how to do that if it's even possible. It all seems like
a whole lot of tedious and unnecessary work when you could just use your
..NET assembly directly.

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I am trying to create a .NET DLL to use in NAVISION. I am using .NET
Executable as an example as not many people know Navision.
We have created VB6 DLL's in the past, but I would like to see if .NET
would be easier as the deployment would be much simpler.

When we create a VB6 DLL, we would just REGSVR32 it and that is it. We
can select it as a reference within Navision, but with .NET I am not able
to do this.

Thanks,
"Clive Dixon" <cl*******************@digita.noluncheonmeat.com > wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
If I understand you right, why are you trying to use a .NET assembly as a
COM component in a client .NET application? Why are you not using it
directly as a .NET component?

Visual Studio will not allow you to import a .NET DLL into a .NET project
as a COM component. What's the point?

"John\" <jo@jonkar.ca> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I created a simple DLL called: MyDLL

I have been trying to register it so I can see it in the COM References;

Regsvr32 does not work for .NET DLL

RegAsm - seems to work, but I can not select the DLL from the Add COM
References.

I can not choose Browse as this is not an option in the application I am
trying to use it...

VB6 DLL's are no problem, so I would have thought that a .NET DLL would
be just as easy...
Thanks in advance for any help you can give me,
J.



Jan 31 '06 #6
You need to create a COM callable wrapper for your .net assembly to
make it appear in COM References in Navision. Here are the steps:

1. Add the following attributes to your classes

[Guid("use GUIDGen.exe to create GUID for urself")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MyApp.MyClass")]

Each class should have a unique GUID, and ProdID

2. Make your classes implmenent interfaces. (Not strictly required but
is good practice to make sure that COM callable wrappers work without
hitches). Example below:

[Guid(...)]
[InterfaceType.ComInterfaceType.InterfaceIsIDispatc h)]
public interface MyInterface
{
//Method definitions go here...
}

[Guid(...)]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("MyApplication.MyClass")]
public class MyClass : MyInterface
{
//Interface implementation goes here...
}

3. If you are using VS.Net then do the following or goto step 4:
In project properties set the properties Register for Com Interop
to true. Now when you build the project, a COM Wrapper will be created
and registered. It should show up in COM References tab

4. Use regasm to register the ccw (com callable wrapper) of the
assembly. Optionally use the /tlb: switch to generate a type library
for the .net assembly.

After these steps you should be good to go... For more information
check the following links:

http://msdn.microsoft.com/library/de...blewrapper.asp
- CCW MSDN Docs
http://weblogs.asp.net/psteele/archi...16/157767.aspx - RegAsm
and COM

Hope this helps...
- NuTcAsE

Jan 31 '06 #7
Here is a downloadable example of creating a COM callable wrapper for
your .NET assembly. It includes batch files which do all the work for
you! The example shows how to call a .NET DLL from a Java client, but
the steps for generating the COM wrapper are the same for any client
language which can call COM components.

http://j-integra.intrinsyc.com/suppo...?article=78813

Regards,
Shane Sauer
------------------------------------------------------------------------------
J-Integra Interoperability Solutions
http://j-integra.intrinsyc.com/
high performance interop middleware for java, corba, com & .net

Jan 31 '06 #8

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

Similar topics

1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
12
by: Ioannis Vranos | last post by:
Just some thought on it, wanting to see any explanations. It was advised in this newsgroups that we should avoid the use of keyword register. However it is a language feature, and if it...
3
by: Alex | last post by:
I apoligise in advance if this is an os or platform based question, I don't know. I was wondering how register integers (and other types of register variables) are managed by c++. For example,...
14
by: aruna | last post by:
What is the disadvantage of using register storage class specifier?
9
by: Jackie | last post by:
Hi everyone, Does anyone know when "register" declarations should be used and when "register" must not be used? If possible please give examples for both cases. Thanks
29
by: orium69 | last post by:
hi everyone, i'm wondering if there is a way to have sure that a variable is allocated in the cache, after its declaration with "register"? Tks!
33
by: Snis Pilbor | last post by:
With the "as if" rule in play, doesn't that effectively render the "register" keyword completely useless? Example: I make a silly compiler which creates code that goes out of its way to take a...
5
by: prouleau001 | last post by:
Hi all! Since that the decorator syntax is upon us, I think it would be good if atexit.register() was returning the function passed as argument. This simple change to the library would solve a...
26
by: Vashna | last post by:
Hi Group, I have a doubt about register variables. I know that if we have a variable used very frequently in a function, then provided we never apply the & function to it, we can define it as...
21
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
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...
0
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...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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.