Click here to Skip to main content
16,009,728 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: String Manipulation Problem Pin
Jonathan Craig31-May-02 9:45
Jonathan Craig31-May-02 9:45 
GeneralRe: String Manipulation Problem Pin
Navin31-May-02 10:16
Navin31-May-02 10:16 
GeneralRe: String Manipulation Problem Pin
Sidney31-May-02 11:37
Sidney31-May-02 11:37 
GeneralRe: String Manipulation Problem Pin
Christian Graus31-May-02 13:09
protectorChristian Graus31-May-02 13:09 
General"right way" to display hex number in edit Pin
BlackDogEngineering31-May-02 8:34
BlackDogEngineering31-May-02 8:34 
GeneralRe: "right way" to display hex number in edit Pin
Ravi Bhavnani31-May-02 8:59
professionalRavi Bhavnani31-May-02 8:59 
GeneralRe: "right way" to display hex number in edit Pin
Michael Dunn31-May-02 11:46
sitebuilderMichael Dunn31-May-02 11:46 
Generalerror C2660: 'new' : function does not take 3 parameters Pin
Crystal31-May-02 8:37
Crystal31-May-02 8:37 
Can anybody tell me why I am getting this error for the following line:
graphics = new Graphics(hdcPrint);

For your information, this is my function:

// this function is for OTCDialog: OK button
// It uses GDI to send image to a printer
void OTRDialog::OnPrintFrom()
{
DWORD size;
HDC hdcPrint;

DOCINFO docInfo;
ZeroMemory(&docInfo, sizeof(DOCINFO));
docInfo.cbSize = sizeof(DOCINFO);
docInfo.lpszDocName = "GdiplusPrint";


// Create a PRINTDLG structure, and initialize the appropriate fields.
PRINTDLG printDlg;
ZeroMemory(&printDlg, sizeof(PRINTDLG));
printDlg.lStructSize = sizeof(PRINTDLG);
printDlg.Flags = PD_RETURNDC;

// Display a print dialog box.
if(!PrintDlg(&printDlg))
{
printf("Failure\n");
}
else
{
// Now that PrintDlg has returned, a device context handle
// for the chosen printer is in printDlg->hDC.

StartDoc(hdcPrint, &docInfo);
Graphics* graphics;

StartPage(hdcPrint);
graphics = new Graphics(hdcPrint);

Image image(L"My_report.bmp");
graphics.DrawImage(&image, 5, 0, 360, 410);

// Create a string.
WCHAR string[256];
wcscpy(string, L"Sample Text");

// Initialize arguments.
Font myFont(L"Arial", 6);
PointF origin(20.0f, 5.0f);
SolidBrush blackBrush(Color(255, 0, 0, 0));
// Draw string.
graphics.DrawString(string, wcslen(string), &myFont, origin, &blackBrush);
delete graphics;
EndPage(hdcPrint);

EndDoc(hdcPrint);

DeleteDC(hdcPrint);
}


if(printDlg.hDevMode)
GlobalFree(printDlg.hDevMode);
if(printDlg.hDevNames)
GlobalFree(printDlg.hDevNames);
if(printDlg.hDC)
DeleteDC(printDlg.hDC);
}


GeneralRe: error C2660: 'new' : function does not take 3 parameters Pin
Ed Gadziemski31-May-02 11:15
professionalEd Gadziemski31-May-02 11:15 
GeneralRe: error C2660: 'new' : function does not take 3 parameters Pin
Christian Graus31-May-02 13:10
protectorChristian Graus31-May-02 13:10 
GeneralRe: error C2660: 'new' : function does not take 3 parameters Pin
Ed Gadziemski31-May-02 14:47
professionalEd Gadziemski31-May-02 14:47 
GeneralRe: error C2660: 'new' : function does not take 3 parameters Pin
Christian Graus31-May-02 13:13
protectorChristian Graus31-May-02 13:13 
GeneralRe: error C2660: 'new' : function does not take 3 parameters Pin
Ed Gadziemski1-Jun-02 4:07
professionalEd Gadziemski1-Jun-02 4:07 
QuestionHow can I add a splash screen to my VC++.net porject??? Pin
chaolong31-May-02 8:13
chaolong31-May-02 8:13 
Generaltimespec equivalent in C++ Pin
lucy31-May-02 8:19
lucy31-May-02 8:19 
GeneralRe: timespec equivalent in C++ Pin
Tomasz Sowinski31-May-02 8:17
Tomasz Sowinski31-May-02 8:17 
GeneralRe: timespec equivalent in C++ Pin
lucy31-May-02 8:26
lucy31-May-02 8:26 
GeneralRe: timespec equivalent in C++ Pin
Tomasz Sowinski31-May-02 8:25
Tomasz Sowinski31-May-02 8:25 
GeneralRe: timespec equivalent in C++ Pin
lucy31-May-02 8:36
lucy31-May-02 8:36 
GeneralProgramatically Opening Menus Pin
31-May-02 8:00
suss31-May-02 8:00 
GeneralRe: Programatically Opening Menus Pin
James R. Twine31-May-02 10:12
James R. Twine31-May-02 10:12 
GeneralDragging window by clicking anywere in dialog box. Pin
Richard Bernardino31-May-02 7:52
Richard Bernardino31-May-02 7:52 
GeneralRe: Dragging window by clicking anywere in dialog box. Pin
Maximilien31-May-02 11:05
Maximilien31-May-02 11:05 
GeneralRe: Dragging window by clicking anywere in dialog box. Pin
Mike Nordell1-Jun-02 0:17
Mike Nordell1-Jun-02 0:17 
Generalwin.ini Pin
act_x31-May-02 6:47
act_x31-May-02 6:47 

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.