Template for PreCondition custom Exit DLL Program

For ITK Customization,please see below  PreCondition Custom Exit DLL Program Template.

#include<stdio.h>

#include<tc\tc.h>

#include<tccore\custom.h>

#include<tc\emh.h>

#include<fclasses\tc_string.h>

#include<tccore\method.h>

int iFail=0;

#define DLLAPI_declspec(dllexport)

#define plmerror (EMH_USER_error_base +2)

//get +2 error in TCROOT/lang/en_us/ue_errors.xml

extern DLLAPI int custom_dll_register_callbacks();

extern DLLAPI int GLOBALPLM_execute_callbacks1(int *decision,va_list argc);

extern DLLAPI int GLOBALPLM_execute_callbacks2(int *decision,va_list argc);

extern DLLAPI int GLOBALPLM_add_pre_condition(METHOD_message_t *msg,va_list args);

 

 

extern DLLAPI int custom_dll_register_callbacks()

{

iFail=custom_register_exit(“custom_dll”,”USER_init_module”,(CUSTOM_EXIT_ftn_t)GLOBALPLM_execute_callbacks1);

iFail=custom_register_exit(“custom_dll”,”USER_exit_module”,(CUSTOM_EXIT_ftn_t)GLOBALPLM_execute_callbacks2);

}

extern DLLAPI int GLOBALPLM_execute_callbacks1(int *decision,va_list argc)

{

METHOD_id_t method_id;

*decision=ALL_CUSTOMIZATIONS;

printf(“WELCOME TO TEAMCENTER WORLD”);

iFail=METHOD_find_method(“ItemRevision”,”ITEM_copy_rev”,&method_id);

iFail=METHOD_add_pre_condition(method_id,(METHOD_function_t)GLOBALPLM_add_pre_condition,NULL);

/* iFail=METHOD_find_method(const char *type_name,const char *msg_name,METHOD_id_t *method_id);

iFail=METHOD_add_pre_condition(METHOD_id_t *method_id,(METHOD_function_t)pre_condition_handler,TC_argument_list_t *user_args); */

return iFail;

}

extern DLLAPI int GLOBALPLM_add_pre_condition(METHOD_message_t *msg,va_list args)

{

if

{

}

else

{

EMH_store_error_s1(EMH_severity_error,plmerror,obj_name);

return plmerror;

}

}

extern DLLAPI int GLOBALPLM_execute_callbacks2(int *decision,va_list argc)

{

*decision=ALL_CUSTOMIZATIONS;

printf(“GOOD BYE”);

return iFail;

}


  Popular Teamcenter Article published


 


Four Easy Steps to Get Subscribed

Step1:-Enter your Email address and Hit SUBSCRIBE Button.

Step2:-Please check inbox and open the email with the subject lineConfirm your subscription for Global PLM“.

Step3:-Please click “Confirm Follow” and you got the email with the subject” Confirmed subscription to posts on Global PLM”.

Step4:-Voila, You are subscribed.Happy Learning


 

We will more post on  PLM Tutorial–>Teamcenter Customization in upcoming days.

Kindly provide your valuable comment on the below Comment section and We will try to provide the best workaround.

Kindly subscribe to your Email-Id at (https://globalplm.com/) and drop any suggestions/queries to (globalplm2@gmail.com).

admin