Solved

Connecting to DLL

Posted on 2002-06-26
4
233 Views
Last Modified: 2010-04-15
Hello,

Its a beginner question :

1) How easy is it to connect with C# to DLL ? is there some easy mechanism ?
2) The same question -> about   building ActiveX / OCX

Does the implementation is more like VB or VC ?

thank u
Asi
0
Comment
Question by:asi
  • 2
4 Comments
 
LVL 1

Expert Comment

by:xloop
ID: 7110254
It's very simple, you add your reference to the DLL/OCX via

Then add your DLL in the same directory as your application file.

No more entering dll's into the registry.

Simple as that!

Good luck
0
 
LVL 1

Expert Comment

by:xloop
ID: 7110255
It's very simple, you add your reference to the DLL/OCX via Project menu > Add Reference

Then add your DLL in the same directory as your application file.

No more entering dll's into the registry.

Simple as that!

So it's not really like VB or VC

Good luck
0
 
LVL 2

Expert Comment

by:flytiger
ID: 7112500
use C# command line complier

csc /target:exe /r:anything.dll  yourcode.cs

0
 
LVL 3

Accepted Solution

by:
jrspano earned 50 total points
ID: 7122058
1) How easy is it to connect with C# to DLL ? is there some easy mechanism ?
Depends on the kind of dll you want to connect to.  If it is a standard win32 dll you use the DllImport function in System.Runtime.InteropServices.  If it is an active x dll you set a reference to the dll just like in vb6 and then use it.  On the target machine you must make sure the activex dll is installed and registered just like you would have had to do before using it in vb6


2) The same question -> about   building ActiveX / OCX
It is very easy to build dll's and ocx's in c# to use in other .net languages.  Just set a reference to the dll/ocx project and you are done.  If you want to make an activex dll or ocx to use in another language like vb6, it is harder.  You have to wrap the dll/ocx and give it a strong name(guid).  then it can be installed and registered like other activex controls and used in vb6.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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