Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2003

Tip: Looking for answers? Try searching our database.

using routines from my dll

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vadym Stetsyak - 04 Aug 2003 10:19 GMT
Hi there!!!

I've got the following routine in my dll
_declspec(dllexport) int InitializeGlobal();

and I want to use it in my C# project.

In C# I write
[DllImport("c:\\MyDll.dll", EntryPoint
= "InitializeGlobal", CallingConvention =
CallingConvention.Cdecl)]
public static extern int InitializeGlobal();

I've watched with dumpbin, the dll is exporting this func.

So why I cannot call it, I receive DLLNotFound exception...
However the paths are ok
Vadym Stetsyak - 04 Aug 2003 11:15 GMT
the problem was solved...

Another question - if I use a routine from the dll then it
is loaded to my process and unloads only when application
is closed or when the routine return control?

>-----Original Message-----
>Hi there!!!
[quoted text clipped - 16 lines]
>
>.
Mattias Sj?gren - 04 Aug 2003 12:26 GMT
>Another question - if I use a routine from the dll then it
>is loaded to my process and unloads only when application
>is closed or when the routine return control?

When the app is closed, unless you explicitly call the FreeLibrary
Win32 API.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.