Skip to main content
4-Participant
January 21, 2025
Question

ProInputFileRead crashes creo

  • January 21, 2025
  • 1 reply
  • 801 views

I am trying to do a cable parameters export and then import the file back. Even though I try to import the exact same file back, the ProInputFileRead-call crashes Creo without error code. The whole of Creo just dies with a fatal error popup. 

 

I have tried to import the same file manually in the Cable Parameters window using and that works fine.

 

ProError fileExportStatus = ProOutputFileMdlnameWrite(mdl, L"cable.cbl", PRO_CABLE_PARAMS_FILE, globalHarness, (ProAppData)wideString_c, NULL, NULL);


ProError fileImportStatus = ProInputFileRead(mdl, L"cable.cbl", PRO_CABLE_PARAMS_FILE, globalHarness, (ProAppData)wideString_c, NULL, NULL);

1 reply

RPN
18-Opal
January 21, 2025

extern ProError ProInputFileRead ( ProMdl model,
ProPath filename,
ProImportExportFile file_type,
ProAppData arg1,
ProAppData arg2,
ProAppData arg3,
ProAppData arg4 );
/


If <i>file_type</i> is PRO_CABLE_PARAMS_FILE, <i>arg1</i> is
the <i>ProSolid</i> (part pointer).

If <i>file_type</i> is PRO_CABLE_PARAMS_FILE, <i>arg2</i> is
a <i>wchar_t*</i> to the cable name.

It is odd not to see how you declare your input. 

globalHarness, (ProAppData)wideString_c


Do you check the status?

PRO_NAME size? Or init [0] with ‚\0‘

&globalHarness

Same Name valid?

 

4-Participant
January 22, 2025

It seems to me that ProOutputFileMdlWrite and ProInputFileRead has the exact same arguments. Since the Write-call succeeds with status PRO_TK_NO_ERROR, I figured that my harness pointer and cable name wide string is ok.

 

For the ProInputFileRead, I get no response since Creo terminates with fatal error and everything just stops. 

 

/Sebastian

RPN
18-Opal
January 22, 2025

Did you check if PTC expect a Byte Order Mark.