Solved

Connecting to DLL

Posted on 2002-06-26
4
235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Amazon S3 .Net error 5 79
need to convert function to c# 5 55
WPF and Powershell button hover change text 5 63
asp.net repeater server posting 5 38
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

759 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