25 Nov 2007

C# programming directly on device

Pour ceux qui veulent développer du code quand ils ne sont pas au bureau et le tester, ou bien encore qui ne peuvent pas s'empêcher de développer du code pour leur device ;-).
For whose who want to develop code while away from your desktop and be able to test it, or then those which can’t be prevented from developing code for their device ; -).

Jetez un oeil là-dessus !
Check out this !

Merci Peter pour le lien.
Thanks to Peter for the link.

22 Nov 2007

VS 2008 and CF 3.5

VS2008 et le Compact Framework 3.5 sont disponibles via MSDN Premium Subscription.
VS2008 and the Compact Framework 3.5 are available via MSDN Premium Subscription.

Jetez un oeil sur ce lien.
Check this link.

21 Nov 2007

Debug C++ from a C# application

Si vous avez un projet C# qui appelle un DLL d'un projet en C++ voici la méthode pour debugger la DLL en C++ tout en lançant le projet principal en C#.

If you have a C# project which calls a DLL from a C++ project, here the way for debugging the C++ DLL while launching the principal project in C++.





1) Mettre des points d'arrêt dans le C++.
1)Put some breakpoints in C++ code.


2) Dans les propriétés de la DLL en C++, dans l'onglet debugging, changer le path de Remote Directory avec le chemin de l'exécutable en C#.

2) In the C++ DLL properties, in the debugging tab, change the Remote Directory path with the C# executable.








3) Lancer le projet via un clic droit sur le projet C++ et en cliquant Debug/Start new instance

3) Launch the project via a right click on the C++ project and then click on Debug/Start new instance.



Ensuite, si vous avez positionné des points d'arrêt dans le C++, le debugger s'arrêtera donc sur ces points d'arrêt.

Then, if you have set breakpoints in the C++ code, the debugger will stop on these breakpoints.

14 Nov 2007

Transparent background !


Le Compact Framework supporte la gestion de la transparence pour seulement une couleur. Mais, c’est déjà bien pratique et suffisant pour rendre transparent un fond noir rectangulaire par exemple.
The Compact Framework supports transparency color but for only one color. But it is already quite practical and sufficient to make transparent a black rectangular background for example.

Voici un petit exemple de code


Here is a small piece of code

1) Créer l’Image Attribute
1) Create the Image attribute
System.Drawing.Imaging.ImageAttributes attrib = new System.Drawing.Imaging.ImageAttributes();

2) Definissez la couleur de transparence (noir pour notre exemple)
2) Set the transparency color key (black for the example)
attrib.SetColorKey(Color.Black, Color.Black);

3) Dessinez l’image en utilisant l’image attribute
3) Draw the image using the image attribute
e.Graphics.DrawImage(backgroundIm, destRect, 0, 0, backgroundIm.Width, backgroundIm.Height, GraphicsUnit.Pixel, attrib);

Et voici le résulat avec un fond vert clair!
And here is the result with a light green background!


J'espère que cet exemple vous sera utile dans vos dev...
I hope this example will help you to your dev, see you later...

13 Nov 2007

Debug : StopWatch class (CF 3.5)

Voici un petit exemple d'utilisation de la classe StopWatch pour le deboggage de vos applications.
Here is a small example for using the StopWatch class for debugging your app.

// Déclarer un objet StopWatch :
// Declare a StopWatch object :
private Stopwatch stopWatch;

// Démarrer le timer
// Start the timer
stopWatch.Start();

// Vérifier si le timer est activé
// Check if the timer is activated
if (stopWatch.IsRunning) {}

// Arrêter le timer
// Stop the timer
stopWatch.Stop();

// Réinitialiser le timer
// Reset the timer
stopWatch.Reset();

// Récupérer le temps écoulé en tant que valeur de type TimeSpan
// Get the elapsed time as a TimeSpan value
TimeSpan ts = stopWatch.Elapsed;