Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using UF_UI_point_construct inside callback function of a dialog

Status
Not open for further replies.

man2007

Aerospace
Nov 6, 2007
283
I had posted this question in another thread,


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();

}
 
Replies continue below

Recommended for you

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();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor