Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralAlt+Tab replacement Pin
User 665817-Dec-04 4:50
User 665817-Dec-04 4:50 
GeneralRe: Alt+Tab replacement Pin
Alex Korchemniy17-Dec-04 13:14
Alex Korchemniy17-Dec-04 13:14 
GeneralRe: Alt+Tab replacement Pin
User 665817-Dec-04 14:29
User 665817-Dec-04 14:29 
GeneralRe: Howto update text files Pin
yarp17-Dec-04 3:57
yarp17-Dec-04 3:57 
GeneralRe: Howto update text files Pin
John R. Shaw17-Dec-04 4:59
John R. Shaw17-Dec-04 4:59 
GeneralHowto update text files Pin
yarp17-Dec-04 3:28
yarp17-Dec-04 3:28 
GeneralRe: Howto update text files Pin
Prakash Nadar17-Dec-04 3:46
Prakash Nadar17-Dec-04 3:46 
GeneralWhen "function pointer" meets "template"... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 2:32
Member 159648417-Dec-04 2:32 
hi folks,

First, just to let you know that I use g++ to compile the src containing following code segments. Now lets start the business.

This is a templated class method I got:
template<class T>
void
SynchList<T>::Apply(void (*func)(T))
{
lock->Acquire();
list->Apply(func);
lock->Release();
}

and this is the function pointed by the function pointer:
void
SimpleThread(Thread *tmpThread)
{
int num;
for(num = 0; num < 5; num++)
{
cout << "***thread " << tmpThread->GetId() << " looped " << num << " times" << endl;
kernel->currentThread->Yield();
}
}

I have "bathList" as a pointer to SynchList<Thread *>:
SynchList<Thread *> *bathList = new SyncList<Thread *>;

and this is how I implement it (@ line 494 of the src):
bathList->Apply((void) (SimpleThread)(Thread *));

but I get this error msg everytime I try to compile the code:
../threads/thread.cc:494: parse error before '*'

Any help would be greatly appreciated.


Thank you all,
James

GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:19
John R. Shaw17-Dec-04 4:19 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 4:37
Member 159648417-Dec-04 4:37 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 4:46
John R. Shaw17-Dec-04 4:46 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Member 159648417-Dec-04 12:57
Member 159648417-Dec-04 12:57 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 14:06
John R. Shaw17-Dec-04 14:06 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Antony M Kancidrowski17-Dec-04 4:53
Antony M Kancidrowski17-Dec-04 4:53 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
John R. Shaw17-Dec-04 5:44
John R. Shaw17-Dec-04 5:44 
GeneralRe: When &quot;function pointer&quot; meets &quot;template&quot;... I can't get rid of this compiling error !!! Pin
Anonymous17-Dec-04 6:52
Anonymous17-Dec-04 6:52 
Generalchange caption font of dialog for XP Pin
includeh1017-Dec-04 2:08
includeh1017-Dec-04 2:08 
GeneralRe: change caption font of dialog for XP Pin
Prakash Nadar17-Dec-04 4:32
Prakash Nadar17-Dec-04 4:32 
GeneralRe: change caption font of dialog for XP Pin
ThatsAlok17-Dec-04 22:43
ThatsAlok17-Dec-04 22:43 
Generalmethod for determining full application path Pin
scoroop17-Dec-04 2:01
scoroop17-Dec-04 2:01 
GeneralRe: method for determining full application path Pin
krmed17-Dec-04 2:17
krmed17-Dec-04 2:17 
GeneralRe: method for determining full application path Pin
Antony M Kancidrowski17-Dec-04 3:08
Antony M Kancidrowski17-Dec-04 3:08 
GeneralRe: method for determining full application path Pin
scoroop17-Dec-04 4:53
scoroop17-Dec-04 4:53 
GeneralRe: method for determining full application path Pin
Antony M Kancidrowski17-Dec-04 4:58
Antony M Kancidrowski17-Dec-04 4:58 
GeneralRe: method for determining full application path Pin
scoroop17-Dec-04 5:11
scoroop17-Dec-04 5:11 

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.