I try import windows API CharToOem function

Quentin J. quentin.joseph at outlook.com
Mon Aug 26 10:42:48 PDT 2013


Hello, (sorry for my english, i'm french ^^)

I try to implement CharToOem function in my code for use accent 
in windows console but she doesn't work, i have one error from 
xamarin studio : "bool.main.CharToOem(const char*, char*) could 
not be resolved - librairy reference missing" :'(.

CharToOem Function :

BOOL WINAPI CharToOem(
   _In_   LPCTSTR lpszSrc,
   _Out_  LPSTR lpszDst
);

LPCTSTR = const char* or const wchar_t* depending on _UNICODE.
LPSTR = char*

My code is :

import std.c.windows.windows;
extern (Windows) bool CharToOem(const char*, char*);

public void PutStringIntoConsole(string text)
{
	char[] source = text.dup;
	char[] dest;

	CharToOem(source.ptr, dest.ptr);
	writeln(dest);
}

Can you help me please, i'm novice in D.


More information about the Digitalmars-d mailing list