Click here to Skip to main content
15,909,091 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Returning data from VC++(DLL) to VB Client Pin
Stephen Hewitt25-Jan-06 20:51
Stephen Hewitt25-Jan-06 20:51 
AnswerRe: Returning data from VC++(DLL) to VB Client Pin
Phil J Pearson25-Jan-06 23:29
Phil J Pearson25-Jan-06 23:29 
Questionchild frame fills main frame? Pin
LeeeNN25-Jan-06 13:38
LeeeNN25-Jan-06 13:38 
AnswerRe: child frame fills main frame? Pin
Owner drawn26-Jan-06 17:04
Owner drawn26-Jan-06 17:04 
QuestionMember Get/Set methods? Pin
Rob Caldecott25-Jan-06 11:55
Rob Caldecott25-Jan-06 11:55 
AnswerRe: Member Get/Set methods? Pin
Maximilien25-Jan-06 16:45
Maximilien25-Jan-06 16:45 
AnswerRe: Member Get/Set methods? Pin
Bob Stanneveld25-Jan-06 21:07
Bob Stanneveld25-Jan-06 21:07 
Questionhow to define the customer paper type Pin
yujia12025-Jan-06 8:15
yujia12025-Jan-06 8:15 
CDC dc;
CPrintDialog pdlg(FALSE,PD_NOPAGENUMS|PD_NOSELECTION,this);
BOOL bFindPrinter=pdlg.GetDefaults();
//////////////////////////////////////////////
//using the following code,I want to stop the 24-Pin Dot Matrix Printer at the 100mm length.But something is wrong ,it doesn't work.
DEVMODE* lpDevMode = NULL;
lpDevMode = (DEVMODE*)::GlobalLock(pdlg.m_pd.hDevMode);
lpDevMode->dmFields |= DM_PAPERSIZE;
lpDevMode->dmFields |= DM_PAPERLENGTH;
lpDevMode->dmFields |= DM_PAPERWIDTH;
lpDevMode->dmPaperSize = DMPAPER_USER;
lpDevMode->dmPaperLength = 100;
lpDevMode->dmPaperWidth = 100;
::GlobalUnlock(pdlg.m_pd.hDevMode);
/////////////////////////////////////////////////////

dc.Attach(pdlg.GetPrinterDC());

CFont font;
VERIFY(font.CreatePointFont(120, "System", &dc));
CFont* def_font = dc.SelectObject(&font);

int nPageHeight, nPageWidth;
nPageHeight = dc.GetDeviceCaps(VERTRES);
nPageWidth = dc.GetDeviceCaps(HORZRES);

TEXTMETRIC TextM;
dc.GetTextMetrics(&TextM);
int nCharHeight = (unsigned short)TextM.tmHeight;
int nCharWidth=(unsigned short)TextM.tmAveCharWidth;

DOCINFO di;
di.cbSize = sizeof(DOCINFO);
di.lpszDocName = "FarFly printing";
di.lpszOutput = (LPTSTR) NULL;
di.lpszDatatype = (LPTSTR) NULL;
di.fwType = 0;
dc.StartDoc(&di);
dc.StartPage();

int line = 0;
CString s = "My Test String";
dc.TextOut(2,line++,s,strlen(s));
dc.EndPage();
dc.EndDoc();

dc.SelectObject(def_font);font.DeleteObject();

DeleteDC(dc.Detach());

thanks for your help...
AnswerRe: how to define the customer paper type Pin
Phil J Pearson25-Jan-06 23:32
Phil J Pearson25-Jan-06 23:32 
QuestionRe: how to define the customer paper type Pin
yujia12026-Jan-06 5:38
yujia12026-Jan-06 5:38 
QuestionHow to obtain the current directory pidl of a windows explorer window? Pin
z530025-Jan-06 6:21
z530025-Jan-06 6:21 
QuestionRe: How to obtain the current directory pidl of a windows explorer window? Pin
David Crow25-Jan-06 6:27
David Crow25-Jan-06 6:27 
AnswerRe: How to obtain the current directory pidl of a windows explorer window? Pin
z530025-Jan-06 14:20
z530025-Jan-06 14:20 
QuestionSerial number of USB Flash drive Pin
mrothermund25-Jan-06 6:16
mrothermund25-Jan-06 6:16 
AnswerRe: Serial number of USB Flash drive Pin
Phil J Pearson25-Jan-06 6:40
Phil J Pearson25-Jan-06 6:40 
AnswerRe: Serial number of USB Flash drive Pin
Taka Muraoka25-Jan-06 6:56
Taka Muraoka25-Jan-06 6:56 
GeneralRe: Serial number of USB Flash drive Pin
mrothermund25-Jan-06 7:46
mrothermund25-Jan-06 7:46 
AnswerRe: Serial number of USB Flash drive Pin
kakan25-Jan-06 20:13
professionalkakan25-Jan-06 20:13 
QuestionException (Access violation reading location) Pin
llp00na25-Jan-06 5:50
llp00na25-Jan-06 5:50 
AnswerRe: Exception (Access violation reading location) Pin
Blake Miller25-Jan-06 6:58
Blake Miller25-Jan-06 6:58 
GeneralRe: Exception (Access violation reading location) Pin
llp00na25-Jan-06 7:32
llp00na25-Jan-06 7:32 
AnswerRe: Exception (Access violation reading location) Pin
Michael Dunn25-Jan-06 10:26
sitebuilderMichael Dunn25-Jan-06 10:26 
AnswerRe: Exception (Access violation reading location) Pin
Stephen Hewitt25-Jan-06 21:09
Stephen Hewitt25-Jan-06 21:09 
Questiononmousemove Pin
misugi25-Jan-06 5:41
misugi25-Jan-06 5:41 
AnswerRe: onmousemove Pin
Phil J Pearson25-Jan-06 6:11
Phil J Pearson25-Jan-06 6:11 

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.