Suppose you have these two projects in the same Visual Studio solution:
SmartDeviceProject1
: the Pocket PC device application inC#
.NativeDLL
: the Win32 SmartDevice DLL inC++
.
Now you can follow the following steps:
- Select the Pocket PC Emulator for both project, in the Visual Studio Device Option.
- Deploy the projects; now in
\\Program Files
of your Emulator you can see the two new directories:SmartDeviceProject1
andNativeDLL
(Start -> Programs -> File Explorer -> Program Files).
Your NativeDLL.dll is in the NativeDLL
directory, so use the following DllImport:
[DllImport(@"..\NativeDLL\NativeDLL.dll", EntryPoint = "Write")] public static extern bool Write(char[] FileName);
And now you can run your application using the emulator.
MSDN additional Information: Using the Emulator in Smart Device Projects.