×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Using UF_UI_point_construct inside callback function of a dialog

Using UF_UI_point_construct inside callback function of a dialog

Using UF_UI_point_construct inside callback function of a dialog

(OP)
I had posted this question in another thread,

http://www.eng-tips.com/viewthread.cfm?qid=210620&page=1

but thought of posting it separately.



I have created a dialog (using UI Styler), called Dialog1.dlg and in the Dialog1_Apply_cb function I am adding a point contructor function (to get the point location from the user). For that I am using any one of the following commands

1)UF_UI_point_construct ("Enter point",&base_method,&point_tag,base_pt,&response);

or

2)uc1615 ("Enter location", base_pt );

or

3)uc1616 ("Enter location",&ia2,ip3,base_pt);

and the variables are declared as follows :

UF_STYLER_item_value_type_t data;
UF_UI_POINT_base_method_t base_method;
tag_t point_tag;
int orient1=0,response,ia2,ip3=0;
static double base_pt[3];

When I call .dll file, the above mentioned functions are not popping up the dialog boxes.

I checked the returned vales from uc1615 and uc1616, both returned 8. The value 8 means  "Disallowed state, unable to bring up dialog"

The function UF_UI_point_construct returned the value 119001

What might be wrong?

Note that the above 3 functions worked fine in other files but not in the callback function that I have created.

For example, the following code works fine :


extern void ufusr (char *param, int *retcode, int rlen){

UF_UI_POINT_base_method_t base_method=UF_UI_POINT_CURSOR_POS;
tag_t point_tag;
int orient1=0,response;
static double origin1[3];
    
    
     UF_initialize();
          

 UF_UI_point_construct ("Enter point",&base_method,&point_tag,origin1,&response);

 UF_terminate();

}

RE: Using UF_UI_point_construct inside callback function of a dialog

(OP)
I got the solution!!
Since the function UF_UI_point_construct pops up a dialog, I cannot use it in the callback function because the previous dialog (to which this callback belongs to) is still active(!?). In otherwords,
the following code works fine :

ufusr ()
{
.....
UF_STYLER_create_dialog();
.....
UF_UI_point_construct();
}

EXAMPLE_ok_cb()
{
......
}


whereas the following code will not work

ufusr ()
{
.....
UF_STYLER_create_dialog();
.....

}

EXAMPLE_ok_cb()
{
UF_UI_point_construct();
}

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources