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. UI Thread ... !

UI Thread ... !

Scheduled Pinned Locked Moved C / C++ / MFC
c++designdebugginghelpquestion
6 Posts 4 Posters 0 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.
  • M Offline
    M Offline
    Manmohan29
    wrote on last edited by
    #1

    I'm getting this message when I build my project - Linking... MyThread.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMyThread::MyMessageHandler(unsigned int,long)" (?MyMessageHandler@CMyThread@@QAEXIJ@Z) E:\Stuff\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals My code is here :-

    // stdafx.h
    .
    .
    .
    #define WM_MYMESSAGE (WM_USER+1)

    ---------------------------------------------

    // MyThread.h
    #pragma once

    // CMyThread

    class CMyThread : public CWinThread
    {
    DECLARE_DYNCREATE(CMyThread)

    //protected:
    public:
    CMyThread(); // protected constructor used by dynamic creation
    virtual ~CMyThread();

    public:
    afx_msg void MyMessageHandler(WPARAM, LPARAM);
    virtual BOOL InitInstance();
    virtual int ExitInstance();

    protected:
    DECLARE_MESSAGE_MAP()
    };

    -----------------------------------------

    //MyThread.cpp
    .
    .
    .
    afx_msg void MyMessageHandler(WPARAM, LPARAM)
    {

    }

    BEGIN_MESSAGE_MAP(CMyThread, CWinThread)
    ON_THREAD_MESSAGE(WM_MYMESSAGE, MyMessageHandler)
    END_MESSAGE_MAP()

    My project is MFC dialog based.

    Future Lies in Present. Manmohan Bishnoi

    L N Y 3 Replies Last reply
    0
    • M Manmohan29

      I'm getting this message when I build my project - Linking... MyThread.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMyThread::MyMessageHandler(unsigned int,long)" (?MyMessageHandler@CMyThread@@QAEXIJ@Z) E:\Stuff\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals My code is here :-

      // stdafx.h
      .
      .
      .
      #define WM_MYMESSAGE (WM_USER+1)

      ---------------------------------------------

      // MyThread.h
      #pragma once

      // CMyThread

      class CMyThread : public CWinThread
      {
      DECLARE_DYNCREATE(CMyThread)

      //protected:
      public:
      CMyThread(); // protected constructor used by dynamic creation
      virtual ~CMyThread();

      public:
      afx_msg void MyMessageHandler(WPARAM, LPARAM);
      virtual BOOL InitInstance();
      virtual int ExitInstance();

      protected:
      DECLARE_MESSAGE_MAP()
      };

      -----------------------------------------

      //MyThread.cpp
      .
      .
      .
      afx_msg void MyMessageHandler(WPARAM, LPARAM)
      {

      }

      BEGIN_MESSAGE_MAP(CMyThread, CWinThread)
      ON_THREAD_MESSAGE(WM_MYMESSAGE, MyMessageHandler)
      END_MESSAGE_MAP()

      My project is MFC dialog based.

      Future Lies in Present. Manmohan Bishnoi

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your method implementation doesn't have the class name -

      afx_msg void CMyThread::MyMessageHandler(WPARAM, LPARAM)
      {
      }

      L u n a t i c F r i n g e

      M 1 Reply Last reply
      0
      • L Lost User

        Your method implementation doesn't have the class name -

        afx_msg void CMyThread::MyMessageHandler(WPARAM, LPARAM)
        {
        }

        L u n a t i c F r i n g e

        M Offline
        M Offline
        Manmohan29
        wrote on last edited by
        #3

        Bull's Eye :thumbsup:

        LunaticFringe wrote:

        afx_msg void **CMyThread::**MyMessageHandler(WPARAM, LPARAM) { }

        I think I need to get my basics CLEARED AGAIN :^)

        Future Lies in Present. Manmohan Bishnoi

        L 1 Reply Last reply
        0
        • M Manmohan29

          Bull's Eye :thumbsup:

          LunaticFringe wrote:

          afx_msg void **CMyThread::**MyMessageHandler(WPARAM, LPARAM) { }

          I think I need to get my basics CLEARED AGAIN :^)

          Future Lies in Present. Manmohan Bishnoi

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Manmohan29 wrote:

          I think I need to get my basics CLEARED AGAIN

          ;) :-D

          L u n a t i c F r i n g e

          1 Reply Last reply
          0
          • M Manmohan29

            I'm getting this message when I build my project - Linking... MyThread.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMyThread::MyMessageHandler(unsigned int,long)" (?MyMessageHandler@CMyThread@@QAEXIJ@Z) E:\Stuff\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals My code is here :-

            // stdafx.h
            .
            .
            .
            #define WM_MYMESSAGE (WM_USER+1)

            ---------------------------------------------

            // MyThread.h
            #pragma once

            // CMyThread

            class CMyThread : public CWinThread
            {
            DECLARE_DYNCREATE(CMyThread)

            //protected:
            public:
            CMyThread(); // protected constructor used by dynamic creation
            virtual ~CMyThread();

            public:
            afx_msg void MyMessageHandler(WPARAM, LPARAM);
            virtual BOOL InitInstance();
            virtual int ExitInstance();

            protected:
            DECLARE_MESSAGE_MAP()
            };

            -----------------------------------------

            //MyThread.cpp
            .
            .
            .
            afx_msg void MyMessageHandler(WPARAM, LPARAM)
            {

            }

            BEGIN_MESSAGE_MAP(CMyThread, CWinThread)
            ON_THREAD_MESSAGE(WM_MYMESSAGE, MyMessageHandler)
            END_MESSAGE_MAP()

            My project is MFC dialog based.

            Future Lies in Present. Manmohan Bishnoi

            N Offline
            N Offline
            Netman116
            wrote on last edited by
            #5

            Perhaps you can try to delete the directory named "Debug" inside the directory named [your project] and build your project again.

            1 Reply Last reply
            0
            • M Manmohan29

              I'm getting this message when I build my project - Linking... MyThread.obj : error LNK2001: unresolved external symbol "public: void __thiscall CMyThread::MyMessageHandler(unsigned int,long)" (?MyMessageHandler@CMyThread@@QAEXIJ@Z) E:\Stuff\Manmohan\Visual C++\IPM\Debug\IPM.exe : fatal error LNK1120: 1 unresolved externals My code is here :-

              // stdafx.h
              .
              .
              .
              #define WM_MYMESSAGE (WM_USER+1)

              ---------------------------------------------

              // MyThread.h
              #pragma once

              // CMyThread

              class CMyThread : public CWinThread
              {
              DECLARE_DYNCREATE(CMyThread)

              //protected:
              public:
              CMyThread(); // protected constructor used by dynamic creation
              virtual ~CMyThread();

              public:
              afx_msg void MyMessageHandler(WPARAM, LPARAM);
              virtual BOOL InitInstance();
              virtual int ExitInstance();

              protected:
              DECLARE_MESSAGE_MAP()
              };

              -----------------------------------------

              //MyThread.cpp
              .
              .
              .
              afx_msg void MyMessageHandler(WPARAM, LPARAM)
              {

              }

              BEGIN_MESSAGE_MAP(CMyThread, CWinThread)
              ON_THREAD_MESSAGE(WM_MYMESSAGE, MyMessageHandler)
              END_MESSAGE_MAP()

              My project is MFC dialog based.

              Future Lies in Present. Manmohan Bishnoi

              Y Offline
              Y Offline
              yindoor
              wrote on last edited by
              #6

              Yes.need add :: :^)

              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