Template for PostAction Custom Exit DLL Program

 

 

 

 

 

 

 

 

 

 

 

 

Template for PostAction custom Exit DLL Program

For ITK Customization,please see below  PostAction 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_post_action(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 GLOBALPLM”);

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

iFail=METHOD_add_post_action(method_id,(METHOD_function_t)GLOBALPLM_add_post_action,NULL);

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

iFail=METHOD_add_post_action(METHOD_id_t *method_id,(METHOD_function_t)post_action_handler,TC_argument_list_t *user_args); */

return iFail;

}

extern DLLAPI int GLOBALPLM_add_post_action(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 VB”);

return iFail;

}


  Popular Teamcenter Article published

https://globalplm.com/template-for-precondition-custom-exit-dll-program/

Template for Batch ITK Program

Basic ITK Customization Concept Part-02

Basic ITK Customization Concept Part-01

Teamcenter Customize Error Messages

User Service Mechanism in Teamcenter Customization

Explanation of ITK Login Program

POM Queries in Teamcenter

Teamcenter Workflow Handlers

Microsoft Visual Studio Project configuration for Teamcenter Unified ITK

Teamcenter Unified Customization Basics

Teamcenter Unified Data Model Concept


 


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).

Leave a Reply

Your email address will not be published. Required fields are marked *