Click here to Skip to main content
15,889,595 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to add *.hpp defined by myself to the*.cpp? Pin
Anonymous17-Nov-03 22:30
Anonymous17-Nov-03 22:30 
AnswerRe: how to add *.hpp defined by myself to the*.cpp? Pin
Anonymous17-Nov-03 23:12
Anonymous17-Nov-03 23:12 
GeneralMapAndLoad() Pin
hph17-Nov-03 22:27
hph17-Nov-03 22:27 
GeneralKill a process!! Pin
chadell17-Nov-03 22:18
chadell17-Nov-03 22:18 
GeneralRe: Kill a process!! Pin
Brian Shifrin17-Nov-03 22:48
Brian Shifrin17-Nov-03 22:48 
GeneralRe: Kill a process!! Pin
Michael Gunlock18-Nov-03 9:59
Michael Gunlock18-Nov-03 9:59 
Generalado nextrecordset failed Pin
zhangxinghai17-Nov-03 21:47
zhangxinghai17-Nov-03 21:47 
GeneralHelp drawing vertical text Pin
Juan Carlos Cobas17-Nov-03 21:33
Juan Carlos Cobas17-Nov-03 21:33 
Hi,

I have an application that draws text vertically. This application uses the MM_TWIPS mapping mode.
Everything works fine except when I try to copy the text into the clipboard as a metafile. In this case, when the metafile is pasted into MS Word 2002 (XP), the metafile is pasted correctly. However, when the metafile is pasted into MS Word 2000, or into another apps such as Photoshop, the text is rotated by an additional 180º.
For example, if the text rendered in the screen is:
S
A
M
P
L
E

It's converted into
E
L
P
M
A
S

when pasted as a metafile in Office 2000 apps or photoshop.


This does not happen if the mapping mode is MM_TEXT. However, my application is strongly based on MM_TWIPS mode.

This is some sample code:

void CTestView::OnDraw(CDC* pDC)
{
// Set mapping mode
pDC->SetMapMode( MM_TWIPS );

CFont font;
LOGFONT lf;
ZeroMemory( &lf, sizeof(LOGFONT) );
lstrcpy( lf.lfFaceName, "Arial" );
lf.lfEscapement = 900;
font.CreateFontIndirect( &lf );


CFont* pOldFont = pDC->SelectObject(&font);

pDC->TextOut(1100, -1100, "Sample Vertical Text");

pDC->SelectObject(pOldFont);

}


void CTestView::OnEditCopy()
{

CMetaFileDC * m_pMetaDC = new CMetaFileDC();
//draw meta file
CClientDC clientDC(this);
OnPrepareDC(&clientDC);


m_pMetaDC->CreateEnhanced(&clientDC,NULL,NULL,"Metafile");
m_pMetaDC->m_hAttribDC = clientDC.m_hDC;
m_pMetaDC->m_bPrinting = true;


OnDraw(m_pMetaDC);


//close meta file dc and prepare for clipboard;
HENHMETAFILE hMF = m_pMetaDC->CloseEnhanced();

//copy to clipboard
OpenClipboard();
EmptyClipboard();
::SetClipboardData(CF_ENHMETAFILE,hMF);
CloseClipboard();
//DeleteMetaFile(hMF);
delete m_pMetaDC;

}


GeneralMSMQ Pin
arthivjii17-Nov-03 20:12
arthivjii17-Nov-03 20:12 
GeneralRe: MSMQ Pin
Dudi Avramov18-Nov-03 2:57
Dudi Avramov18-Nov-03 2:57 
Generalstrange warning Pin
Jerome Conus17-Nov-03 19:35
Jerome Conus17-Nov-03 19:35 
GeneralRe: strange warning Pin
Michael Dunn17-Nov-03 19:59
sitebuilderMichael Dunn17-Nov-03 19:59 
GeneralRe: strange warning Pin
Jerome Conus17-Nov-03 20:07
Jerome Conus17-Nov-03 20:07 
GeneralRe: strange warning Pin
Prakash Nadar17-Nov-03 23:52
Prakash Nadar17-Nov-03 23:52 
GeneralColumn based selection; Pin
Bo Hunter17-Nov-03 19:29
Bo Hunter17-Nov-03 19:29 
QuestionMaximum length of string?? Pin
xxhimanshu17-Nov-03 19:28
xxhimanshu17-Nov-03 19:28 
AnswerRe: Maximum length of string?? Pin
Michael Dunn17-Nov-03 20:01
sitebuilderMichael Dunn17-Nov-03 20:01 
GeneralRe: Maximum length of string?? Pin
xxhimanshu17-Nov-03 20:05
xxhimanshu17-Nov-03 20:05 
GeneralDeveloping for Pocket PC Pin
georgiek5017-Nov-03 18:58
georgiek5017-Nov-03 18:58 
GeneralRe: Developing for Pocket PC Pin
Michael P Butler17-Nov-03 22:42
Michael P Butler17-Nov-03 22:42 
GeneralRe: Developing for Pocket PC Pin
georgiek5017-Nov-03 22:48
georgiek5017-Nov-03 22:48 
QuestionCMap Efficiency??? Pin
Uma Mahes17-Nov-03 18:04
Uma Mahes17-Nov-03 18:04 
AnswerRe: CMap Efficiency??? Pin
Brian Shifrin18-Nov-03 0:03
Brian Shifrin18-Nov-03 0:03 
Questionprinter help? Pin
murali_utr17-Nov-03 18:01
murali_utr17-Nov-03 18:01 
AnswerRe: printer help? Pin
Brian Shifrin17-Nov-03 23:43
Brian Shifrin17-Nov-03 23:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.