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!

ClassWizard usage

Status
Not open for further replies.

ebuBekir

Technical User
Sep 6, 2001
22
0
0
DE
Well, I am pretty bad in MFC, but I wanted to use the ClassWizard in my project, that I already started before. But I got the following error:

A duplicate insert block exists for class "CMyMainWindow" in the source files (..\main.h, ..\main.cpp)

The content of the main files are the class CMyMainWindow and the class CMyApplication.
Can anybody help me?
Thanx,:cool:
 
Class Wizard depnds on a particular code structure and a lot of extra control statements and it gets unhappy at the smallest changes to its code. Putting a project you've written under CW is maybe possible, but it might be simpler to regenerate the basic project with app wizard and class wizard and copy your code into it. :) Hope that this helped! :)
 
ALL class wizard information is stored in a .CLW file . Try to modify this file by hand if you see something wrong inside it. It has a very easy-to - understand format.

HTH, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Thanks for your help, I lately found my problem.
I had to delete some code that I already excluded with /* */.
Like,
//{{AFX_MSG(CMyMainWindow)
// NOTE: the ClassWizard will add member functions here

afx_msg int OnCreate(LPCREATESTRUCT lpCS);
afx_msg void OnLoadImage();
afx_msg void OnRun();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
Anyway, thank you for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top