- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This stuff is new for me, so please forgive dumb questions ...
In a test program I am trying to learn about creating child windows, based upon a C example I found in the VS2005 documentation ("Using windows/Creating, Enumerating, and Sizing Child windows")
My code is:
case (WM_CREATE)do i = 0,2
ret = CreateWindowEx(0, &
"ChildWClass"C, &
""C, &
IOR(WS_CHILD,WS_BORDER), &
0,0,0,0, &
ghWndMain, &
(ID_FIRSTCHILD + i), &
ghInstance, &
null)
write(errcode,'(I6)')GetLastError()
end do
It doesn't work, of course, and returns a code of 1406 "Cannot create a top level child window". What am I doing wrong?
With many thanks in advance
Mike
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IsWindow(ghwndMain)?I betcha not. I have a hunch that you have elsewhere:
ghwndMain = CreateWindowEx(...)ghwndMain is assigned a value after CreateWindowEx returns, but WM_CREATE is sent during CreateWindowEx. Instead, of ghwndMain, you need to use hWnd (the argument of WndProc)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page