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 for Programming
 Forum for Origin C
 Different ways of X-Fun calling. How to recognize?

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
Alex-qwerty Posted - 01/25/2011 : 11:44:26 AM
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()?
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 01/26/2011 : 12:33:35 AM
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

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