DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 12:54:17 GMT,    posted on: microsoft.public.dotnet.languages.vc        back       

Thread Index
  1    Tom Van Hauwaert


Font selection in COleControl::OnDraw   
I designed a font "WAG Symbols" that contains symbols in the private use area of unicode.
Now I want to develop an insertable object that can handle these characters so they become visible in, let's say MS Word.

In Word, when the control is active, the unicdoe characters are displayed as should. When the control is inactive, the private use area characters are all replaced by ?
In the ActiveX Control Test Container this behaviour occurs when selecting Control ==> Draw Metafile.

Any idea what causes this behaviour?

This is the code in the OnDraw member of my control:

void CWagRoutineXCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
    if (!pdc)
        return;

    // create and select it
    CFont newFont;
    newFont.CreateFont( 
        -20, // point size
        0, 0, 0,
        FW_NORMAL, // weight, also FW_BOLD
        0, // if 1 = italic
        0, // if 1 = underline
        0, // if 1 = strike through
        0, 0, 0, 0, 0,
        _T("WAG Symbols") ); // typeface
    CFont* pOldFont = pdc->SelectObject(&newFont);

    CString cs;
    cs.Format( _T("Unicode: %c%c%c"), 0xEA53, 0xEA5E, 0xEAA4 );
    pdc->TextOut( 0, 0, cs );

    pdc->SelectObject( pOldFont );
}
Date:Tue, 14 Aug 2007 12:54:17 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us