Results 1 to 2 of 2

Thread: ActiveX with DrawTextW + UniCode Help...

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    ActiveX with DrawTextW + UniCode Help...

    Hello,

    I'm testing out to create a UniCode aware simple label.

    Now Im using the DrawAPIW API.

    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?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    Fanatic Member DrUnicode's Avatar
    Join Date
    Mar 2008
    Location
    Natal, Brazil
    Posts
    631

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width