DLL File location

  • Thread starter Thread starter JOHN O.
  • Start date Start date
J

JOHN O.

I am trying to write a Dll in EVC++ to use it in my
CF.NET application. Where (Directory or File) do I save
the Dll at so I can call it from my application.
Thanks!
 
If you place it in the \Windows folder it will be directly accessible for
any application without specifying the full path e.g. in your .NETCF code
(C#)
[DllImport("yourdll.dll")]
public static extern void DoSomething();

Similarly if you place it in the same folder as your application you can
call it directly from that application in the same way - but not from other
applications without specifying the full path.
Therefore if your dll is to be used in multiple applications place it in the
\Windows folder, otherwise place it in your application folder - which you
can do by adding the appropriate cpu version of the dll to your .NETCF
project (marking the Build Action property in the IDE as Content) - see here
for a walkthrough http://www.inthehand.com/forums/viewtopic.php?t=129

Peter
 
The answer can also include any folders listed in the registry at
[HKLM]/Loader/SystemPath key (it's a multi-sz key where each entry
represents a folder name where the loader will search for executable files
which were not specified with full paths).

Paul T.

Peter Foot said:
If you place it in the \Windows folder it will be directly accessible for
any application without specifying the full path e.g. in your .NETCF code
(C#)
[DllImport("yourdll.dll")]
public static extern void DoSomething();

Similarly if you place it in the same folder as your application you can
call it directly from that application in the same way - but not from other
applications without specifying the full path.
Therefore if your dll is to be used in multiple applications place it in the
\Windows folder, otherwise place it in your application folder - which you
can do by adding the appropriate cpu version of the dll to your .NETCF
project (marking the Build Action property in the IDE as Content) - see here
for a walkthrough http://www.inthehand.com/forums/viewtopic.php?t=129

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org


JOHN O. said:
I am trying to write a Dll in EVC++ to use it in my
CF.NET application. Where (Directory or File) do I save
the Dll at so I can call it from my application.
Thanks!
 
Back
Top