Click here to Skip to main content
16,005,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Generalmessages Pin
Anonymous3-May-04 8:48
Anonymous3-May-04 8:48 
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 . ?????????????????????

[code]
#include <windows.h>

#define DIVISIONS 5

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("Checker2") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;

wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;

if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("Program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}

hwnd = CreateWindow (szAppName, TEXT ("Checker2 Mouse Hit-Test Demo"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;

ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;

while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}


[/code]
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 
GeneralRe: MFC: How to get name of file opened Pin
ayca3-May-04 5:52
ayca3-May-04 5:52 

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.