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



No comments: