3 Mar 2008

DesktopCompatible CF3.5

Avec le CF2.0, les UserControl sont supportés mais il est possible que l'erreur suivante s'affiche lorsque vous les afficher dans le designer "Visual Inheritance is Currently Disabled". Cette erreur apparait typiquement lorsque les contrôles font appel à des fonctionnalités bas niveau du device (P/Invokes) comme l’assembly WindowsCE par exemple. Pour contourner ce problème, il suffit de rajouter un fichier XMTA avec l'attribut DesktopCompatible(true) pour le UserControl.
With the CF2.0, the UserControl are supported, but it is possible you have the following error "Visual Inheritance is Currently Disabled" after adding your new custom control to a form. You might typically get this when the control uses P/Invokes or device level functionality not supported on the desktop like the WindowsCE assembly for example. To get around this problem, you have to add an XMTA file with the DesktopCompatible(true) for the UserControl.



Avec Visual Studio 2008, si vous faites cela avec une application CF 3.5, vous obtiendrez le message d’erreur suivant lors de l’ajout de votre UserControl à la Form :
With Visual Studio 2008, if you have a CF 3.5, you will obtain the following error message after adding your new custom control to a form:





Pour contourner ce problème, il suffit d’ajouter l’assembly Microsoft.WindowsCE.Forms.dll du Compact Framework 3.5 au GAC :
gacutil /i C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\Microsoft.WindowsCE.Forms.dll

To get arround this problem, you need to add the assembly Microsoft.WindowsCE.Forms.dll Compact Framework 3.5 to the GAC :
gacutil /i C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\Microsoft.WindowsCE.Forms.dll



19 Feb 2008

Managed CoreConnectivity Framework in VS2008

Objectif
Créer un lien entre le périphérique et Visual Studio 2008
Connect the device to Visual Studio 2008

Description
  • Basé sur le core connectivity framework natif existant.
  • Build on top of existing core connectivity framework.
  • Utilisé en interne par les outils MS (tels que Unit Testing, remote…)
  • Internally used by MS tools (e.g., unit testing)
  • Facilité accrue pour créer rapidement ses propres remote tools
  • Makes it easy to build your own remote tools

Pour l’utiliser :
To use:
Ajouter une référence à Microsoft.Smartdevice.Connectivity.dll
Add a reference to Microsoft.Smartdevice.Connectivity.dll

Exemple de code :
Code example:

DatastoreManager dsmgrObj = new DatastoreManager(1033);
//Get Collection of platforms entries present in Data store
IEnumerable platformcollection = dsmgrObj.GetPlatforms();
//Iterate through Collection of platforms
foreach (Platform objplatform in platformcollection)
{
System.Console.WriteLine(objplatform.Name);
if (objplatform.Name.Contains("Windows Mobile 6 Professional SDK"))
{
IEnumerable pdeviceCollection = objplatform.GetDevices();
foreach (Device objdevice in pdeviceCollection)
{
System.Console.WriteLine("\t" + objdevice.Name);
//Check if the device is an emulator
if (objdevice.Name.Contains("Windows Mobile 6 Professional Emulator"))
{
m_objDevice = objdevice;
m_objDevice.Connect();
return;
}
}
}


// To get all running processes on the device
m_objDevice.GetRunningProcesses()

// Get the system info
SystemInfo info = m_objDevice.GetSystemInfo();

N'hésitez pas à tester et créer vos propres Remote Tools, c'est super pratique.
Don't hesitate to test it and create your own Remote Tools, it is very usefull.

18 Feb 2008

Compact Framework version redirection

Avec le Compact Framework 2.0, si vous voulez forcer votre application à utiliser une version particulière du Compact Framework, vous pouvez créer un fichier nommé [Nom de mon application].exe.config et de le copier dans le répertoire de l'application. (Article de CodePPC)

In Compact Framework 2.0, if you want to perform runtime version redirection, you can create a file called [Name of the application].exe.config and place it in the application folder.

Une des nouveautés du Compact Framework 3.5 est de pouvoir créer un seul fichier device.config et de le placer dans le répertoire Windows afin d'effectuer une redirection de runtime vers le Compact Framework 3.5 pour toutes les applications du device.
In the Compact Framework 3.5, you can create an only file called device.config and place it in the Windows folder to perform runtime redirection for all applications on the device.

Pour que toutes les applications utilisent le CF 3.5, voici le fichier à créer :
For example, to redirect all applications to run using CF 3.5, here is the file to create:


13 Feb 2008

Bonjour à tous,

Durant ces derniers jours, je n'ai pas été très actif sur mon blog du fait de la préparation des TechDays 2008, je m'y remets dès la semaine prochaine. En tous cas, merci à tous ceux qui sont venus à ma session au TechDays sur Visual Studio 2008 et le Compact Framework 3.5. Et si vous avez des remarques ou des questions à poser, n'hésitez pas à poster des commentaires sur ce post. La session webcastée et les slides seront disponibles sur le site des TechDays d'ici 2 à 3 semaines.
Une petite vidéo de la plènière en attendant :


Video: Extraits de la plénière du mardi 12 février 2008
Hi all,

During these last days, I wasn't very active on my blog because of preparation of TechDays 2008, I'll go back next week. In any case, thank you to all which came to my session in TechDays on Visual Studio 2008 and Compact Framework 3.5. And if you have any remarks or questions to ask, don't hesitate to post comments on this post. The webcasted session and the slides will be available on the TechDays' website in 2 to 3 weeks. (It will be in French only ;-))