small error
-
Hi all I have loaded (a copy just in case) of my project from VS2003 at VS 2005, it was converted fine with just a few errors that I fixed but I still have this one that I dont understand. I´m not an expert, I´ve few months programming MFC self learning and still a lot to learn. The error Line :
static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Can I continue with my MFC project at VS2005 with no problems at all? Why I cant see my dialogs, main form , etc.. just the code? Where are they!!? thx in advance. Jdg--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
-
Hi all I have loaded (a copy just in case) of my project from VS2003 at VS 2005, it was converted fine with just a few errors that I fixed but I still have this one that I dont understand. I´m not an expert, I´ve few months programming MFC self learning and still a lot to learn. The error Line :
static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Can I continue with my MFC project at VS2005 with no problems at all? Why I cant see my dialogs, main form , etc.. just the code? Where are they!!? thx in advance. Jdg--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
jarleydg wrote:
The error Line : static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData); The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Modify this declaration to,
static int CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
jarleydg wrote:
Why I cant see my dialogs, main form , etc.. just the code? Where are they!!?
They are in resource explorer. Aren't they ?
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hi all I have loaded (a copy just in case) of my project from VS2003 at VS 2005, it was converted fine with just a few errors that I fixed but I still have this one that I dont understand. I´m not an expert, I´ve few months programming MFC self learning and still a lot to learn. The error Line :
static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Can I continue with my MFC project at VS2005 with no problems at all? Why I cant see my dialogs, main form , etc.. just the code? Where are they!!? thx in advance. Jdg--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
-
jarleydg wrote:
The error Line : static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData); The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Modify this declaration to,
static int CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData);
jarleydg wrote:
Why I cant see my dialogs, main form , etc.. just the code? Where are they!!?
They are in resource explorer. Aren't they ?
Prasad Notifier using ATL | Operator new[],delete[][^]
Done :) thanks. ups... sorry resource explorer! was hidden.. stupid me. =/ Well the previous part compiled ok, but I´m using too this code from MSDN by Paul DiLascia where he encapsulated SHBrowseForFolder in a class FolderDlg... http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx At VS2003 it was working ok... but now I´m having this fatal error... So my project still can´t compile :( please any help apretiated . thanks in advance. FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ) .\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
-
Done :) thanks. ups... sorry resource explorer! was hidden.. stupid me. =/ Well the previous part compiled ok, but I´m using too this code from MSDN by Paul DiLascia where he encapsulated SHBrowseForFolder in a class FolderDlg... http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx At VS2003 it was working ok... but now I´m having this fatal error... So my project still can´t compile :( please any help apretiated . thanks in advance. FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ) .\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
jarleydg wrote:
FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
Probably you are using
_DbgName
, but linker is not getting its definition. In release build its definition is suppressed.jarleydg wrote:
FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ) .\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
Same case is with class
CInterfaceNames
. Its for debug configuration only. In release confiruation, its defn's are suppressed, hence error.Prasad Notifier using ATL | Operator new[],delete[][^]
-
jarleydg wrote:
FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z)
Probably you are using
_DbgName
, but linker is not getting its definition. In release build its definition is suppressed.jarleydg wrote:
FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ) .\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals
Same case is with class
CInterfaceNames
. Its for debug configuration only. In release confiruation, its defn's are suppressed, hence error.Prasad Notifier using ATL | Operator new[],delete[][^]
In fact it is in debug configuration where the linker errors came. When I compile in release, all is ok... So I´m missing something in my debug config? this line is a comment in the code // You must link shlwapi.lib for StrRetToBuf could this be the problem? If it is... how do I link shlwapi.lib ? thx again. jdg
--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
-
In fact it is in debug configuration where the linker errors came. When I compile in release, all is ok... So I´m missing something in my debug config? this line is a comment in the code // You must link shlwapi.lib for StrRetToBuf could this be the problem? If it is... how do I link shlwapi.lib ? thx again. jdg
--------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG
Linking error are generated, because linker could not resolve certain function calls. From code of article you have mentioned,
_DbgName
is meant to compile in debug configuration(#ifdef _DEBUG) only. Can you show how you have used_DbgName
in your code ?jarleydg wrote:
this line is a comment in the code // You must link shlwapi.lib for StrRetToBuf could this be the problem? If it is... how do I link shlwapi.lib ?
No. It is already linked
Prasad Notifier using ATL | Operator new[],delete[][^]
-
Linking error are generated, because linker could not resolve certain function calls. From code of article you have mentioned,
_DbgName
is meant to compile in debug configuration(#ifdef _DEBUG) only. Can you show how you have used_DbgName
in your code ?jarleydg wrote:
this line is a comment in the code // You must link shlwapi.lib for StrRetToBuf could this be the problem? If it is... how do I link shlwapi.lib ?
No. It is already linked
Prasad Notifier using ATL | Operator new[],delete[][^]
I´m not using it, I just #include "FolderDlg.h" and use it this way :
BOOL CDlgEnsayoObs::BrowseForDataStore () { CCableOkApp* pApp = (CCableOkApp*)AfxGetApp(); CFolderDialog dlg(this); CString path; LPCITEMIDLIST pidl; BOOL bRet = FALSE; pidl = dlg.BrowseForFolder(_T("Seleccione el directorio de Almacén de datos"), BIF_USENEWUI |BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT ,NULL ,TRUE); path = dlg.GetPathName(pidl); if (path.IsEmpty ()) { return bRet; } else { pApp->m_sDataFilePath = path + "\\"; pApp->m_sDataStorePath = path + "\\"; SetDlgItemText(IDC_FILEPATH, "Seleccione un grupo de cables o Dir. de captura"); SetDlgItemText(IDC_DATASTORE, pApp->m_sDataStorePath); pApp->m_DataBase.SetDataStore(pApp->m_sDataStorePath); bRet = TRUE; } dlg.FreePIDL(pidl); // liberar PIDL cuando se termina--importante!! return bRet; }
In my project is not _DbgName in any place. It´s only in the DiLascia code inside a debug.h file. I´m not including nor added to my project this two files, debug.h and debug.cpp. I´m only including FolderDlg.h, FolderDlg.cpp, where the functions I want to use are declared/implemented. Anyway FolderDlg header is already including debug.h ... This one debug.h ://////////////////////////////////////////////////////////////// // PixieLib(TM) Copyright 1997-2005 Paul DiLascia // If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it. // // --- // General purpose debugging utilities. // #ifndef _DEBUG_H #define _DEBUG_H #ifndef countof #define countof(x) (sizeof(x)/sizeof(x[0])) #endif #ifdef _DEBUG // tell linker to look in ole32 lib (for StringFromClsid) #pragma comment(linker, "/defaultlib:ole32.lib") ////////////////// // The following stuff is for getting human-readable names of things so // you can show them in TRACE statements. For example, // // TRACE("Window is: %s\n", _TR(pWnd)); // // Will generate output showing the name and title of the window, etc. // // Macro _TR casts _DbgName(x) to LPCTSTR for use with in printf so you // can write // // TRACE("Message is %s\n", _TR(uMsg)); // // instead of // // TRACE("Message is %s\n", (LPCTSTR)_DbgName(uMsg)); // #define _TR(x) (LPCTSTR)_DbgName(x) // overloaded fns to get names of things. extern CString _DbgName(CWnd* pWnd); // get name of window extern CString _DbgName(UINT uMsg); // ... WM_ message extern CString _DbgName(REFIID iid); // get name of COM i
-
I´m not using it, I just #include "FolderDlg.h" and use it this way :
BOOL CDlgEnsayoObs::BrowseForDataStore () { CCableOkApp* pApp = (CCableOkApp*)AfxGetApp(); CFolderDialog dlg(this); CString path; LPCITEMIDLIST pidl; BOOL bRet = FALSE; pidl = dlg.BrowseForFolder(_T("Seleccione el directorio de Almacén de datos"), BIF_USENEWUI |BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT ,NULL ,TRUE); path = dlg.GetPathName(pidl); if (path.IsEmpty ()) { return bRet; } else { pApp->m_sDataFilePath = path + "\\"; pApp->m_sDataStorePath = path + "\\"; SetDlgItemText(IDC_FILEPATH, "Seleccione un grupo de cables o Dir. de captura"); SetDlgItemText(IDC_DATASTORE, pApp->m_sDataStorePath); pApp->m_DataBase.SetDataStore(pApp->m_sDataStorePath); bRet = TRUE; } dlg.FreePIDL(pidl); // liberar PIDL cuando se termina--importante!! return bRet; }
In my project is not _DbgName in any place. It´s only in the DiLascia code inside a debug.h file. I´m not including nor added to my project this two files, debug.h and debug.cpp. I´m only including FolderDlg.h, FolderDlg.cpp, where the functions I want to use are declared/implemented. Anyway FolderDlg header is already including debug.h ... This one debug.h ://////////////////////////////////////////////////////////////// // PixieLib(TM) Copyright 1997-2005 Paul DiLascia // If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it. // // --- // General purpose debugging utilities. // #ifndef _DEBUG_H #define _DEBUG_H #ifndef countof #define countof(x) (sizeof(x)/sizeof(x[0])) #endif #ifdef _DEBUG // tell linker to look in ole32 lib (for StringFromClsid) #pragma comment(linker, "/defaultlib:ole32.lib") ////////////////// // The following stuff is for getting human-readable names of things so // you can show them in TRACE statements. For example, // // TRACE("Window is: %s\n", _TR(pWnd)); // // Will generate output showing the name and title of the window, etc. // // Macro _TR casts _DbgName(x) to LPCTSTR for use with in printf so you // can write // // TRACE("Message is %s\n", _TR(uMsg)); // // instead of // // TRACE("Message is %s\n", (LPCTSTR)_DbgName(uMsg)); // #define _TR(x) (LPCTSTR)_DbgName(x) // overloaded fns to get names of things. extern CString _DbgName(CWnd* pWnd); // get name of window extern CString _DbgName(UINT uMsg); // ... WM_ message extern CString _DbgName(REFIID iid); // get name of COM i
May be you can mail across code. Can't fgure out problem.
Prasad Notifier using ATL | Operator new[],delete[][^]