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 for Programming
 Forum for Origin C
 Different ways of X-Fun calling. How to recognize?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Alex-qwerty

Russia
Posts

Posted - 01/25/2011 :  11:44:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 8.1SR3 WinXP SP3
I have my X-Function that can be called by two differen ways:
1. By user in command window with showing dialog "MyXFun -d"
2. From my C-code by XFBase::Evaluate()
I want in "MyXFun" to recognize which the way the function is executed: by pressing OK button in dialog or by xf.Evaluate()?

Penn

China
644 Posts

Posted - 01/26/2011 :  12:33:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

When you use "MyXFun -d", the dialog will be opened. But the dialog will not open for XFBase::Evaluate(). In the _before_execute event of the X-Function, the argument int dwCntrl can be used to check whether the dialog is open. However, when using XFBase::Evaluate(), the _before_execute event function is not called. So, you can use the XFBase::Run() method instead. Then in the _before_execute event function, check whether the dialog is opened or not like:

if( LTXF_SHOW_DIALOG & dwCntrl )
	out_str("dialog show");
else
	out_str("dialog not show");

See the document here.

Penn
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