ActiveX with DrawTextW + UniCode Help...
Hello,
I'm testing out to create a UniCode aware simple label.
Now Im using the DrawAPIW API.
Quote:
Call SetRect(R, 1, 1, UserControl.ScaleWidth / Screen.TwipsPerPixelX - 1, UserControl.ScaleHeight / Screen.TwipsPerPixelY + 1)
Call DrawTextW(UserControl.hDC, StrPtr(m_Caption), Len(m_Caption), R, tempAlight)
Ok it all works when I use the Forms .HDC to draw UniCode chars, but the problem is when i implement this in to an AcitveX and use the Usercontrol.Hdc.
Then i dont get the Unicode characters...
Any reasons for this?
Re: ActiveX with DrawTextW + UniCode Help...
1. Check your UserControl.Font. Try "Tahoma" in lieu of MS Sans Serif.
2. Make sure your Unicode string is OK. Try "CHS: " & ChrW$(&H6B22) & ChrW$(&H8FCE)
3. In DrawTextW you can set the Len to -1 and it will calculate automatically.
4. Make sure R is in Pixels.
4. Set UserControl.AutoRedraw=True unless you are using UserControl_Paint.