• Advertisement

Archived

This topic is now archived and is closed to further replies.

Why cant I create controls after I have used destroyWindow??..

This topic is 5899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why?? Heres some code where the create part doesnt work.. And dont wore about the if`s I have things that make the value correct to run create.
  if (EfterSG == 1)
{

DestroyWindow(hKnappNEW);
DestroyWindow(hKnappRESUME);
DestroyWindow(hKnappEXIT);
DestroyWindow(hTextMAINMENU);


if (Skapar_saker == 1)
{
hKnappWest = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "West",
            WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP,
            150, 250, 50, 50, hwnd, (HMENU)ID_WEST_BUTTON, ´    GetModuleHandle(NULL), NULL);
        if(hKnappWest == NULL)
            MessageBox(hwnd, "Could not create push button.", "Error", MB_OK | MB_ICONERROR);
Skapar_saker = 2;
}
}]  
Mullvad Edited by - Mullvad on February 25, 2002 1:27:59 PM Edited by - Mullvad on February 25, 2002 1:29:35 PM

Share this post


Link to post
Share on other sites
Advertisement
It is a button that is created directly at the window and the controls I using destroy window on is also button thats directly created at the window

Share this post


Link to post
Share on other sites
I dont know what you talk about I just trying to create a button after a have deleted some when using DestroyWindow but it doesnt work to create a new but the old one dissapers. Why doesnt the new West button come up??

Mullvad

Share this post


Link to post
Share on other sites
I''ll have to create a new project and play around because I don''t see errors. (Hopefully somebody will help out here before that since I wont have time to even try till Friday)

What is the formatted message returned if you use GetLastError() and FormatMessage() when the button fails to be created?

Invader X
Invader''s Realm

Share this post


Link to post
Share on other sites
It is one more thing I want to ad and that is when I am using DestroyWindow to delet my main window then I get a error message and the program I am using(borland c++ 5.01) destroys and I have to restart the program and begin from the last saved.

Mullvad

Share this post


Link to post
Share on other sites

  • Advertisement