Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi,
Some one please suggest me the methods/steps to write log file in a creo parametric toolkit application.
I tried using PTApplsUnicodeFopen() but when i try to add header file PTApplsUnicodeUtils.h gives unresolved external error.
Please tell me the how to write a log file in creo parametric toolkit application
Thanks
Solved! Go to Solution.
There are multiple ways to write a log file in your application.
The most straightforward consists in writing in a file.
If you code with C:
//create a global variable:
FILE *log;
//open the file (when needed):
log = fopen("your_log_file_name.log", "w");
//From your function(s), call fprintf() to write stuff in your file when required:
fprintf(log, "%d %s\n", <my_integer>, <my_string>);
//when closing to the end of your application, close the file:
fclose(log);
An alternative consists in writing stuff in the trail file.
To perform that, rely on ProTrailfileCommentWrite().
There are multiple ways to write a log file in your application.
The most straightforward consists in writing in a file.
If you code with C:
//create a global variable:
FILE *log;
//open the file (when needed):
log = fopen("your_log_file_name.log", "w");
//From your function(s), call fprintf() to write stuff in your file when required:
fprintf(log, "%d %s\n", <my_integer>, <my_string>);
//when closing to the end of your application, close the file:
fclose(log);
An alternative consists in writing stuff in the trail file.
To perform that, rely on ProTrailfileCommentWrite().