winforms - DLLImport path C# -
i import dll inside c# class instead of this:
[dllimport(@"c:\users\user\documents\visual studio 2010\projects\keydll\debug\dllwrap.dll", callingconvention = callingconvention.cdecl, entrypoint = "?divset@mycall@myfunc@@sapadpad@z")]
i locate path within project so:
[dllimport(@"...\debug\dllwrap.dll", callingconvention = callingconvention.cdecl, entrypoint = "?divset@mycall@myfunc@@sapadpad@z")]
so looks in local folder solution in.
any suggestions??
regards
you can use relative urls like:
[dllimport("dllwrap.dll", callingconvention = callingconvention.cdecl, entrypoint = "?divset@mycall@myfunc@@sapadpad@z")]
your application search working directory (your local folder) file default.
in winforms, can ensure uses working directory by
[dllimport(application.startuppath + "\\dllwrap.dll", callingconvention = callingconvention.cdecl, entrypoint = "?divset@mycall@myfunc@@sapadpad@z")]
Comments
Post a Comment