CharSeT.Ansi does not contain defination for ansi

2019-09-05 06:43发布

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条回答
做个烂人
2楼-- · 2019-09-05 07:26

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!

查看更多
登录 后发表回答