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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Calling Origin C function by String Id
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

peter.cook

UK
356 Posts

Posted - 01/14/2005 :  3:42:32 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 01/14/2005 :  4:26:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 01/14/2005 :  4:27:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This topic may help ...
http://www.originlab.com/forum/topic.asp?TOPIC_ID=2146
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000