Thread: UpdateResource

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    39

    UpdateResource

    Hello

    I'm with a problem


    I'm wrinting a code on DevC++ that must delete some specific resource.


    Code:
    if(wParam==btn)
    {
    
    char res[1024];
    HANDLE Begin;
    BOOL Up,End;
    Begin=BeginUpdateResource("test1.exe",FALSE);
    if(!Begin)
    {
    MessageBox(hwnd,"Error","Error",MB_OK);
    }
    
    
    Up=UpdateResource(Begin,MAKEINTRESOURCE(5),MAKEINTRESOURCE(1000),MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),NULL,0);
    if(!Up)
    {
    sprintf(res,"Error on Up \n %d",GetLastError());
    MessageBox(hwnd,res,"Error",MB_OK);
    }
    
    
    End=EndUpdateResource(Begin,FALSE);
    if(!End)
    {
    MessageBox(hwnd,"Error","Error",MB_OK);
    }
    
    
    
    }



    Well the problem is that the program doesn't work.
    GetLastError returns the value 87 "Parameter incorrect"


    Where my parameter is incorrect?
    Thanks

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Perhaps there is no dialog with a resource ID of 1000.

    gg

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    39
    No ...

    This isn't the problem, there is a dialog with ID=1000


    =/

    Anyone else?

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    The only other thing it could be then is the language - which probably must match the language of the dialog you're trying to delete.

    gg

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    39
    OMG


    Thanks man

    If you were a woman i would gave you a kiss =)

    That was a so simple thing that make me crazy =p

    Thanks again
    Bye

Popular pages Recent additions subscribe to a feed