473,883 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7412

"John\" <jo@jonkar.ca > wrote in message
news:%2******** ********@TK2MSF TNGP15.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****@newsgro ups.nospam> wrote in message
news:eE******** ******@TK2MSFTN GP11.phx.gbl...

"John\" <jo@jonkar.ca > wrote in message
news:%2******** ********@TK2MSF TNGP15.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******** ********@TK2MSF TNGP15.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******** ********@TK2MSF TNGP10.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******** ********@TK2MSF TNGP15.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 TypeLibConverte r 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******** ********@TK2MSF TNGP09.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******** ********@TK2MSF TNGP10.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******** ********@TK2MSF TNGP15.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( ClassInterfaceT ype.None)]
[ProgId("MyApp.M yClass")]

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.C omInterfaceType .InterfaceIsIDi spatch)]
public interface MyInterface
{
//Method definitions go here...
}

[Guid(...)]
[ClassInterface( ClassInterfaceT ype.None)]
[ProgId("MyAppli cation.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 Interoperabilit y 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
14167
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 uninitialized value in concatenation (.) at register.pl line 38, <STDIN> line 10." The PERL code is as follows:
12
2257
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 offers no help to an implementation, it is free to ignore it. And this happens widely, all my C++ compilers in my platform ignore this keyword.
3
2257
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, on a pentium 4, there are 8 register integers in the cpu. If you define more than 8, or if there are other programs using this space, how are the variables allocated. This is for a simulation program that needs to be very fast. For example:
14
7922
by: aruna | last post by:
What is the disadvantage of using register storage class specifier?
9
8617
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
2485
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
3306
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 full 10 minutes every time a "register" declared variable is read from or written to. Besides this lag, everything else runs as expected. Then my compiler is still C compliant, aye? If so, then it is unwise for any programmer to ever use the...
5
1898
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 problem with the use of atexit.register as a decorator (and I can't think of any use case where this change would break any code). I describe the problem in the following text.
26
2239
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 a register variable and this will make it much faster to access. Now the question is: obviously there are only a fixed number of registers in our CPU, maybe 6 or something. So how do we choose which
21
6375
by: JOYCE | last post by:
Look the subject,that's my problem! I hope someone can help me, thanks
0
10767
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10864
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7980
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7137
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5807
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6008
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3242
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.