Click here to Skip to main content
15,923,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: casting problems for int Pin
valikac3-May-04 12:02
valikac3-May-04 12:02 
GeneralRe: casting problems for int Pin
David Crow4-May-04 2:06
David Crow4-May-04 2:06 
GeneralRe: casting problems for int Pin
David Crow4-May-04 2:05
David Crow4-May-04 2:05 
GeneralRe: casting problems for int Pin
roadragedave4-May-04 3:56
roadragedave4-May-04 3:56 
GeneralRe: casting problems for int Pin
David Crow4-May-04 4:55
David Crow4-May-04 4:55 
QuestionMFC->How to create different-shaped buttons in runtime? Pin
l00p1n63-May-04 9:59
l00p1n63-May-04 9:59 
GeneralNTFS Security Descriptor Help Pin
wgordon3-May-04 9:14
wgordon3-May-04 9:14 
Generalmessages Pin
pnpfriend3-May-04 8:52
pnpfriend3-May-04 8:52 
The following code was found in none of the Codeguru thread.
This code is written in c++ and console application and my application is .Net dialog based application.
Could you please help me how to convert the following code to c++.Net . ?????????????????????

<br />
#include <windows.h><br />
<br />
#define DIVISIONS 5<br />
<br />
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;<br />
<br />
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
                    PSTR szCmdLine, int iCmdShow)<br />
{<br />
     static TCHAR szAppName[] = TEXT ("Checker2") ;<br />
     HWND         hwnd ;<br />
     MSG          msg ;<br />
     WNDCLASS     wndclass ;<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 = szAppName ;<br />
     <br />
     if (!RegisterClass (&wndclass))<br />
     {<br />
          MessageBox (NULL, TEXT ("Program requires Windows NT!"), <br />
                      szAppName, MB_ICONERROR) ;<br />
          return 0 ;<br />
     }<br />
     <br />
     hwnd = CreateWindow (szAppName, TEXT ("Checker2 Mouse Hit-Test Demo"),<br />
                          WS_OVERLAPPEDWINDOW,<br />
                          CW_USEDEFAULT, CW_USEDEFAULT,<br />
                          CW_USEDEFAULT, CW_USEDEFAULT,<br />
                          NULL, NULL, hInstance, NULL) ;<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 />
     return msg.wParam ;<br />
}<br />
<br />
<br />

Generalmessages Pin
Anonymous3-May-04 8:48
Anonymous3-May-04 8:48 
GeneralRe: messages Pin
David Crow3-May-04 9:42
David Crow3-May-04 9:42 
GeneralRe: messages Pin
pnpfriend3-May-04 9:52
pnpfriend3-May-04 9:52 
Questioncan any one help me Pin
shammyrly3-May-04 6:57
shammyrly3-May-04 6:57 
AnswerRe: can any one help me Pin
David Crow3-May-04 7:31
David Crow3-May-04 7:31 
GeneralA question about Network Programming Pin
nguyenvhn3-May-04 6:46
nguyenvhn3-May-04 6:46 
GeneralRe: A question about Network Programming Pin
David Crow3-May-04 7:34
David Crow3-May-04 7:34 
GeneralConnection Points and Events Pin
Ross White3-May-04 6:44
Ross White3-May-04 6:44 
Generalplease help with EVB !! Pin
bathroom3-May-04 6:39
bathroom3-May-04 6:39 
Generalabout wav Pin
hp0123-May-04 6:31
hp0123-May-04 6:31 
GeneralRe: about wav Pin
Alexander M.,4-May-04 3:23
Alexander M.,4-May-04 3:23 
GeneralRe: about wav Pin
Paul Belikian4-May-04 11:18
Paul Belikian4-May-04 11:18 
GeneralAnimation under Visual C++ Pin
3-May-04 6:05
suss3-May-04 6:05 
QuestionHow do we find a programs memory allocation Pin
Opwar3-May-04 5:02
Opwar3-May-04 5:02 
AnswerRe: How do we find a programs memory allocation Pin
David Crow3-May-04 5:24
David Crow3-May-04 5:24 
GeneralMFC: How to get name of file opened Pin
ayca3-May-04 4:52
ayca3-May-04 4:52 
GeneralRe: MFC: How to get name of file opened Pin
Joe Woodbury3-May-04 5:01
professionalJoe Woodbury3-May-04 5:01 

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.