C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 17th, 2012, 09:53 AM
tescrin tescrin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 14 tescrin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 32 sec
Reputation Power: 0
Member Function Pointer issues..

I've been trying to get pass a member function as a pointer. I've been here.

My code looks like this:
Code:
typedef HRESULT (some_class::* some_mfp (long*);
some_mfp derp = HRESULT (some_class::*member_function)(long*);


and my error is:
Quote:
error C2143: syntax error : missing ')' before '<tag>::*'
error C2059: syntax error : ')'


I know it's close, and from the looks of the stack overflow link it should be correct. Please help!


Note: I do realize you're typically not supposed to do this (and it's explicitly mentioned in the C++ faq.) However, sometimes when you're knee-deep in ugly code you have to break out the big guns. Please give me the benefit of the doubt and help me with syntax.

Reply With Quote
  #2  
Old December 17th, 2012, 10:02 AM
tescrin tescrin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2012
Posts: 14 tescrin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 24 m 32 sec
Reputation Power: 0
Arg. Sorry, I fixed it. Looks like I was missing a "__stdcall" from my definition (I had had it in there earlier) and now it works.

For completeness:
Code:
typedef HRESULT (__stdcall some_class::* some_mfp (long*);
some_mfp derp = HRESULT (some_class::*member_function)(long*);


I'll mention this was a COM class I'm hooking up to; hence the need for __stdcall. Glad I didn't waste anyone's time!

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Member Function Pointer issues..

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap