Computing.Net > Forums > Programming > Referencing a DLL help! (C#)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Referencing a DLL help! (C#)

Reply to Message Icon

Name: Leo the 28C (by Sulfurik)
Date: June 28, 2005 at 20:03:47 Pacific
OS: Windows XP SP2
CPU/Ram: 1.4 GHz/480 MB
Comment:

Hello everyone! :D
OK, how can I include a COM DLL in a C# program without copying it to the program's folder? I want to use the DLL from the Windows\System32 directory. The DLL is shdocvw.dll. How can I do this? Thanks! ;)

http://www.boredsource.com/sulfurik/
http://tsfc.ath.cx
ftp://tsfc.ath.cx
hotline://tsfc.ath.cx

Giving out blank CD's in my FTP server! :D



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: June 29, 2005 at 02:44:30 Pacific
Reply:

use the DLLImport function:

[DllImport("User32.dll")]
public static extern int MessageBox(int h, string m, string c, int type);


this example shows importing user32.dll and declaring a function to use within that dll (extern is the important keyword here)

Hope this helps,
Chi


0

Response Number 2
Name: Leo the 28C (by Sulfurik)
Date: June 29, 2005 at 18:24:21 Pacific
Reply:

Yeah, but mine is a .NET DLL, not just a regular COM one... :P
Thanks! ;)

http://www.boredsource.com/sulfurik/
http://tsfc.ath.cx
ftp://tsfc.ath.cx
hotline://tsfc.ath.cx

Giving out blank CD's in my FTP server! :D


0

Response Number 3
Name: Leo the 28C (by Sulfurik)
Date: June 30, 2005 at 22:40:31 Pacific
Reply:

Ohh wait! I said it wrong... It was a COM DLL, but I need to use it as I'm using it now so I have the WebBrowser control in my toolbox... :P
Thanks! ;)

http://www.boredsource.com/sulfurik/
http://tsfc.ath.cx
ftp://tsfc.ath.cx
hotline://tsfc.ath.cx

Ruffle Mayo says ROFLMAO! :D


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Prime Number problem in j... Assigning Variables



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Referencing a DLL help! (C#)

StuartS...DLL in C++ for use in VB? www.computing.net/answers/programming/stuartsdll-in-c-for-use-in-vb/12545.html

How to use a DLL in C++ www.computing.net/answers/programming/how-to-use-a-dll-in-c/6296.html

A little help in an array in C++! www.computing.net/answers/programming/a-little-help-in-an-array-in-c/11838.html