Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connecting to DLL

Posted on 2002-06-26
4
Medium Priority
?
239 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 200 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

885 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