CharSeT.Ansi does not contain defination for ansi

↘锁芯ラ 提交于 2019-12-25 06:08:58

问题


In C# i am trying to add some additional info like

[DllImport("\\SD Card\\ISAPI1.dll", CharSet = CharSet.Ansi)]

but build process giving error

Error   1   'System.Runtime.InteropServices.CharSet' does not contain a definition for 'Ansi'   

and the same error "does not contain a defination" i am receiving with

Marshal.PtrToStringAnsi(intPtr);

i am creating a c# application for WinCE 6.0


回答1:


The compact framework does not support ANSI at all. Hence those parts of the framework relating to ANSI do not exist.

You should use Unicode on the compact framework. I mean, you should use Unicode everywhere, but you get no choice on compact!



来源:https://stackoverflow.com/questions/33007610/charset-ansi-does-not-contain-defination-for-ansi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!