étapes pour créer la DLL en C++ pour Windows Mobile:
1) Fichier> Nouveau> Projet ...> Visual C++> Smart Device> Win32 intelligent périphérique projet
2) Ecrire un nom le projet et cliquez sur OK.
3) Suivant> Insérer besoin SDKs (comme WM5 et WM6)> Suivant> Cliquez sur DLL> Terminer
4) Faites un clic droit sur le dossier source et sélectionnez Ajouter> Nouveau
5) Trouvez def nom de fichier le même que le nom de la DLL et cliquez sur OK.
Maintenant en def Vous devez écrire quelque chose comme ceci:
LIBRARY "dllName"
EXPORTS
exactFunctionName1 DATA
exactFunctionName2 DATA
In dllName.cpp You need to add those two methods (exactFunctionName1, exactFunctionName2) and write code for them.
You don't need to state more then a method names in def (plus <tab><tab>DATA next to name).
Where to place the DLL after builiding to make use of it in my C# project
It must be placed next to Your app or in Windows folder of Your device.
To get methods from that library just do the following in C#:
using System.Runtime.InteropServices;
[DllImport("dllName.dll")]
private static extern anyReturnType exactFunctionName1(anyArgumentType argumentName);
So as an example let's get arithmethic sum form myMath.dll:
[DllImport("myMath.dll")]
private static extern int sum(int first, int second);
Those methods can be also public but they still require "static extern".
Following example in C++ side You'll have this:
In myMath.cpp:
INT sum(INT first, INT second)
{
return first + second;
}
In myMath.def:
LIBRARY "myMath"
EXPORTS
sum DATA
Source:
http://social.msdn.microsoft.com/Forums/en-US/windowsmobiledev/thread/98e60ab6-aecf-4399-a5be-4937ec40aac9
Le bureau n'a pas besoin de FC installé à consommer un ensemble de FC. Les assemblées des FC sont reciblables et exécutées dans le cadre complet. – ctacke
Merci ctacke. – EKS