How to show message from file?

Win32 Programming

    Next

  • 1. GDI+ and Fill Effects
    Hi All, Anyone know if it is possible display all fill effects of PowerPoint (Styles: Horizontal, Vertical, Diagonal up/down, From corner/center) using GDI+ ? Any sample? In my program I need display objects (rectangles, etc.) using the same fill effects. Best Regads, Luis F. (Indusoft Team)
  • 2. SetTextAlign not working
    I just upgraded from Windows XP Pro to Vista Ultimate. I have been using code like: SelectObject( hPrndc, UniverseFont ); SetTextAlign( hPrndc, TA_CENTER ); TabbedTextOut( hPrndc, leftmarg, line, buf, lstrlen(buf), tabpos, tabs, 0 ); Now under Vista, the settextalign doesn't seem to work, nor does TA_LEFT or TA_RIGHT. Has something changed in between XP and Vista? Tom
  • 3. Win32 Halftone Functions
    Hi, I notice that print drivers, through the DDK, have access to some pretty neat halftone functions, with various halftone patters like these... HT_PATSIZE_2x2 HT_PATSIZE_2x2_M HT_PATSIZE_4x4 HT_PATSIZE_4x4_M HT_PATSIZE_6x6 HT_PATSIZE_6x6_M HT_PATSIZE_8x8 HT_PATSIZE_8x8_M HT_PATSIZE_10x10 HT_PATSIZE_10x10_M HT_PATSIZE_12x12 HT_PATSIZE_12x12_M HT_PATSIZE_14x14 HT_PATSIZE_14x14_M HT_PATSIZE_16x16 HT_PATSIZE_16x16_M HT_PATSIZE_SUPERCELL HT_PATSIZE_SUPERCELL_M HT_PATSIZE_AUTO Is it possible to access these same halftone patterns throguh the regular Win32 API or SDK? I am not writing a driver, but I am trying to add halftone capabilities to an old legacy C Win32 application, and I thought there might be a way to leverage these pre existing microsoft halftone functions in the app. Is it possible to get these same patterns through BitBlt, or StretchBlt, etc? Thanks in advance, Skeet

How to show message from file?

Postby FlyR » Sat, 09 Feb 2008 21:17:43 GMT

I read data from file. But ch type is char.
So ch cant use in TextOut. How to solve it?
Please help me. Thanx.

John Wild



  case WM_PAINT:

   hdc=BeginPaint(hwnd,&ps);
   GetClientRect(hwnd,&rect);

   Col=Row=0;

   //Read file
   infile.open("rdata.txt",ios::in);

   if(!infile)
   {
    cout<<"Error!\n";
    return 0;
   }

   while((ch=infile.get())!=EOF)
   {

    while(ch!='\n')
    {
    //cant pass compiler.
    TextOut(hdc,cxChar*Col,cyChar*Row,TEXT(ch),1);

     Col++;
    }
    Row++;
   }

   EndPaint(hwnd,&ps);

   return 0;




Re: How to show message from file?

Postby Scott Seligman » Sun, 10 Feb 2008 00:56:40 GMT



Use MultiByteToWideChar.

-- 
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
   The beginning is the most important part of the work. 
   -- The Republic by Plato

Re: How to show message from file?

Postby Mark Salsbery [MVP] » Sun, 10 Feb 2008 03:31:41 GMT

Also, you may get better results posting to a more appropriate newsgroup 
(like microsoft.public.vc.language) since your question has nothing to do 
with GDI :)

Mark

-- 
Mark Salsbery
Microsoft MVP - Visual C++









Return to Win32 Programming

 

Who is online

Users browsing this forum: No registered users and 33 guest