Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6217727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:28:33+00:00 2026-05-24T07:28:33+00:00

I have template < typename threadFuncParamT > class ThreadWrapper { public: static int ThreadRoutineFunction(void*

  • 0

I have

template < typename threadFuncParamT >
class ThreadWrapper
{
public:
    static int ThreadRoutineFunction(void* pParam);
    int ExecuteThread();

    ThreadWrapper(ThreadPool<threadFuncParamT> *pPool);

};

template<typename threadFuncParamT>
int ThreadWrapper<threadFuncParamT>::ThreadRoutineFunction(void* pParam)
{
    ThreadWrapper<threadFuncParamT> *pWrapper = reinterpret_cast<ThreadWrapper<threadFuncParamT>*>(pParam);
        if(pWrapper != NULL)
{

        return pWrapper-ExecuteThread(); // Error here.
    }

    return 0;
}

template < typename threadFuncParamT >
ThreadWrapper<threadFuncParamT>::ThreadWrapper(ThreadPool<threadFuncParamT> *pPool)
{
    ThreadWrapper<threadFuncParamT>::m_pThreadPool = pPool;
    m_tbbThread = new tbb::tbb_thread(&(ThreadWrapper<threadFuncParamT>::ThreadRoutineFunction), this);
    if (m_tbbThread->native_handle() == 0)
    {
        delete m_tbbThread;
        m_tbbThread = NULL;
        // TODO: throw execption here or raise assert.
    }
}

I am getting error as below
Error 1 error C2352: ‘ThreadWrapper::ExecuteThread’ : illegal call of non-static member function

I am compiling on VS2010.

Can any one help me here how to get clear the error.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:28:34+00:00Added an answer on May 24, 2026 at 7:28 am

    You’re missing the “>”
    It’s

    pWrapper->ExecuteThread()
    

    not

    pWrapper-ExecuteThread()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this: template<typename T, int X> class foo { public: void set(const
I have the following template class template <typename threadFuncParamT > class ThreadPool { //
I have a class template <typename Iterator, typename Value> class Foo { public: Foo(const
I have the following template declaration: template <typename T> void IterTable(int& rIdx, std::vector<double>& rVarVector,
In the file test.cpp, I have this: template <typename T> class A { public:
I have a visitor class resembling this: struct Visitor { template <typename T> void
I have template <typename ConcContainer> class WebBrowsingPolicyData { public: typedef ConcContainer<std::shared_ptr<WBRuleDetails>>::iterator iterator; ... private:
Imagine I have a template function like this: template<typename Iterator> void myfunc(Iterator a, typename
I have the following class definition: template<typename QueueItemT> class QueueBC { protected: QueueBC() {}
I have a template class with a private map member template <typename T> class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.