Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

breakpoint using debugger


Recommended Posts

I am trying to get the debug Mastercam.exe to run with my VS2005 Chook project. I have added in project properties->Command->C:mcamxsdkdebugMastercam.exe, and the Working Directory is C:mcamx.

 

This works fine, it compiles, then I F5 to start debugging, it opens the debugging Mcamx exe, and the welcome screen "X" comes up. Soon after I see the welcome screen, a break point is triggered. I click "Break" on that message, and back in VS2005 "wincore.cpp" is opened. The break is at line 2000. The line is copied here:

 

code:

  

case AfxSig_i_v_s:

lResult = (this->*mmf.pfn_i_s)(reinterpret_cast<LPTSTR>(lParam));

break;

The actual break point is on the middle line in the code above. I first noticed this problem on a project I had been working on. Thinking it was something I did in my chook, I used the new chookwizard with my SDK (yes my SDK is up-to-date and matching my X2 version) and created a blank/empty project. I still got the same exact error. I searched the forum, and changed my "art.ft" to "art.ftt".

 

Any other suggestions???

Link to comment
Share on other sites

Roger.

 

My X2 version is 11.2.3.28 which I think is MR2. The SDK I got from the website, the installer package is labeled "x2-mr2-SDK-web". So things should be matched up?

 

Yeah, I realized the art.ft was something different, just threw that in there to show you I did my search first.

 

Thanks for the offer to email you, but like I said, it is the project generated with the Chook wizard that came with the SDK I mention above and nothing was changed. If it's still useful to email you, I can.

Link to comment
Share on other sites

arenner,

 

We have assumed that it is your CHook that is causing this.

 

Is your CHook even running when this occurs?

You say that this error occurs on startup of the (debug) Mastercam.exe. Unless your CHook has an FT (function table) file in the CHooks folder or you've not yet started your CHook via a command from the running Mastercam session - your Chook code has not even been "loaded" yet, so it's unlikely that it is the cause of the issue.

 

If this is the case, the issue could possibly be happening because of some other CHook on your system that is being loaded via an FT file when you start Mastercam.

You should be able to test this theory by moving all the .FT files out of your CHooks folder and seeing what happens you start Mastercam in debug mode.

 

BTW - AfxSig_i_v_s is involved in MFC Messaging.

Meandering Through the Maze of MFC Message and Command Routing

Link to comment
Share on other sites

Roger. I will send an email with the zipped project. I have not found any information online about what AfxSig_i_v_s does, and I couldn't find any info on it in the link on MFC messaging. Is there some documentation to explain setting up debugging with VS for mastercam chooks?

 

I never thought anything was wrong with the chook, I was just trying to identify why running debug wouldn't work. To make sure of this, I dropped the dll (the same debug build) and the ft into my chooks directory, and pulled up the release X2 exe and was able to put a button on my toolbar, and run the chook wizard's sample app, which simply shows a message box (same code I'm emailing).

 

I also tried removing all other FT files from my chooks dir, however, I get the same problem.

 

Finally, should I or should I not be able to start the debug version of X2 by clicking the icon like I do for my release version? If I try this, I get an error message saying "psbodyshop.dll not found". I'm guessing this is getting closer to the source of my error.

Link to comment
Share on other sites

Arenner,

 

AfxSig_i_v_s is not explicitly mentioned in the article.

But the concept of these AfxSig_??? are alluded to...

 

“The only remaining mystery is the funny-looking AfxSig_xxx symbols. To understand what they're for, stop a moment to consider how CWnd knows which arguments should be passed to your handler function. In AFX_MSGMAP_ENTRY, every function is declared as AFX_PMSG, which is a pointer to a CCmdTarget member function that takes no arguments and returns void.”

 

FYI,

These AfxSig_??? are declared in 

C:Program FilesMicrosoft Visual Studio 8VXatlmfcincludeafxmsg_.h

 

AfxSig_i_v_s, // int (LPTSTR)

 

So this specific symbol is for declaring a member function that take a LPTSTR as it’s argument and returns and INT.

 

Not that any of this information really seems to be of much help! wink.gif

Since you as a MFC programmer never directly mess with this stuff, as it’s used internally by MFC to do it’s magic.

 

***

Check your mail for a very basic DOC about setting up for CHook debugging.

Link to comment
Share on other sites

Thanks. But again, I didn't change a single line character in the chook code. In fact, it isn't even executing the chook, it is in the start up of the debug version of Mastercam. As I mention above, I can't even double click the debug version to get it to run. This seems to be related to my real problem.

Link to comment
Share on other sites

quote:

Finally, should I or should I not be able to start the debug version of X2 by clicking the icon like I do for my release version? If I try this, I get an error message saying "psbodyshop.dll not found". I'm guessing this is getting closer to the source of my error.

When I've seen this, it was caused by an incorrect Start in: path in the shortcut used to startup the debug version of Mastercam.exe

 

Example:

 

Standard install of Mastercam X2-MR2 is installed here-> c:mcamx2-mr2

The CHook SDK is installed here ->c:mcamx2-mr2SDK

 

Create a shortcut with these settings:

Target: C:mcamx2-mr2SDKDebugMastercam.exe

Start in: C:mcamx2-mr2

 

This works for me.

 

If I don't have the correct Start In: path, but have something like this -> C:mcamx2-mr2SDKDebug

This fails with the "...psbodyshop.dll was not found..." error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...