Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

!Help needed!

Hi all,

I downloaded a source code which contains both .h and .cpp files. In order to use this code I have to create a new class inside classwizard and then assign the variable type to the new class.

This is what I did:
-I added .h and .cpp to my project folder.
-Went to ClassWizard, and tired to assign my static text to the variable type of the new class, but I didn't find the new class name in the drop down menu.

How do I add the new class to my classWizard.
Please explain step by step....thanks
0
BerMuDa
Asked:
BerMuDa
  • 5
  • 4
1 Solution
 
AlexFMCommented:
1) Using Class Wizard create variable of type CStatic

2) Include downloaded .h file to your dialog .h file

3) Manually replace class member type from CStatic to new class.
0
 
vadikCommented:
ClassWizard stores the information about your project's classes in a file with the file extension .clw. To accommodate source files that have changed, ClassWizard displays the Repair Class Information dialog box whenever it finds that the information in the .clw file is out of date.

The Repair Class Information dialog box has two main functions:

1) Deleting obsolete classes from the ClassWizard file


2) Updating the ClassWizard file with the new name or location of classes that you have changed or moved

You need to delete this (*.clw) file from yours project's directory.
0
 
BerMuDaAuthor Commented:
I followed what you said, everything went fine excpet for the follwoing errors:
The source file I downloaded makes me able to create a hyperlink.
http://codeguru.earthweb.com/controls/hyperlink.shtml

Project.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CHyperLink::~CHyperLink(void)" (??1CHyperLink@@UAE@XZ)
ProjectDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CHyperLink::~CHyperLink(void)" (??1CHyperLink@@UAE@XZ)
ProjectDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall CHyperLink::CHyperLink(void)" (??0CHyperLink@@QAE@XZ)
Debug/Project.exe : fatal error LNK1120: 2 unresolved externals
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
vadikCommented:
Do you see the information about the CHyperLink class in your the ClassView Tree? Sorry for my English...
0
 
BerMuDaAuthor Commented:
No I can't see it
0
 
vadikCommented:
I think that you didn't added the HyperLink.cpp file into the project.
0
 
vadikCommented:
I think that you didn't add the HyperLink.cpp file into the project.
0
 
BerMuDaAuthor Commented:
I added HyperLink.cpp to the folder of my project.'
I added #include "HyperLink.h" to my Projectdlg.h file.
0
 
vadikCommented:
Do you see HyperLink.cpp in the FileView tree? You can get this error "error LNK2001: unresolved external symbol " by some reasons:

1) You have a *.h file but you haven't *.cpp and haven't *.lib for static linking.

2) If you have a *.cpp file this doesn't matter where is his location. You need to add this file into project (not folder) direct.
0
 
BerMuDaAuthor Commented:
Thanks

I was missing *.lib for static linking.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now