I am having a problem compiling a class I downloaded from CodeProject. The class compiles until I try to create a variable of that type, and then I get a linker for each function that I try to call with that variable (to begin with, just the constructor and destructor.) Here are the compiling errors that I am receiving:
error LNK2019: unresolved external symbol "public: __thiscall CMultiColumnComboBox::CMultiColumnComboBox(void)" (??0CMultiColumnComboBox@@QAE@XZ) referenced in function "public: __thiscall NewInvoice::NewInvoice(void)" (??0NewInvoice@@QAE@XZ)
error LNK2001: unresolved external symbol "public: virtual __thiscall CMultiColumnComboBox::~CMultiColumnComboBox(void)" (??1CMultiColumnComboBox@@UAE@XZ)
The class is the CMultiColumnComboBox class from http://www.codeproject.com/combobox/mccombobox.asp#xx169761xx[^] The directions say to include the file in the .cpp file, but then I cannot declare variables in my .h file, so I had to include the class in my .h file. Now I'm getting these linker errors. Can somebody please give me some suggestions? Thanks a bunch!!
DougW48 wrote: The directions say to include the file in the .cpp file, but then I cannot declare variables in my .h file...
Probably because the two .h files are in the wrong order. The #include <MultiColumnComboBox.h> statement should precede the inclusion of your dialog's .h file. Or, if your dialog declaration is going to be used in places other than by its definition, you'll need the #include <MultiColumnComboBox.h> statement in the dialog's .h file instead, before any reference to the CMultiColumnComboBox class.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
When I included the files, the visual studios put them in a separate virtual folder called "Solution Items" I moved them into the same area of my solution explorer as my other files, and it compiled without a hitch. Now if I could just figure out how to update the class to work in 2000/XP I'll be all set, but that's for a different post! Thanks a bunch for your help!
How would you go about attaching 'winnm.dll' to a project? I am just unable to get my head around linking the dll files then accessing them. Do i need to create a header file?
What will i then need to include in the header file? I need to create a simple keyboard which uses low level design to produce sound through the sound card.
Everytime i create or open a project, an error occur:
fatal error RC1015: cannot open include file 'afxres.h'.
I searched and found the problem in Microsoft site:
but i could not read the file coz i dont have the OS installer
to support the language.
I already reinstall Visual Studio but the same things happen.
I tried to search the article Q156916, it has been referred to Article - 156916.
The article talks about J++. I tried renaming the .rc to .rct or .res but when i load the
project and go on the resource tab, the same error appear.
I've compiled it, but same things happen.
Im having a dual boot so I've tried re-installing
on the other OS and it works. I think its cause is
software conflict. I did know that my friend
installed Visual Studio on the other OS.
I'm facing a very strange problem with the code snippet below.
I'm creating a base class (JSBase) which provides two virtual methods. These two methods have the same name.
In a derived class, I reimplement only one of these two methods.
In the main(), I instanciate the derived class and call one of the method of the base class (the one which has not be reimplemented in the derived class).
When I compile, I get this error :
.\TestDerive.cpp(64) : error C2664: 'import' : cannot convert parameter 1 from '
class ClassTest1' to 'class ClassTest2'
No constructor could take the source type, or constructor overload resol
ution was ambiguous
What's wrong ? Can't I reimplement only one of the method in the derived class ?
I would appreciate a lot your help !
Sure, I'm calling the 'import()' method with a parameter of type ClassTest1. The base class has such a method. Why is this method not accessible from the derived class ? This is what is strange for me !
You have discovered a slight 'flaw' in C++. This isn't a VS6 thing. When overloading virtual functions in base classes, the member function in the derived class 'hides' the overloaded base class function. You will need to explicitly call the baseclass function:
to do what you want done. As a general rule, don't overload virtual functions, for the reason you found out.
I have a question here. Let's say i have a program running as service, which is shown in the taskbar. If i dubbelclick the item in the taskbar, i get the screen of my application. If i quit the program, the item in the taskbar is gone (I handled message 'OnDestroy' of my application & deleted the item in taskbar).
If i stop the service in the service section of Computer Management. The item in the taskbar isn't deleted. Isn't message 'WM_DESTROY' send to my application .. i don't think so actually .. but which message is it, so i can delete the icon in the taskbar myself when needed. Same goes for Reboot service !
Last Visit: 31-Dec-99 18:00 Last Update: 22-Sep-23 14:06