Click here to Skip to main content
15,885,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to check whether a char pointer is an empty string? Pin
dipuks17-Dec-09 10:05
dipuks17-Dec-09 10:05 
AnswerRe: How to check whether a char pointer is an empty string? Pin
krmed17-Dec-09 10:36
krmed17-Dec-09 10:36 
GeneralRe: How to check whether a char pointer is an empty string? Pin
harold aptroot17-Dec-09 10:58
harold aptroot17-Dec-09 10:58 
GeneralRe: How to check whether a char pointer is an empty string? Pin
krmed17-Dec-09 11:34
krmed17-Dec-09 11:34 
GeneralRe: How to check whether a char pointer is an empty string? Pin
Tim Craig17-Dec-09 17:54
Tim Craig17-Dec-09 17:54 
AnswerRe: How to check whether a char pointer is an empty string? Pin
CPallini17-Dec-09 11:01
mveCPallini17-Dec-09 11:01 
AnswerRe: How to check whether a char pointer is an empty string? Pin
Fatbuddha 117-Dec-09 22:14
Fatbuddha 117-Dec-09 22:14 
QuestionNo Idea why the linker is giving error Pin
Larry Mills Sr17-Dec-09 9:36
Larry Mills Sr17-Dec-09 9:36 
In my PropertyPage header I have this declaration:

#include "CookItDBDoc.h"

// CSpecial2Page1 dialog

class CSpecial2Page1 : public CBCGPPropertyPage
{
     DECLARE_DYNAMIC(CSpecial2Page1)

public:
     CSpecial2Page1();
     //CWnd* pParent = NULL, int nDlg = 0, CString csDlgName = "");   // standard constructor
     virtual ~CSpecial2Page1();

     void RetFromGetSpecialMealDlg(CString csFileName);


// Attributes
public:

     CCookItDBDoc* GetDocument() const;
...
}

============> in .cpp file <========================

void CSpecial2Page1::RetFromGetSpecialMealDlg(CString csFileName)
     {
     m_csFileName = csFileName;
     FileReadCatMenuXML(m_csFileName);
     FileReadSpecialMenuXML(m_cMenuData.m_csFullFilePath);
     CSpecial2* pPS = (CSpecial2*)GetParent();
     pPS->SetSpecial(m_cSpecialData);
     pPS->SetMenuData(m_cMenuData);
     SetDlgItemText(IDC_SELDRINKS,m_cSpecialData.m_csSpecialOccassionName);
     FileReadDrinkMenuXML(m_cSpecialData.m_csDrinkFilePath);
     InsertItemsDrink();
     GetDocument()->OnNewSpecialDrink(m_vDrink, m_cSpecialData.m_csSpecialOccassionName);
     }

the error is this:

1>Linking...
1>Special2Page1.obj : error LNK2019: unresolved external symbol "public: class CCookItDBDoc * __thiscall CSpecial2Page1::GetDocument(void)const " (?GetDocument@CSpecial2Page1@@QBEPAVCCookItDBDoc@@XZ) referenced in function "public: void __thiscall CSpecial2Page1::RetFromGetSpecialMealDlg(class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > >)" (?RetFromGetSpecialMealDlg@CSpecial2Page1@@QAEXV?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z)
1>C:\Users\Larry A Mills Sr\Documents\Visual Studio 2008\Projects\CookItDB\Debug\CookItDB.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Larry A Mills Sr\Documents\Visual Studio 2008\Projects\CookItDB\CookItDB\Debug\BuildLog.htm"
1>CookItDB - 2 error(s), 0 warning(s)

I thought maybe I had mispelled something so I checked:

in Doc header:

     void OnNewSpecialDrink(CDrinkDataVec vData, CString csMealPlan);
in Doc cpp:

// CCookItDBDoc commands
void CCookItDBDoc::OnNewSpecialDrink(CDrinkDataVec vData, CString csMealPlan)
     {     
     m_vDrink = vData;
     CDrinkData cData;
     int nIndex = 0;
     int nTotal = m_vDrink.m_vDrinkData.size();
            .....
            }

the problem is with this:
GetDocument()->OnNewSpecialDrink(m_vDrink, m_cSpecialData.m_csSpecialOccassionName);
specifically this:

     CCookItDBDoc* GetDocument() const;
I do NOT understand why this is so does anyone else?

A C++ programming language novice, but striving to learn

AnswerRe: No Idea why the linker is giving error Pin
krmed17-Dec-09 10:39
krmed17-Dec-09 10:39 
GeneralRe: No Idea why the linker is giving error Pin
Larry Mills Sr18-Dec-09 4:48
Larry Mills Sr18-Dec-09 4:48 
GeneralRe: No Idea why the linker is giving error Pin
krmed18-Dec-09 5:02
krmed18-Dec-09 5:02 
GeneralRe: No Idea why the linker is giving error Pin
Larry Mills Sr18-Dec-09 5:29
Larry Mills Sr18-Dec-09 5:29 
GeneralRe: No Idea why the linker is giving error Pin
krmed18-Dec-09 5:38
krmed18-Dec-09 5:38 
GeneralRe: No Idea why the linker is giving error Pin
Larry Mills Sr18-Dec-09 5:42
Larry Mills Sr18-Dec-09 5:42 
QuestionError Pin
lgatcodeproject17-Dec-09 3:12
lgatcodeproject17-Dec-09 3:12 
AnswerRe: Error Pin
Abhi Lahare17-Dec-09 3:27
Abhi Lahare17-Dec-09 3:27 
AnswerRe: Error Pin
Fatbuddha 117-Dec-09 3:28
Fatbuddha 117-Dec-09 3:28 
AnswerRe: Error Pin
Stephen Hewitt17-Dec-09 3:32
Stephen Hewitt17-Dec-09 3:32 
JokeRe: Error Pin
Fatbuddha 117-Dec-09 3:37
Fatbuddha 117-Dec-09 3:37 
AnswerRe: Error Pin
transoft17-Dec-09 7:00
transoft17-Dec-09 7:00 
AnswerRe: Error Pin
Y_miao17-Dec-09 12:45
Y_miao17-Dec-09 12:45 
GeneralRe: Error Pin
Tim Craig17-Dec-09 18:01
Tim Craig17-Dec-09 18:01 
AnswerRe: Error Pin
Maxwell Chen17-Dec-09 21:49
Maxwell Chen17-Dec-09 21:49 
QuestionHow to add preview for my own filetype in Windows XP explorer? Pin
Erik17-Dec-09 2:09
Erik17-Dec-09 2:09 
AnswerRe: How to add preview for my own filetype in Windows XP explorer? Pin
KarstenK17-Dec-09 3:05
mveKarstenK17-Dec-09 3:05 

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.