Click here to Skip to main content
15,921,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiondesign-time license??? Pin
Mardigin5-Jul-03 16:24
Mardigin5-Jul-03 16:24 
AnswerRe: design-time license??? Pin
Mardigin5-Jul-03 16:29
Mardigin5-Jul-03 16:29 
AnswerRe: design-time license??? Pin
Mardigin5-Jul-03 16:47
Mardigin5-Jul-03 16:47 
QuestionPointing a function pointer to a variable? Pin
Anonymous5-Jul-03 14:53
Anonymous5-Jul-03 14:53 
AnswerSorry I was logged out Pin
Aidman5-Jul-03 14:55
Aidman5-Jul-03 14:55 
GeneralRe: Sorry I was logged out Pin
Rick York5-Jul-03 21:54
mveRick York5-Jul-03 21:54 
GeneralRe: Sorry I was logged out Pin
Aidman6-Jul-03 7:12
Aidman6-Jul-03 7:12 
AnswerRe: Pointing a function pointer to a variable? Pin
Ryan Binns5-Jul-03 20:29
Ryan Binns5-Jul-03 20:29 
Anonymous wrote:
The problem is that the VC++ compiler won’t cast from chars to the defined function pointer

I'm not surprised. This is an extremely dangerous thing to do, and should be avoided if at all possible. Is there any reason why you don't want to use inline assembly? You do realise that you can write a function as a separate assembly language file and link it with the rest of the program, don't you?

If you have to do this (and I strongly recommend that you don't), then you have to cast to the exact type.
typedef int (*FUNCPTR)(int, int);
FUNCPTR FuncPtr; // the function pointer
char ByteCode[] = {...}; // the byte code array

FuncPtr = (FUNCPTR)ByteCode;
although, I'm not sure if the compiler will let you do this. It may simply not want to cast a non-function pointer to a function-pointer, and I don't blame it Smile | :)

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: Pointing a function pointer to a variable? Pin
Aidman6-Jul-03 7:05
Aidman6-Jul-03 7:05 
GeneralRe: Pointing a function pointer to a variable? Pin
Ryan Binns6-Jul-03 17:50
Ryan Binns6-Jul-03 17:50 
AnswerRe: Pointing a function pointer to a variable? Pin
peterchen5-Jul-03 21:51
peterchen5-Jul-03 21:51 
GeneralRe: Pointing a function pointer to a variable? Pin
Aidman6-Jul-03 7:08
Aidman6-Jul-03 7:08 
GeneralRe: Pointing a function pointer to a variable? Pin
peterchen6-Jul-03 22:17
peterchen6-Jul-03 22:17 
GeneralProtected member access, that's not protected Pin
pdunn5-Jul-03 14:39
pdunn5-Jul-03 14:39 
GeneralUnknown message Pin
Xakep5-Jul-03 12:54
Xakep5-Jul-03 12:54 
GeneralRe: Unknown message Pin
Ryan Binns5-Jul-03 20:36
Ryan Binns5-Jul-03 20:36 
QuestionMS Office 97 ActiveX Control? Pin
Mardigin5-Jul-03 12:15
Mardigin5-Jul-03 12:15 
QuestionHow do I stop a do/while loop using a toolbar Pin
Rno355-Jul-03 10:58
Rno355-Jul-03 10:58 
AnswerRe: How do I stop a do/while loop using a toolbar Pin
jhaga5-Jul-03 11:37
professionaljhaga5-Jul-03 11:37 
AnswerRe: How do I stop a do/while loop using a toolbar Pin
MAAK6-Jul-03 13:31
MAAK6-Jul-03 13:31 
GeneralUpdating dialogue Pin
andyg.1015-Jul-03 4:01
andyg.1015-Jul-03 4:01 
GeneralRe: Updating dialogue Pin
valikac5-Jul-03 7:09
valikac5-Jul-03 7:09 
Questionhow I can know which character can output? Pin
Alice805-Jul-03 3:58
Alice805-Jul-03 3:58 
AnswerRe: how I can know which character can output? Pin
David Crow5-Jul-03 12:26
David Crow5-Jul-03 12:26 
GeneralRe: how I can know which character can output? Pin
RChin6-Jul-03 23:25
RChin6-Jul-03 23:25 

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.