Does the WInMain function is mandatory ?

Vinod K Chandran kcvinu82 at gmail.com
Sun Sep 30 13:20:42 UTC 2018


On Sunday, 30 September 2018 at 13:17:33 UTC, Vinod K Chandran 
wrote:
> On Sunday, 30 September 2018 at 12:48:17 UTC, Adam D. Ruppe 
> wrote:
>
>>
>> so usage is:
>>
>> toUTFz!(wchar*)(your_string_here);
>>
>>
>> If passing string literals to Windows, you can put a w at the 
>> end, like:
>>
>> MessageBoxW(null, "Hello"w, "World"w, 0); // note the ""w
>
> Thanks for the reply. But it says "toUTFz" is not defined. do i 
> missing any import statement ?

I am trying to make this function, but compiler is rejecting all 
my attempts.
```D
int MsgBox(string MsgTxt,  string titleTxt = "MessageBox") {
     const wchar* Mesg = toUTFz! (wchar*)(MsgTxt) ;
     const wchar* Tit = toUTFz! (wchar*)(itleTxt) ;
     MessageBoxW(null, Mesg, Tit, 0) ;
	return 0 ;
}
```



More information about the Digitalmars-d-learn mailing list