Click here to Skip to main content
15,896,726 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to load a component from the CLSID? Pin
Stephen Hewitt5-Jun-06 18:06
Stephen Hewitt5-Jun-06 18:06 
GeneralRe: How to load a component from the CLSID? Pin
Tcpip20055-Jun-06 18:36
Tcpip20055-Jun-06 18:36 
GeneralRe: How to load a component from the CLSID? [modified] Pin
Stephen Hewitt5-Jun-06 18:40
Stephen Hewitt5-Jun-06 18:40 
GeneralRe: How to load a component from the CLSID? [modified] Pin
Tcpip20055-Jun-06 18:56
Tcpip20055-Jun-06 18:56 
GeneralRe: How to load a component from the CLSID? [modified] Pin
Stephen Hewitt5-Jun-06 22:08
Stephen Hewitt5-Jun-06 22:08 
GeneralRe: How to load a component from the CLSID? [modified] Pin
Tcpip20057-Jun-06 16:36
Tcpip20057-Jun-06 16:36 
QuestionSaving data Pin
DanYELL5-Jun-06 17:37
DanYELL5-Jun-06 17:37 
QuestionHow to use OnDeviceChange under windows98? Pin
Syouki_kou5-Jun-06 17:03
Syouki_kou5-Jun-06 17:03 
AnswerRe: How to use OnDeviceChange under windows98? Pin
Syouki_kou5-Jun-06 21:50
Syouki_kou5-Jun-06 21:50 
GeneralRe: How to use OnDeviceChange under windows98? Pin
Syouki_kou6-Jun-06 17:55
Syouki_kou6-Jun-06 17:55 
Questionhow to get icon from other applications Pin
wanglei19805-Jun-06 15:28
wanglei19805-Jun-06 15:28 
AnswerRe: how to get icon from other applications Pin
Ryan Binns5-Jun-06 18:23
Ryan Binns5-Jun-06 18:23 
AnswerRe: how to get icon from other applications Pin
ThatsAlok5-Jun-06 23:22
ThatsAlok5-Jun-06 23:22 
QuestionMFC Excel charts with VC++ Pin
BuckBrown5-Jun-06 11:00
BuckBrown5-Jun-06 11:00 
AnswerRe: MFC Excel charts with VC++ Pin
BuckBrown6-Jun-06 12:02
BuckBrown6-Jun-06 12:02 
Questioncode for display multiple waveform in multiple channels of the same time base [modified] Pin
mrby1235-Jun-06 10:50
mrby1235-Jun-06 10:50 
QuestionMsn Messenger Pin
YaronNir5-Jun-06 10:39
YaronNir5-Jun-06 10:39 
AnswerRe: Msn Messenger Pin
ThatsAlok5-Jun-06 23:18
ThatsAlok5-Jun-06 23:18 
QuestionVS 2005 and GDI+ Pin
Van Court5-Jun-06 9:57
Van Court5-Jun-06 9:57 
AnswerRe: VS 2005 and GDI+ Pin
uusheikh5-Jun-06 17:59
uusheikh5-Jun-06 17:59 
There are a lot of examples of GDI+ in MSDN Visual Studio 2005. Try looking there.
Here's an example i took,

#define UNICODE<br />
#include <windows.h><br />
#include <gdiplus.h><br />
using namespace Gdiplus;<br />
<br />
VOID OnPaint(HDC hdc)<br />
{<br />
   Graphics graphics(hdc);<br />
   Pen      pen(Color(255, 0, 0, 255));<br />
   graphics.DrawLine(&pen, 0, 0, 200, 100);<br />
}<br />
<br />
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);<br />
<br />
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)<br />
{<br />
   HWND                hWnd;<br />
   MSG                 msg;<br />
   WNDCLASS            wndClass;<br />
   GdiplusStartupInput gdiplusStartupInput;<br />
   ULONG_PTR           gdiplusToken;<br />
   <br />
   // Initialize GDI+.<br />
   GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);<br />
   <br />
   wndClass.style          = CS_HREDRAW | CS_VREDRAW;<br />
   wndClass.lpfnWndProc    = WndProc;<br />
   wndClass.cbClsExtra     = 0;<br />
   wndClass.cbWndExtra     = 0;<br />
   wndClass.hInstance      = hInstance;<br />
   wndClass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);<br />
   wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);<br />
   wndClass.hbrBackground  = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
   wndClass.lpszMenuName   = NULL;<br />
   wndClass.lpszClassName  = TEXT("GettingStarted");<br />
   <br />
   RegisterClass(&wndClass);<br />
   <br />
   hWnd = CreateWindow(<br />
      TEXT("GettingStarted"),   // window class name<br />
      TEXT("Getting Started"),  // window caption<br />
      WS_OVERLAPPEDWINDOW,      // window style<br />
      CW_USEDEFAULT,            // initial x position<br />
      CW_USEDEFAULT,            // initial y position<br />
      CW_USEDEFAULT,            // initial x size<br />
      CW_USEDEFAULT,            // initial y size<br />
      NULL,                     // parent window handle<br />
      NULL,                     // window menu handle<br />
      hInstance,                // program instance handle<br />
      NULL);                    // creation parameters<br />
	  <br />
   ShowWindow(hWnd, iCmdShow);<br />
   UpdateWindow(hWnd);<br />
   <br />
   while(GetMessage(&msg, NULL, 0, 0))<br />
   {<br />
      TranslateMessage(&msg);<br />
      DispatchMessage(&msg);<br />
   }<br />
   <br />
   GdiplusShutdown(gdiplusToken);<br />
   return msg.wParam;<br />
}  // WinMain<br />
<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, <br />
   WPARAM wParam, LPARAM lParam)<br />
{<br />
   HDC          hdc;<br />
   PAINTSTRUCT  ps;<br />
   <br />
   switch(message)<br />
   {<br />
   case WM_PAINT:<br />
      hdc = BeginPaint(hWnd, &ps);<br />
      OnPaint(hdc);<br />
      EndPaint(hWnd, &ps);<br />
      return 0;<br />
   case WM_DESTROY:<br />
      PostQuitMessage(0);<br />
      return 0;<br />
   default:<br />
      return DefWindowProc(hWnd, message, wParam, lParam);<br />
   }<br />
} // WndProc

GeneralRe: VS 2005 and GDI+ Pin
Van Court6-Jun-06 10:32
Van Court6-Jun-06 10:32 
QuestionInterview Questions ... Please Answer! [modified] Pin
AryaSoft5-Jun-06 9:49
AryaSoft5-Jun-06 9:49 
AnswerRe: Interview Questions ... Please Answer! Pin
Chris Losinger5-Jun-06 10:14
professionalChris Losinger5-Jun-06 10:14 
GeneralRe: Interview Questions ... Please Answer! [modified] Pin
AryaSoft5-Jun-06 10:37
AryaSoft5-Jun-06 10:37 
GeneralRe: Interview Questions ... Please Answer! [modified] Pin
Zac Howland5-Jun-06 10:45
Zac Howland5-Jun-06 10:45 

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.