Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. 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().