Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Protoolkit question - please help

status=ProMenubarmenuPushbuttonAdd ("UserMenu", "Button1", <?:NAMESPACE PREFIX = O /><O:p></O:p>
"USER -Button1", "USER New Button help1.", NULL, PRO_B_FALSE, <O:p></O:p>
cmd_id, UserMsg);<O:p></O:p>
<O:p></O:p>
status=ProMenubarmenuPushbuttonAdd ("UserMenu", "Button2", <O:p></O:p>
"USER -Button2", "USER New Button help1.", "Button1", PRO_B_TRUE, <O:p></O:p>
cmd_id, UserMsg);

This does not look right.

Dave
 
hi frieinds am also into learning TOOLKIT pls guide me how to execute the programs,Do u have any tutorilas with basic program exampls
pls help.

Easwaran
 
dhbigelow said:
status=ProMenubarmenuPushbuttonAdd ("UserMenu", "Button1", <?:NAMESPACE PREFIX = O /><O:p></O:p>
"USER -Button1", "USER New Button help1.", NULL, PRO_B_FALSE, <O:p></O:p>
cmd_id, UserMsg);<O:p></O:p>
<O:p></O:p>
status=ProMenubarmenuPushbuttonAdd ("UserMenu", "Button2", <O:p></O:p>
"USER -Button2", "USER New Button help1.", "Button1", PRO_B_TRUE, <O:p></O:p>
cmd_id, UserMsg);

This does not look right.

Dave

I tried with PRO_B_TRUE instead of PRO_B_FALSE and same result. I Don't know where is the mistake.

Edited by: c_dan
 
It has got to be something simple. What about the NULL vs Button1? If that is not it, I am going to defer to someone else - we connect asynch to pro/e.


Dave
 
I think the problem is likely to be in your menu file. The actual text in the menu comes from this file. In my sample menu here, my menu would read:


Copy Part info
Enter Assy info



-------Sample menu-------


TK-Tools
CustomApps
#
#
LI -MainBtnM4A
Copy Part info (yours probably says -button2, change it to button1)
#
#
LI -MainBtnM3A
Enter Assy info
#
#
help.
help comment for this subject.
#
#
 
dhbigelow said:
It has got to be something simple. What about the NULL vs Button1? If that is not it, I am going to defer to someone else - we connect asynch to pro/e.


Dave


I tried that too, still doesn't work. Same result. I think I'm going mad.
Edited by: c_dan
 
You're mapping both of your menu picks to the same cmd action name.


You need to create a unique action name for Button2 even if it calls the same function in your code.


So add this to just before your call to ProMenubarmenuPushbuttonAdd for Button2. Notice it has a different name "UserDispMsg2".


status=ProCmdActionAdd ("UserDispMsg2", (uiCmdCmdActFn)MiscAction1, uiCmdPrioDefault, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE, &cmd_id);
Edited by: bruppert
 
bruppert is right. Plus I see another issue. your second to last paramter in the call to ProMenubarmenuPushbuttonAdd. It can't be the same. create another uiCmdCmdId variable


uiCmdCmdId cmd_id;


uiCmdCmdId cmd_id2;


status=ProMenubarmenuPushbuttonAdd ("UserMenu", "Button2", <?:NAMESPACE PREFIX = O /><O:p></O:p>
"USER -Button2", "USER New Button help1.", "Button1", PRO_B_TRUE, <O:p></O:p>
cmd_id2,
smiley32.gif
UserMsg);<O:p></O:p>
 
c_dan: Glad you got it working.


FishNut:The reason I told c_dan to add the function to just before the ProMenubarmenuPushbuttonAdd was so he would get a new cmd_id. It could still be called cmd_id - you're just reusing the variable name - not it's address.
 
Hi,


I run into another problem. My program is working on my computer. But when I try to run it in another office, I got and PRO_TK_NO_LICENSE error.


It says:


Foreign program "my_app" failed to initialize: error PRO_TK_NO_LICENSE
Application "my_app" started successfully.


Is a special license required to run custom protoolkit apps ?
Edited by: c_dan
 
You need to unlock the application in order to run it on a machine that doesn't have a Pro/TOOLKIT license. You run "protk_unlock <your appname>" on the machine that has the toolkit license and it will unlock it. Beware that there's a 15 minute "pause" in the unlocking. You can see the Fundamentals section of the Toolkit help for more details.
 

Sponsor

Articles From 3DCAD World

Back
Top