Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
C

Crystal

@Crystal
About
Posts
4
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • error C2660: 'new' : function does not take 3 parameters
    C Crystal

    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); }

    C / C++ / MFC graphics help

  • How to hide main dialog
    C Crystal

    I have a dialog-based application. I would like to hide the main dialog and display an icon only in the system tray. I've tried to use ShowWindow(SW_HIDE), but the dialog still appears. In "ApplicationName.cpp" file and in "InitInstance" module, my codes look like the following: CFwuTestDlg dlg; //1 //the main dialog m_pMainWnd = &dlg; //2 m_pMainWnd->ShowWindow(SW_HIDE);//3 m_pMainWnd->UpdateWindow();//4 int nResponse = dlg.DoModal();//5 return FALSE;//6 I've tried to delete line 5, but Windows complains that .exe file generate error. Could anyone help me? Thank you.

    C / C++ / MFC help c++ tutorial question

  • install an icon in the Windows task bar
    C Crystal

    I have a dialog-based application. I would like to have an icon displayed in the task bar, on the right edge near the clock, when user boots up the windows operating system. So when user moves mouse over the icon, some explanatory words will be displayed; or when user left-click the icon, the program will be executed. Is this possible? If it is, how? Please help. Sample codes would be most appreciated. Thank you.

    C / C++ / MFC help question

  • Q. Can I convert a CString value into a hex value? Urgent!!!
    C Crystal

    My application asks user to enter a hex value. First of all, can I read and store it in a variable directly as hex value? If not, I should declare a CString to read and store it, right? Then, how can I covert this CString value into hex value. An example will be most appreciated. Please help. Thank you.

    C / C++ / MFC question help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups