CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Threaded View

  1. #9
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,923

    Re: AfxRegisterWndClass() causes crash

    Quote Originally Posted by Paul McKenzie View Post
    And how exactly did this fix the issue? If you don't know, then that isn't a fix. You could have had a buffer overrun, and changing the binary executable just moved the bug somewhere else.

    Before doing voodo "fixes", I would suggest you change your code back to the way it was, duplicate the error, and actually figure out why the crash occurs so that a proper fix can be established. Otherwise, you have a program that cannot be proven that it's stable.
    I totally agree that such fixes are not the way to proceed with such problems with c/c++ code. They might temporarily mask the problem but at some stage they will come back 'to bite you hard'. The only way to deal with these problems is with some hard debugging to find the source of the problem and to then change the faulty code appropriately in the knowledge that you know what you are doing and why you are changing the code. Just 'trying a few things' and seeing what happens is not the way to fix any problem!
    Last edited by 2kaud; May 31st, 2013 at 07:09 AM.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured