Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Bitmaps & DLL's

Hello all,

I'm creating an app that inserts and removes bitmaps (not icons) to/from DLL's/EXE's. The insertion is finished, with some help, using the WinAPI function UpdateResource.
Now, to delete a bitmap from within the DLL, the API help tells me to pass NULL as the data parameter to the UpdateResource function, but all I get is an Access Violation.
Can anybody help me?

Thanks in advance,
Knifebright

Comments

  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : Hello all,
    :
    : I'm creating an app that inserts and removes bitmaps (not icons) to/from DLL's/EXE's. The insertion is finished, with some help, using the WinAPI function UpdateResource.
    : Now, to delete a bitmap from within the DLL, the API help tells me to pass NULL as the data parameter to the UpdateResource function, but all I get is an Access Violation.
    : Can anybody help me?
    :
    : Thanks in advance,
    : Knifebright
    :

    ...hmmm... I have looked up this 'UpdateResource()' thingy, but I cannot find that it will work for DLL files - everywhere in this help topic only executable files mentioned - no DLLs. Maybe it does not work with DLLs?

    Also, notice that it will NOT work in Win9x/Me.

    Now, where the access violation happening? If inside 'UpdateResource()' then I think it is just a flaw in Win32 API - it not supposed to crash, but return a code with 'GetLastError()'. There is nothing we can do about it...

    If the access violation happened later - when you close the updating resources, then check all return codes from 'UpdateResource()' and if there are errors then call 'GetLastError()' and look up the error code in MSDN.

    Good luck with it...



Sign In or Register to comment.