Click here to Skip to main content
16,005,236 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat message should my app handle when user shutdown/logoff the system Pin
24-Feb-02 18:51
suss24-Feb-02 18:51 
AnswerRe: What message should my app handle when user shutdown/logoff the system Pin
Paul M Watt24-Feb-02 18:58
mentorPaul M Watt24-Feb-02 18:58 
GeneralRe: What message should my app handle when user shutdown/logoff the system Pin
24-Feb-02 19:04
suss24-Feb-02 19:04 
GeneralRe: What message should my app handle when user shutdown/logoff the system Pin
Paul M Watt24-Feb-02 19:17
mentorPaul M Watt24-Feb-02 19:17 
GeneralRe: Thanx Pin
24-Feb-02 21:10
suss24-Feb-02 21:10 
GeneralNetwork logins Pin
Coremn24-Feb-02 17:09
Coremn24-Feb-02 17:09 
GeneralRe: Network logins Pin
Jon Hulatt24-Feb-02 22:08
Jon Hulatt24-Feb-02 22:08 
GeneralSTL/for_each/templated function question Pin
Christian Graus24-Feb-02 17:06
protectorChristian Graus24-Feb-02 17:06 
I am trying to create an example using for_each to delete objects where they are stored in a container as pointers. I have this:

class pType
{
public:
	pType::pType()
	{
		cout << "Constructor\n";
	}

	pType::~pType()
	{
		cout << "Destructor\n";
	}

};

template <class T> void ptrErase(T * type)
{
	delete type;
};

in main()

	vector <pType *> vecpType;

	for (i = 0;i < 20; ++i)
	{
		pType * pInt = new pType;
		vecpType.push_back(pInt);
	}

	for_each(vecpType.begin(), vecpType.end(), ptrErase<pType>);


I get a linker error,

STL.obj : error LNK2001: unresolved external symbol "void __cdecl ptrErase(class pType *)" (?ptrErase@@YAXPAVpType@@@Z)
Debug/STL.exe : fatal error LNK1120: 1 unresolved externals

I am not as familiar with templated functions as I would like, could someone tell me what I am doing wrong pls ?


Christian

The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
GeneralRe: STL/for_each/templated function question Pin
Paul M Watt24-Feb-02 17:17
mentorPaul M Watt24-Feb-02 17:17 
GeneralRe: STL/for_each/templated function question Pin
Christian Graus24-Feb-02 17:25
protectorChristian Graus24-Feb-02 17:25 
GeneralRe: STL/for_each/templated function question Pin
Paul M Watt24-Feb-02 17:37
mentorPaul M Watt24-Feb-02 17:37 
GeneralRe: STL/for_each/templated function question Pin
Joaquín M López Muñoz24-Feb-02 20:03
Joaquín M López Muñoz24-Feb-02 20:03 
QuestionSTL from MS oder SGI? Pin
Travis D. Mathison24-Feb-02 15:46
Travis D. Mathison24-Feb-02 15:46 
AnswerRe: STL from MS oder SGI? Pin
Paul M Watt24-Feb-02 15:55
mentorPaul M Watt24-Feb-02 15:55 
GeneralRe: STL from MS oder SGI? Pin
Travis D. Mathison24-Feb-02 16:06
Travis D. Mathison24-Feb-02 16:06 
AnswerRe: STL from MS oder SGI? Pin
Christian Graus24-Feb-02 15:54
protectorChristian Graus24-Feb-02 15:54 
GeneralRe: STL from MS oder SGI? Pin
Travis D. Mathison24-Feb-02 16:06
Travis D. Mathison24-Feb-02 16:06 
QuestionCFileDialog and printing different views? Pin
Craig Miller24-Feb-02 13:06
Craig Miller24-Feb-02 13:06 
AnswerRe: CFileDialog and printing different views? Pin
Roger Allen25-Feb-02 3:16
Roger Allen25-Feb-02 3:16 
GeneralRe: CFileDialog and printing different views? Pin
Craig Miller25-Feb-02 12:03
Craig Miller25-Feb-02 12:03 
GeneralOpenGL with MDI application Pin
Rajveer24-Feb-02 10:58
Rajveer24-Feb-02 10:58 
GeneralRe: OpenGL with MDI application Pin
Derek Waters24-Feb-02 11:46
Derek Waters24-Feb-02 11:46 
QuestionSubclassing...?? Pin
alex.barylski24-Feb-02 9:35
alex.barylski24-Feb-02 9:35 
AnswerRe: Subclassing...?? Pin
Steen Krogsgaard24-Feb-02 10:14
Steen Krogsgaard24-Feb-02 10:14 
GeneralRe: Subclassing...?? Pin
alex.barylski24-Feb-02 14:49
alex.barylski24-Feb-02 14:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.