|
I created a CDblyLinkList<t> class and put into DblyLinkList.h and DblyLinkList.cpp file in a common folder of many projects.
In the header file declaring CTIFRowset, of a DLL project, I included "..\common\DblyLinkList.h", and the class has a variable m_rowlist of CTIFRowList, which is typedefed in CTIFRow header file as CDblyLinkList<ctifrow *="">.
The CDblyLinkList.h and CDblyLinkList.cpp were added to the DLL project.
When I built it, all compiles correctly, but i got many linking errors like:
Tracy error LNK2019: unresolved external symbol "public: __thiscall CDblyLinkListIterator<class ctifrow="" *="">::CDblyLinkListIterator<class ctifrow="" *="">(class CDblyLinkListIterator<class ctifrow="" *=""> &)" (??0?$CDblyLinkListIterator@PAVCTIFRow@@@@QAE@AAV0@@Z) referenced in function "public: __thiscall CTIFRowset::CTIFRowset(class CTIFRowset &)" (??0CTIFRowset@@QAE@AAV0@@Z)
|
|
|
|
|
Did you create CBlyLinkListIterator copy constructor? Or is it only declared in .h file?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
yes, i did declared the copy constructor. The error I shown was a instance of error. Actually, it has many, such as:
Tracy error LNK2019: unresolved external symbol "public: class CDblyLinkListIterator<class ctifrow="" *=""> __thiscall CDblyLinkList<class ctifrow="" *="">::end(void)" (?end@?$CDblyLinkList@PAVCTIFRow@@@@QAE?AV?$CDblyLinkListIterator@PAVCTIFRow@@@@XZ) referenced in function "public: __thiscall CTIFRowset::CTIFRowset(class CTIFConnection *)" (??0CTIFRowset@@QAE@PAVCTIFConnection@@@Z)
Tracy error LNK2019: unresolved external symbol "public: __thiscall CDblyLinkListIterator<class ctifrow="" *="">::CDblyLinkListIterator<class ctifrow="" *="">(class CDblyLinkListIterator<class ctifrow="" *=""> &)" (??0?$CDblyLinkListIterator@PAVCTIFRow@@@@QAE@AAV0@@Z) referenced in function "public: __thiscall CTIFRowset::CTIFRowset(class CTIFRowset &)" (??0CTIFRowset@@QAE@AAV0@@Z)
Tracy error LNK2019: unresolved external symbol "public: void __thiscall CDblyLinkList<class ctifrow="" *="">::erase(class CDblyLinkListIterator<class ctifrow="" *="">)" (?erase@?$CDblyLinkList@PAVCTIFRow@@@@QAEXV?$CDblyLinkListIterator@PAVCTIFRow@@@@@Z) referenced in function "public: bool __thiscall CTIFRowset::Delete(void)" (?Delete@CTIFRowset@@QAE_NXZ)
The declaration was in a .h file, and implementation was in a .cpp file.
|
|
|
|
|
I think in Template Classes you have to add an include statement to the implementation file in the header file.
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Original post mentions that both .cpp and .h are parts of project.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
No i mean in the header file you should
#include "poo.cpp",
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Now I got what do you mean. Yes, this may have been the problem
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
1) since CP forum code strips triangle brackets by default, use 'display this message as-is (no HTML) option. I'm not sure if your CDblyXXx classes are actually templates (probably they are).
2) you can't link DLL or EXE?
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Anonymous wrote:
The declaration was in a .h file, and implementation was in a .cpp file.
That's the problem. Due to a limitation of templates, template code has to be visible in all CPP files, so move the code to your header file.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Sir, I want to make new CSocket object from SOCKET type variable. This SOCKET variable is associated with open socket connection. How can I do it?? would you please help me.......
C.R.Naik
|
|
|
|
|
|
Hi all,
I have a VC module that processing DB on SQL Server and will return a result (number, string,..). Can I rewrite that module so that it can be called from an ASP page on IIS as a function ? How will I do it?
Thanks for your help
|
|
|
|
|
Depends on the complexity of the module. You could write the code again in ASP using ADO to access the database. Or you could wrap your module as an ATL COM component.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
I would like to load a bitmap file and print it.
I need also to view it in the print preview.
Can anyone send me a simple MFC sample for that?
Thanks,
Dudi
|
|
|
|
|
A lot of the code you need to do this can be found in my article PrintingTricksAndTips[^].
You will need to add the bitmap loading code from resources and convert it to a DIB in your OnBeginPrinting() and destroy it in your OnEndPrintig(). And StretchDIBBits() it in your OnPrint().
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Has anyone noticed that the selecting values with a mouse from the Windows slider control is quite awkward?
In my opinion Microsoft implemented the right click action wrong. For example, if you have a slider control with 5 values and the ticks are marked 1,2,3,4,5, if the slider is currently at tick number 1 and you click on the "4" you would expect the slider thumb directly move to 4, right? Well, what happens is that it moves to "2". This is because it interprets the click as a "page down" command. While this is appropiate for a scrollbar, it certainly is not the right action for a slider. Look at any other non Microsoft slider control(for instance the volumn control in WinAmp) - the thumb moves directly where you have clicked behave in the correct way.
|
|
|
|
|
You COULD subclass and handle WM_(H/V)SCROLL, check for mouseclick and implement the behaviour yourself.
If you do, be sure to post your code here - I am greatly interested
|
|
|
|
|
In fact I already have done this. I just copied this from the round slider project (by Daniel Frey) and removed the drawing code...
class CNiceSliderCtrl : public CSliderCtrl
{
public:
DECLARE_DYNAMIC(CNiceSliderCtrl)
CNiceSliderCtrl() : m_bDragging(false), m_bDragChanged(false) {}
protected:
//{{AFX_MSG(CRoundSliderCtrl)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool SetThumb(const CPoint& pt);
void PostMessageToParent(const int nTBCode) const;
bool m_bDragging;
bool m_bDragChanged;
};
#include "stdafx.h"
#include "NiceSlider.h"
IMPLEMENT_DYNAMIC(CNiceSliderCtrl, CSliderCtrl)
BEGIN_MESSAGE_MAP(CNiceSliderCtrl, CSliderCtrl)
//{{AFX_MSG_MAP(CNiceSliderCtrl)
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CNiceSliderCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
m_bDragging = true;
m_bDragChanged = false;
SetCapture();
SetFocus();
if (SetThumb(point))
{
m_bDragChanged = true;
PostMessageToParent(TB_THUMBTRACK);
}
}
void CNiceSliderCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
if (m_bDragging)
{
if (SetThumb(point))
{
m_bDragChanged = true;
PostMessageToParent(TB_THUMBTRACK);
}
}
else
{
CSliderCtrl::OnMouseMove(nFlags, point);
}
}
void CNiceSliderCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
if(m_bDragging)
{
m_bDragging = false;
::ReleaseCapture();
if (SetThumb(point))
{
PostMessageToParent(TB_THUMBTRACK);
m_bDragChanged = true;
}
if (m_bDragChanged)
{
PostMessageToParent(TB_THUMBPOSITION);
m_bDragChanged = false;
}
}
else
{
CSliderCtrl::OnLButtonUp(nFlags, point);
}
}
bool CNiceSliderCtrl::SetThumb(const CPoint& point)
{
const int nMin = GetRangeMin();
const int nMax = GetRangeMax()+1;
CRect rc;
GetChannelRect(rc);
double dPos;
if (GetStyle() & TBS_VERT)
{
dPos = (double)(point.y - rc.top)/(rc.bottom - rc.top);
}
else
{
dPos = (double)(point.x - rc.left)/(rc.right - rc.left);
}
double dCorrectionFactor = 0.5 *(1-dPos) - 0.5 *dPos;
int nNewPos = nMin + (nMax-nMin)*dPos + dCorrectionFactor;
const bool bChanged = (nNewPos != GetPos());
if(bChanged)
{
SetPos(nNewPos);
}
return bChanged;
}
void CNiceSliderCtrl::PostMessageToParent(const int nTBCode) const
{
CWnd* pWnd = GetParent();
if(pWnd) pWnd->PostMessage(WM_HSCROLL, (WPARAM)((GetPos() << 16) | nTBCode), (LPARAM)GetSafeHwnd());
}
|
|
|
|
|
In the Windows Date/Time Properties dialog under the Time Zone tag, there is a list control with a bunch of time zones. I'm sure you've all seen it before.
Q: Is it possible to programmatically access and enumerate that list?
Thanks,
Jon Sagara
Red Swingline Staplers
|
|
|
|
|
Hi!
The timezones are in the registry. Unfortunally under different keys depending on which Windows version you are running. On NT it's under :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones
On Windows 05/98:
On windows 2000 and windows XP I have no idea, but you could search for Time Zones in the registry ...
You can then use RegEnumKeyEx() to loop thru all subkeys.
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Of cause I let the message slip away to soon
On Win 95/98
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
|
I need to install a device driver (self-developed)
in order to allow all system user to use it.
Which is the way ?
Thanks a lot!!!
|
|
|
|
|
Hi
Does anyone know how to print from a VC++ program into a file (not to printer) without the user being required to enter the name of the file at print time
Thanks a lot
xxx
|
|
|
|
|
If you goto the code in ViewPrnt.cpp lines 131 onwards, you can get a copy of the default MFC OnFilePrint() function. Copy this and paste it into your overriden OnFilePrint() function of your view class. You can then mode the code so that it prints directly to a file and deosn't request a filename from the user.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|