CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: dllimport

  1. #1
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    dllimport

    Hi

    I use C# wrapper classes from a SDK in my C# application

    This wrapper is using dllimport to load DLLs

    When i run my app , it complains , these Dlls cannot be found

    I dont know how to set the path where the dllimport will look for the dlls
    I did set the PATH variable from RightCLick->MyComputer , but no change

    in Visual Studio 2003.NET for C#.NET applicatiion

    or should i manually copy these Dlls in System32 folder

    Regards

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: dllimport

    For problems like this you should ALWAYS post the exact error message (copy&paste), as well as the code (using code-tags of course).

    If you are refrencing aaa.dll, which in turn references bbb.dll you may get error messages related to aaa.dll when in fact the problem is that bbb.dll can not be found [that is twhy there is Depends.exe]

    Also copying to system32 should NOT be done for "normal" non-shared items. As a first atempt I would try copying them locally.

    Also run from within the IDE debugger, and pay CAREFUL attention to the Output window.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Nov 2000
    Location
    Germany
    Posts
    645

    Re: dllimport

    or to put simly

    DllImport("MyDLL.Dll", ....... );

    does not find MyDll.dll

    but if put

    DllImport("C:\\MyDLLS\\MyDLL.Dll", ....... );
    i.e hard code the path , alls well

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured