Solved

Connecting to DLL

Posted on 2002-06-26
4
231 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now