Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit on MFC objects in a class?

Status
Not open for further replies.

Dakwan

Programmer
Jan 9, 2007
3
CA
Heya,

I'm trying to add some more mfc objects (cedit, cbutton etc) to a dialog class but i keep getting an error at runtime that reads.

"Unhandled exception at 0x00000000 in SpiroTest.exe: 0xC0000005: Access violation reading location 0x00000000."

Initially i assumed i was mucking up a null pointer somewhere but it's definatly when i add a new object to the class. I can add a new data variable (int,double etc) but it seems specifically when i add an mfc control object to have problems. I can even remove an old one and comment out all references to it and then i am able to add a new one error free.

I've been banging my head on this for awhile and am willing to trade my left kidney for any help.
 
How are you adding them? Is it something like

CEdit* fred = new CEdit (....);

And you're finding that fred is 0. When you install VS, there is an option to get the MFC source. Step into the new and see why fred is zero. It may be something like the dialog handle is incorrect or some of the other parameters are incorrect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top