cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Creo starts with blank CMD window when using Creo toolkits

GabrielPaes
5-Regular Member

Creo starts with blank CMD window when using Creo toolkits

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()
{
 
}

 

1 ACCEPTED SOLUTION

Accepted Solutions

You must compile your toolkit application as DLL. Read documentation chapter "How Creo Object TOOLKIT C++ Works"

View solution in original post

2 REPLIES 2

You must compile your toolkit application as DLL. Read documentation chapter "How Creo Object TOOLKIT C++ Works"

You must read the chapter "Registry File" and "C++ LibraryTypes"

Top Tags