|
Klaus Petersen wrote:
FlashText.obj : error LNK2001: unresolved external symbol "public: __thiscall CFlash::CFlash(void)" (??0?$CFlash@VCFlashText@@@@QAE@XZ)
FlashText.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CFlash:CFlash(void)" (??1?$CFlash@VCFlashText@@@@UAE@XZ)
tells you there are no implementations for the constructor and destructor of CFlash. If you explicitly declare them, you'll need to implement them aswell (with at least empty {}).
|
|
|
|
|
The implementation is done in the cpp file, as usual. It doesn't seem to work but I can't see there
is anything wrong with the code. My code looks like this:
header file:
#if !defined(AFX_FLASHTEXT_H__50B175B8_B909_4161_BDB7_B4960ECF9B0E__INCLUDED_)
#define AFX_FLASHTEXT_H__50B175B8_B909_4161_BDB7_B4960ECF9B0E__INCLUDED_
#include "Text.h"
#include "Flash.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CFlashText : public CText, public CFlash< CFlashText >
{
public:
CFlashText();
virtual ~CFlashText();
};
#endif // !defined(AFX_FLASHTEXT_H__50B175B8_B909_4161_BDB7_B4960ECF9B0E__INCLUDED_)
cpp file //implementation
#include "stdafx.h"
#include "FlashText.h"
CFlashText::CFlashText()
: CText(), CFlash< CFlashText >()
{
}
CFlashText::~CFlashText()
{
}
does anyone know why this code doesn't work???
The linker gives the following linker error on the code:
FlashText.obj : error LNK2001: unresolved external symbol "public: __thiscall CFlash<class cflashtext="">::CFlash<class cflashtext="">(void)" (??0?$CFlash@VCFlashText@@@@QAE@XZ)
FlashText.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CFlash<class cflashtext="">::~CFlash<class cflashtext="">(void)" (??1?$CFlash@VCFlashText@@@@UAE@XZ)
|
|
|
|
|
hmmm....I don't know if there is anything wrong with what you are trying to do. My only thought would be that the CFlash<cflashtext> is relying on the constructor of CFlash and for some reason, it is not accpeting that. FYI, this is how we do it.
template <class type="">
class foo_template
{
};
class foo
{
};
class foo2 : public foo_template<foo>
{
};
|
|
|
|
|
It's not CFlashText that is the problem, it's CFlash that is missing its constructor and destructor, just as the linker messages states. You will need CFlash::CFlash() {} and CFlash:: ~CFlash() {} somewhere.
|
|
|
|
|
Hi,
I only want to know who have a VC++ version of the software
named CDex ? or some same experience? I have some problems for compiling it with VC6.0 at windows2000.
Thanks in advance!
chen
|
|
|
|
|
Hi,
I've to impement idle time out to my dialog application. can anyone give me an idea abt how to go on abt it. I don't want to go on and handle every event.
thanks in advance
|
|
|
|
|
Press on CTRL+W, then search for the message WM_IDLE, double click it then click edit code.
The parameter lCount of the callback BOOL OnIdle( LONG lCount ); is how manny times the function has been called.
U can do all ur work based on that
Papa
Murex Co.
|
|
|
|
|
thanks for the tip. so stupid of me not to look at the messages of the appplication class. have been searching through the messages of the Propertysheet Class all the while. thanks a lot.
|
|
|
|
|
Glad could be a help!
Papa
Murex co.
|
|
|
|
|
I did post a few weeks ago about a LNK2005 error with VC7 (no error on VC6 with same code)
and did not get any satisfying anwer. Now I am able to tell you more on the subject, which
seems to be a mixed template / dll export problem.
Let's say I have a MFC project with one EXE (crystal.exe) and one DLL (dutils.dll).
In the DLL, I have one class derived from CString (over simplified for the demonstration) :
////////////////////////////////////////////////////
// DCString.h
#ifdef DUTILS_IMPL
#define CLASS_DUTILS __declspec(dllexport)
#else
#define CLASS_DUTILS __declspec(dllimport)
#endif
class CLASS_DUTILS DCString : public CString
{
public:
DCString();
CString ToUpper();
};
/////////////////////////////////////////////////////
(NB : CString in a MFC7 project is now template-derived and defined as :
CStringT<TCHAR, StrTraitMFC<TCHAR, ChTraitsCRT<TCHAR>>>)
Now somewhere in my application EXE (here in DCAcquisitionHolder.cpp), if I include this file :
#include "DCString.h"
--> I get this error (multiple times , roughly once / DCString function) :
DUtilsd.lib(DUtilsd.dll) : error LNK2005:
"public: __thiscall ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >::
CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >
(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > const &)"
(??0?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@QAE@ABV01@@Z)
already defined in DCAcquisitionHolder.obj
--> if I declare my DCString class like this :
///////////////////////////
class DCString public CString // no __declspec(dllexport) or __declspec(dllimport)
{
(...)
}
///////////////////////////
Of course I have an error like this (class is not exported) :
DCAnalysis.obj : error LNK2019: unresolved external symbol
"public: class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >
__thiscall DCString::ToUpper(void)" (... etc...)
Do you have any idea how I could combine a correct export of the class with no double definition ?
Many many thanks for your help.
|
|
|
|
|
Hi,
In my application, I want to load an old version vc++ project file in workspace, but i cannot load it---- "workspace 0".
Did you know where can i get proper settings of VC++6.0 for successfully load an old project file with *.dsp, *.dsw and some *.cpp *.h files.
Thanks in advance!
|
|
|
|
|
In fact, I want to use TerminateProcess() to terminate a running program from another program. But I don't know how to get the HANDLE which must be provided as the parameters. Who call tell me how to do this or provide me some other solution. Thanks in advance.
Kidd
|
|
|
|
|
What about reading:
http://www.codeproject.com/threads/asyncprocnotify.asp
A better way i guess!
Papa
Murex Co.
|
|
|
|
|
Yes, it is a better way. But the process handle has to be got by calling CreateProcess() or ShellExecuteEx(). If I begin a process A from windows and then begin a process B from windows instead of using the above functions to spawn process B from process A. How can I get the process B handle from process A to stop process B. Should windows keeps all the process handles have launched? Thanks
Kidd
|
|
|
|
|
Hi all
i'm writing a visual c++ isapi and trying to stress it with concurrency execution
my question is why if i insert for example a line with Sleep(5000) in isapi code
the number of concurrency users is always <= 10 ? Actually if i try with 11 or more requests
to IIS i have too many users error (403.9).
I know (probably dont know..) that IIS has a potential of about 500 contemporary requests before
this kind of error. I tried with win2000 professional and server edition.
thanx in advance for any help
|
|
|
|
|
By using escapecomm function we can set DTR but it the goes off after the insruction execute. Is there any other method to set it permanantly on and checking DSR other than using loop.
|
|
|
|
|
U can, u have to set the DCB. In order to stop looping u have to wait for event notification, then go check the serial by getmodemstatus
A usefull class:
http://www.codeproject.com/system/cserialport.asp
Papa
Murex Co.
|
|
|
|
|
Also you have to open your serial port in overlapped mode.
|
|
|
|
|
Hi!
I need to know the structure of the library (.lib), and to understand when and how it is created. Can somebody point me to the right direction. The "LIB Reference" of MSDN is too less than enough.
Thanks in advance.
Regards,
Gennady
|
|
|
|
|
*.lib files are library files that may contain functions and or classes. A static lib is one which can be linked with an executable such that the exe is appended with the entire library. For dynamic libs, the lib files only contain the definitions and some meta information. When the exe is run, the exe will load the required dll that corresponds to the lib file and call the functions.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Hi, Nish!
I know what it is the .lib in common. This "some meta" is exactly of my interest. For example: how the call to the DLL exported functions implemented in the export lib? Is ordinal used here, may I manage this and how?
Sure there is a lot of info concerning this issue. I don't want to annoy the community with online questionnaire, so I've asked for references.
Thank you anyway.
Regarads,
Gennady
|
|
|
|
|
Try searching MSDN for DumpCOFFLibFile . It's inside an article written by Matt Pietrek and should at least give you a starting point.
|
|
|
|
|
please answer me at this wenpage if you know,
i need to use that programming in windows 98 now,
past, i try but cannot compile windows 2000 code in this
O/S.
|
|
|
|
|
Win2K API calls that were not present in 98 WILL NOT work on Win 98! Don't even attempt it. If you want to create an app that runs on 98/NT/2K etc. use only those calls that are valid on a Windows 98 machine!
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
You must elimate the errors.;)
Don´t call these functions under win98 -> change the code: if( !bwin98 )
Another way it to load the dll dynamic and if it doesen´t you can´t do that.
|
|
|
|