Click here to Skip to main content
15,881,803 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Travel salesmen Problem in C or C++ Pin
Member 1124308416-Dec-14 10:37
Member 1124308416-Dec-14 10:37 
GeneralRe: Travel salesmen Problem in C or C++ Pin
jeron116-Dec-14 11:58
jeron116-Dec-14 11:58 
GeneralRe: Travel salesmen Problem in C or C++ Pin
CPallini16-Dec-14 22:15
mveCPallini16-Dec-14 22:15 
AnswerRe: Travel salesmen Problem in C or C++ Pin
ZurdoDev17-Dec-14 3:19
professionalZurdoDev17-Dec-14 3:19 
QuestionMFCShellTree: I want to see even files Pin
Salvatello15-Dec-14 4:29
Salvatello15-Dec-14 4:29 
SuggestionRe: MFCShellTree: I want to see even files Pin
David Crow15-Dec-14 4:32
David Crow15-Dec-14 4:32 
QuestionDevice Context Origin [SOLVED] Pin
Richard Andrew x6413-Dec-14 13:46
professionalRichard Andrew x6413-Dec-14 13:46 
QuestionA simple question about Static Controls Pin
tiwal10-Dec-14 20:54
tiwal10-Dec-14 20:54 
Hello,

I have been using controls in VC++ 6.0 for years without any particular problem.
This time I wanted to shift to VC++ under VS2008, using unmanaged code .
I thought the same code that creates a trivial main window, and then the simplest Static control in the main window, would work well with VS2008 too.
It doesn't seem so .
I am wondering what's wrong with the following snippet :
C++
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

if (!hWnd)
{
    return FALSE;
}


hLabelPath = CreateWindow ((LPCWSTR)"LABEL", (LPCWSTR)"Path", WS_CHILD | WS_BORDER | SS_OWNERDRAW, 10, 10, 100, 100, hWnd, 0,  hInstance, &DIS);

i = GetLastError ();
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

I can see the main window appearing with the menu and all the rest, but the Static control doesn't appear.
I get a NULL handle as a return from its CreateWindow (). The error code is 1407, appearently meaning that the control class ("Static") is unknown.
I have been seaching all the MSDN documentation without finding an useful hint.
What's even stranger , the above code works perfectly under VC++ 6.0.
Any idea ?
Thanks

modified 11-Dec-14 4:04am.

AnswerRe: A simple question about Static Controls Pin
tiwal10-Dec-14 20:56
tiwal10-Dec-14 20:56 
AnswerRe: A simple question about Static Controls Pin
«_Superman_»10-Dec-14 21:56
professional«_Superman_»10-Dec-14 21:56 
AnswerRe: A simple question about Static Controls Pin
Richard MacCutchan10-Dec-14 22:06
mveRichard MacCutchan10-Dec-14 22:06 
GeneralRe: A simple question about Static Controls Pin
tiwal10-Dec-14 23:37
tiwal10-Dec-14 23:37 
Questionhow to replace \n with alt+enter while exporting to .CSV Pin
sma123#10-Dec-14 6:17
sma123#10-Dec-14 6:17 
AnswerRe: how to replace \n with alt+enter while exporting to .CSV Pin
Jochen Arndt10-Dec-14 9:28
professionalJochen Arndt10-Dec-14 9:28 
QuestionPlease what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam9-Dec-14 22:55
Gbenbam9-Dec-14 22:55 
SuggestionRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt9-Dec-14 23:32
professionalJochen Arndt9-Dec-14 23:32 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam11-Dec-14 0:20
Gbenbam11-Dec-14 0:20 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt11-Dec-14 2:15
professionalJochen Arndt11-Dec-14 2:15 
AnswerRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Jochen Arndt9-Dec-14 23:36
professionalJochen Arndt9-Dec-14 23:36 
AnswerRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
David Crow10-Dec-14 17:28
David Crow10-Dec-14 17:28 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam11-Dec-14 1:09
Gbenbam11-Dec-14 1:09 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Freak3011-Dec-14 3:11
Freak3011-Dec-14 3:11 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Richard MacCutchan11-Dec-14 6:39
mveRichard MacCutchan11-Dec-14 6:39 
GeneralRe: Please what is wrong with this my MFC code, what am I doing wrong? Pin
Gbenbam16-Dec-14 20:22
Gbenbam16-Dec-14 20:22 
QuestionVariable in flash memory - how to write? Pin
elelont29-Dec-14 20:43
elelont29-Dec-14 20:43 

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.