Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello,
I am currently trying to update an old Toolkit script from Creo 5 to 9, and a couple functions,(ProGtoldataFreeStateGet, ProGtoldataDiameterGet etc.) were updated to ProGtolValueStringGet. I was looking at this article Article - CS280972 - How to use ProGtolSymbolStringGet and ProGtolValueStringSet to replace deprecated Creo Toolkit API 4.0 and onward (ptc.com) for assistance, but I was unable to discern what the actual output of ProGtolValueStringGet would be. I tried printing it out to the console to figure it out, but I also could not figure out how to get the otk_install.exe from the otk_install.sln that I am running the scripts on, to print it out.
Any and all help would be greatly appreciated,
Thank you,
Mark Hardebeck
Solved! Go to Solution.
ProGtoValueStringGet(...) for output argument needs a pointer to a pointer to wchar_t. Meaning: the return value would be allocated on-heap and needs to be freed at the end of the run.
TestGtol.c from the example directory shows how to do it, here is a (modified to print to a console) code snippet from that file:
{
wchar_t* valString = NULL;
if( PRO_TK_NO_ERROR == ProGtolValueStringGet(gtol, &valString)) {
wprintf (L"%ls\n", valString);
ProWstringFree(valString);
}
}
ProGtoValueStringGet(...) for output argument needs a pointer to a pointer to wchar_t. Meaning: the return value would be allocated on-heap and needs to be freed at the end of the run.
TestGtol.c from the example directory shows how to do it, here is a (modified to print to a console) code snippet from that file:
{
wchar_t* valString = NULL;
if( PRO_TK_NO_ERROR == ProGtolValueStringGet(gtol, &valString)) {
wprintf (L"%ls\n", valString);
ProWstringFree(valString);
}
}
I tried that, but I was unable to get the output to go to the console, I do have the settings set so print functions will print to console, however I ended up putting it into a log file instead, thank you for the help.
you should try using 'make_simple_async' makefile as a learn-test 'template'