Skip to main content
14-Alexandrite
November 21, 2013
Question

Debugging with Visual Studio 2010

  • November 21, 2013
  • 1 reply
  • 3718 views

Hey everyone,

So i'm working with Creo 2 and Visual Studio 2010, and am trying to get my program to debug in an active session (as opposed to compiling the code, unlocking the DLL, and loading it into aux applications everytime ).

I've added my xtop.exe to my project's Debugging commands, (and have made sure to make Attach = Yes), however I seem to still be doing something wrong. IWhen I set break points in my code, even inside of user_initialize(), it returns that "The breakpoint will not currently be hit. No symbols have been loaded for this document." This makes me think that either a) I'm not including some file or setting in Creo that I should be, b) I have a VisualStudio setting that is not set properly, or c) I'm completely off track haha.

Regardless, if anyone has any experience with this, I could definitely use a hand getting it to connect

Thanks,

James


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

1 reply

1-Visitor
November 25, 2013

Hello James,

I didn't work on ProE since several month but I remember I had the same question/problem than you.

It appeared that even if my breakpoints are not loaded it worked as soon as I launched the my application...

I don't know if it helps...

Emilie

8-Gravel
November 29, 2013

Hello!

With Wildfire 4 I do that day for day.

It works fine!

Your application is build with debug informaitons? (Debug configuration?)

Greetings Lars

sully714-AlexandriteAuthor
14-Alexandrite
December 2, 2013

Lars & Emilie,

Yes I believe that I am set up to build into debug configuration. However it doesn't necessarily tell me what is going wrong.

To clarify, I am trying to add a simple 'refit' function to my Toolkit commands, and then add that script to my ribbon. My script compiles without errors... but I really think I'm just doing something simple incorrectly.

#include "stdafx.h"

#define PRO_USE_VAR_ARGS 3

#include <ProToolkit.h>

#include <ProObjects.h>

#include <ProMdl.h>

#include <ProMenu.h>

#include <ProMenubar.h>

#include <ProMessage.h>

#include <ProUICmd.h>

#include <ProUIMessage.h>

#include <ProUtil.h>

#include <ProCore.h>

#include <ProArray.h>

#include <ProTKRunTime.h>

/*----------------------------------------*\

Declare Functions

\*----------------------------------------*/

extern "C" ProError LM_refit()

{

ProError err = PRO_TK_NO_ERROR;

err = ProViewRefit (NULL, NULL);

if(err != PRO_TK_NO_ERROR)

{

printf("error %i.\n",err);

}

else

{

printf("Terminate.\n");

}

return err;

}

/*==========================================================*\

Pro/TOOLKIT Required Functions

\*==========================================================*/

extern "C" int user_initialize()

{

ProError err = PRO_TK_NO_ERROR;

ProMode mode = PRO_MODE_UNUSED;

uiCmdCmdId cmd_id;

err = ProModeCurrentGet(&mode);

if(err == PRO_TK_NO_ERROR)

{

if(mode == PRO_TK_BAD_CONTEXT)

{

printf("ProModeCurrentGet error in user_initialize.\n");

}

}

//MessageBox(NULL, "Pro/Toolkit App", "proe", MB_OK);

err = ProCmdActionAdd("LM_refit",(uiCmdCmdActFn)LM_refit, uiProe2ndImmediate,(uiCmdAccessFn)ACCESS_AVAILABLE,PRO_B_TRUE, PRO_B_TRUE, &cmd_id);

err = ProCmdIconSet(cmd_id,"C:\\data\\Toolkit\\LM_scripts\\text\\resource\\smiley.gif");

err = ProCmdDesignate(cmd_id,"LM_REFIT_TEXT","LM_REFIT_HELP","LM_REFIT_DESCRIPTION",LM_TEXT);

return(0);

}

extern "C" void main(int argc, char *argv[])

{

ProToolkitMain (argc, argv);

return;

}

extern "C" void user_terminate()

{

ProError err = PRO_TK_NO_ERROR;

err = ProViewRefit (NULL, NULL);

}

I can compile this into a DLL, but when I add my "Refit Window" command to the toolbar, the error I recieve simply shuts down Creo, regardless of where I place my breakpoints. This is why I thought maybe I had something set up incorrectly... but it may just be my code?

add_to_ribbon.JPG

xtop_error.JPG

I looked up this error, and it seems to be related to having multiple thread processes... but I didn't think I was using multiple threads because I never did a ProEngineerMultithreadModeEnable()....

Any advice or experience you guys may have would be greatly appreciated!!

Thanks,

James