Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. small error

small error

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelpquestionlearning
9 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jarley D G
    wrote on last edited by
    #1

    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

    P PJ ArendsP 2 Replies Last reply
    0
    • J Jarley D G

      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

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      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[][^]

      J 1 Reply Last reply
      0
      • J Jarley D G

        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

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        CallbackProc has to have a return type specified. If it does not return anything then specify a void return type.

        static CALLBACK void CallbackProc(...)


        You may be right
        I may be crazy
        -- Billy Joel --

        Within you lies the power for good, use it!!!

        Within you lies the power for good; Use it!

        1 Reply Last reply
        0
        • P prasad_som

          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[][^]

          J Offline
          J Offline
          Jarley D G
          wrote on last edited by
          #4

          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

          P 1 Reply Last reply
          0
          • J Jarley D G

            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

            P Offline
            P Offline
            prasad_som
            wrote on last edited by
            #5

            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[][^]

            J 1 Reply Last reply
            0
            • P prasad_som

              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[][^]

              J Offline
              J Offline
              Jarley D G
              wrote on last edited by
              #6

              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

              P 1 Reply Last reply
              0
              • J Jarley D G

                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

                P Offline
                P Offline
                prasad_som
                wrote on last edited by
                #7

                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[][^]

                J 1 Reply Last reply
                0
                • P prasad_som

                  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[][^]

                  J Offline
                  J Offline
                  Jarley D G
                  wrote on last edited by
                  #8

                  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

                  P 1 Reply Last reply
                  0
                  • J Jarley D G

                    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

                    P Offline
                    P Offline
                    prasad_som
                    wrote on last edited by
                    #9

                    May be you can mail across code. Can't fgure out problem.

                    Prasad Notifier using ATL | Operator new[],delete[][^]

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups