Thread: calling unmanaged c++ dll from c#

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    17

    calling unmanaged c++ dll from c#

    I'm trying to call an unmanaged c++ dll from a c# windows form application, but I'm getting a DLLNotFoundException. The dll is in my project folder, and my code calling it is:

    Code:
    [DllImport("id3libBuilder.dll")]
    	private static extern void createMediaLibrary ( string src );
    I don't know why it can't find the dll. The code seems pretty straightforward. Can anyone help?
    Last edited by finkus; 12-14-2005 at 01:29 PM.

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    82
    I often encounter problems like this when I call a C++ DLL from Visual Basic. When this hppens, i just use the absolute path of the said dll.

    c:\project\finkus\sucks\myballs\andlikesit\verymuc h.dll

    or something like that

    It should work fine for C# too.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DLL Calling Question
    By mercury529 in forum Windows Programming
    Replies: 11
    Last Post: 01-09-2007, 06:15 PM
  2. Calling a DLL
    By jamez05 in forum C++ Programming
    Replies: 1
    Last Post: 01-05-2006, 11:13 AM
  3. Troubles Calling a DLL
    By jamez05 in forum C++ Programming
    Replies: 2
    Last Post: 12-02-2005, 12:00 PM
  4. Calling a VB DLL w/ forms from C++ DLL
    By UW_COOP in forum C++ Programming
    Replies: 8
    Last Post: 06-30-2003, 08:04 AM
  5. Function Calling From A DLL In a DLL
    By (TNT) in forum Windows Programming
    Replies: 1
    Last Post: 06-03-2002, 08:27 AM