string vs. w/char*

Kagamin spam at here.lot
Fri Mar 4 00:31:58 PST 2011


Kagamin Wrote:

> Tyro[a.c.edwards] Wrote:
> 
> > class TopWinClass: WinClass
> > {
> > 	this(ushort resId, HINSTANCE hInst, WNDPROC wndProc)
> > 	{
> > 		super(resId, hInst, wndProc);
> > 		SetResIcons(resId);
> > 		wc.lpszMenuName = MAKEINTRESOURCEA(resId);  // [PROBLEM]
> > 	}
> > }
> > 
> > Every access to wc.lpszMenuName after this point fails.
> 
> Who accesses it?
> 
> MAKEINTRESOURCEA just casts int to char* so it's an invalid pointer while still valid resource indentifier, windows can differentiate them by zeroed high word.

casts ushort to char*


More information about the Digitalmars-d-learn mailing list