The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 Calling Origin C function by String Id

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
peter.cook Posted - 01/14/2005 : 3:42:32 PM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System:Win 2000

Hi,

Can anyone please assist by letting me know how i can call an Origin C function within another C function by passing the name eg I would like to do :

void Function1 () {
do something
}

void (string FName) {
FName;
}

Thanks in advance,

Cheers,

pete

Should have sent to C forum and maybe displaying my C programming skills (lack of)

Edited by - peter.cook on 01/14/2005 3:44:58 PM
2   L A T E S T    R E P L I E S    (Newest First)
rlewis Posted - 01/14/2005 : 4:27:12 PM
This topic may help ...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=2146
Mike Buess Posted - 01/14/2005 : 4:26:58 PM
If the function you want to call is defined in the same file as the calling function you could do this...
typedef void (*FUNCTYPE)();


void test(string FName)
{
FUNCTYPE pfn = Project.FindFunction(FName, __FILE__);

if( pfn )
pfn();
}
Look for Project.FindFunction in the index of the Programming Guide for details.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/14/2005 4:43:13 PM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000