Hello,
I have a problem using Creo Toolkits, that is because of the .exe file executed from the toolkit keeps oppening a Windows blank CMD window and whenever I close it, Creo just crashes. I don't know if this is because something on my code though.
Is there a way to hide this CMD windos from oppening?
My code:
#include <wfcSession.h>
#include <pfcGlobal.h>
#include <ProMdl.h>
#include <ProSolid.h>
#include <ProDrawing.h>
class OTKTestCallBack : public virtual pfcUICommandActionListener
{
public:
void OnCommand();
};
/* Entry */
extern "C" int user_initialize(void)
{
pfcSession_ptr Session = pfcGetProESession();
wfcWSession_ptr wSession = wfcWSession::cast(Session);
wSession->RibbonDefinitionfileLoad("format_drawing.rbn");
pfcUICommand_ptr InputCommand1 = wSession->UICreateCommand("FORMAT_DRAWING", new OTKTestCallBack());
InputCommand1->Designate("msg_user.txt", "Formatar Desenho", "Formatar Desenho", "Formatar Desenho");
return (wfcTK_NO_ERROR);
}
void OTKTestCallBack::OnCommand()
{
ProError status;
ProDrawing drw;
ProSolid solid;
int sheet = 0;
status = ProMdlCurrentGet((ProMdl*)&drw);
status = ProDrawingCurrentsolidGet(drw, &solid);
status = ProDrawingCurrentSheetGet(drw, &sheet);
status = ProDrawingScaleSet(drw, solid, sheet, 1.0);
status = ProDrawingSheetFormatHide(drw, sheet);
status = ProDwgSheetRegenerate(drw, sheet);
}
/* Exit*/
extern "C" void user_terminate()
{
}