none
Class Wizard C/C++ MFC 64 bit "Object reference not set the instance of the object"

    Question

  • I am porting my 32 bit RPC client/server to 64 bit.   I've been successfully in compiling the 64 bit RPC server within a new project folder and source code,  all separate from my stable 32 bit production.  When I try to bring the class wizard for the server's dialog boxes,  I get the following popup error:

    "Object reference not set the instance of the object"

    Once you click ok, the Class Wizard comes up with no entries in the fields.  I tried switching to the 32 bit configuration, same thing.    No problem going back to the original production 32 bit only project files.    Searching online points to Dot Net related issues. This is a C/C++ MFC project.


    Was there some VS2015 project MFC, Class Wizard related file missing when my the project was checked out from the version control system?  I remember in the old VS days, the *.CLW file was used for the class wizard.   Or is there some other issue going on with the 64 bit configuration?    I also in the old days, I was able to regenerate the class wizard "database."   Is there a way to do this under VS2015?

    Thanks in advance.



    Hector Santos, CTO Santronics Software, Inc. http://www.santronics.com

    Saturday, March 16, 2019 2:51 PM

Answers

  • Here is what I did.

    1) I removed/hide the wcserver64.sln which was a new solution where i added the projects that needed to be ported to 64 bit.  

    2) I began to isolate it by loading individual small C/C++ library/DLL/MFC projects from their own project folders and was able to load the Class Wizard.  

    2) I remove the wcserver.sln solution file with contained multiple project folders so I can load just the wcserver.vcxproj project by itself.  Even if you told the IDE to just load the wcserver.vcxproj project, it seems to always want to look for a solution file and load it instead -- even if you rename it!!  Odd.  But loading just the wcserver.vcxproj project worked to show the Class Wizard.  Note: Unless it as still working in flushing a *.db file to disk,  there was NO wcserver.vc.db file generated.  I don't see it in the folder.

    3) Now I restored the original 32 bit wcserver.sln from cvs which has no x64 configuration and loaded it.  It now showed the Class Wizard and there is a wcserver.vc.db file.  

    4) I went into the configuration and created a x64 configuration.   The class wizard also showed up now.

    5) I got rid of the wcserver.sln and restored the wcserver64.sln and the popup error occurs.

    So something is different with the wcserver64.sln.  It has less projects links than the original wcserver.sln.  That's all I can see.  


    Oh well,  chalk it up as another confusing IDE weirdness.  I'll just continue my 64bit work with the working wcserver.sln which was going to be used anyway.

    Thanks



    Hector Santos, CTO Santronics Software, Inc. http://www.santronics.com





    • Edited by hector santos Saturday, March 16, 2019 4:54 PM
    • Proposed as answer by RLWA32 Saturday, March 16, 2019 5:06 PM
    • Marked as answer by hector santos Saturday, March 16, 2019 5:11 PM
    Saturday, March 16, 2019 4:49 PM

All replies

  • Have you tried closing the solution/project and then deleting the related .db file so it is recreated when re-opening?
    Saturday, March 16, 2019 3:34 PM
  • No, but let me try that ......   

    Ok,  with VS2015 IDE closed,  I deleted the *.db file (wcserver64.vc.db), I opened the wcserver64.sln (solution), right click on one of the loaded projects to start class Wizard and it showed the status box parsing and recreating the *.db file.   Then it come up with the same error box again.

    It happens with the Win32 configuration as well.   

    This is in a new project folder that was extracted from the version control system (CVS).  I doubled check if there was anything missing.   The *.DB, *.USER and *.FILTER files are not part of the CVS, so they were recreated.  But i never went into the class wizard while I was working the 64 bit configuration changes and any _WIN64 code changes for the recompilation.  That part was all successful and now I was going into the About and Status MFC boxes to update some its static fields and was planning to add a new static field to show the 32/64 bit state/version of the server when the popup occurred.

    Not sure what to look for now but compare projects and/or try to isolate it to small project.


    Hector Santos, CTO Santronics Software, Inc. http://www.santronics.com


    Saturday, March 16, 2019 4:04 PM
  • Here is what I did.

    1) I removed/hide the wcserver64.sln which was a new solution where i added the projects that needed to be ported to 64 bit.  

    2) I began to isolate it by loading individual small C/C++ library/DLL/MFC projects from their own project folders and was able to load the Class Wizard.  

    2) I remove the wcserver.sln solution file with contained multiple project folders so I can load just the wcserver.vcxproj project by itself.  Even if you told the IDE to just load the wcserver.vcxproj project, it seems to always want to look for a solution file and load it instead -- even if you rename it!!  Odd.  But loading just the wcserver.vcxproj project worked to show the Class Wizard.  Note: Unless it as still working in flushing a *.db file to disk,  there was NO wcserver.vc.db file generated.  I don't see it in the folder.

    3) Now I restored the original 32 bit wcserver.sln from cvs which has no x64 configuration and loaded it.  It now showed the Class Wizard and there is a wcserver.vc.db file.  

    4) I went into the configuration and created a x64 configuration.   The class wizard also showed up now.

    5) I got rid of the wcserver.sln and restored the wcserver64.sln and the popup error occurs.

    So something is different with the wcserver64.sln.  It has less projects links than the original wcserver.sln.  That's all I can see.  


    Oh well,  chalk it up as another confusing IDE weirdness.  I'll just continue my 64bit work with the working wcserver.sln which was going to be used anyway.

    Thanks



    Hector Santos, CTO Santronics Software, Inc. http://www.santronics.com





    • Edited by hector santos Saturday, March 16, 2019 4:54 PM
    • Proposed as answer by RLWA32 Saturday, March 16, 2019 5:06 PM
    • Marked as answer by hector santos Saturday, March 16, 2019 5:11 PM
    Saturday, March 16, 2019 4:49 PM
  • Glad you got it solved.
    Saturday, March 16, 2019 5:00 PM