cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Menu - fcn call with arguments

msteffke
12-Amethyst

Menu - fcn call with arguments

Goodmorning,
Can you pass argumments to your CmdAct function. The function EnterJobInfo has 2 arguments. How do I pass them if I am calling the function from a menu button?

status = ProCmdActionAdd ("EnterJobInfo", (uiCmdCmdActFn)EnterJobInfo,
uiCmdPrioDefault, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE,
&cmd_id3);


Thanks, Mark

This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 REPLY 1

Hi Mark -

If it were my choice, I'd allow something useful to be done with those
function arguments
as you suggest. Unfortunately, the documentation says that those
arguments are ignored.
This is excerpted from .../proe/protoolkit/protkdoc/api/2010.html :

Synopsis

#include <prouicmd.h>

int (*uiCmdCmdActFn) (
uiCmdCmdId command, /* (In) The
identifier of the action or option */
uiCmdValue *p_value, /* (In) For
options passed to ValueGet functions. Ignored for actions. */
void *p_push_command_data /* (In) Not used */
)

Returns - The return value is ignored.

If you have a limited number of parameter combinations, you might defining
multiple
uiCmdCmdId's for use with the same action function. You could then write
logic inside
your uiCmdCmdActFn to determine which ID caused the invocation.

If your parameter combinations are vast or infinite, you may have to
resort to some
global or module-level technique to set and retrieve your parameter
variables.

|+| M a r k |+|





"Steffke, Mark" <->
Sent by: -
02/08/2006 09:45 AM
Please respond to
"Steffke, Mark" <->


To
"PTC/USER Programming Tools Discussion" <->
cc

Subject
[toolkits] Menu - fcn call with arguments






Goodmorning,
Can you pass argumments to your CmdAct function. The function
EnterJobInfo has 2 arguments. How do I pass them if I am calling the
function from a menu button?

status = ProCmdActionAdd ("EnterJobInfo", (uiCmdCmdActFn)EnterJobInfo,
uiCmdPrioDefault, TestAccessDefault, PRO_B_TRUE, PRO_B_TRUE,
&cmd_id3);


Thanks, Mark

---

You are currently subscribed to toolkits.
To unsubscribe send a blank e-mail to
-.

For assistance, email us at - or find other contacts
at www.ptcuser.org/org/contacts.html.

PTC/USER and the PTC/USER logo are registered trademarks of PTC/USER, Inc.

Pro/ENGINEER is a registered trademark of PTC.

Message authors are solely responsible for the content of their posts.
Announcements
Attention: Creo 7.0 Customers
Please consider upgrading
End of Life announcement here.

NEW Creo+ Topics:
PTC Control Center
Creo+ Portal
Real-time Collaboration