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:

VS 2010 Pro CHook Debugging


Recommended Posts

I have searched on the forum and it seems that a few users successfully use VS2010 Pro as an IDE for CHooks. For whatever reason, VS2008Pro was unavailable for me and I was supplied with VS2010 Pro instead. Needless to say, this makes things slightly more difficult.

 

I can build release dlls just fine and they will run in X5. However, debugging is not so straight forward.

 

When I run the debug version of Mastercam.exe:

 

Mastercam.exe - Entry Point Not Found
The procedure entry point PK_VERTEX_optimise could not be located in the dynamic link library PSKERNEL.dll

 

This occurs when MasterCam is loading...but before I am able to load my dll. This leads me to believe there is something else going on.

Is it possible to load the debug version outside of visual studio and attach to the process?

 

Any help is greatly appreciated.

Link to comment
Share on other sites

Please note that VS 2010 is not "officially" supported for creating CHooks for X5 (or earlier versions) of Mastercam. That said, 2010 will be the version to use for X6.

 

*Did you remember to kill the ART.FT file in the \Chooks folder when you installed Mastercam?

I always do! ;(

 

When I run the debug version of Mastercam.exe

I assume you mean when you Start Debugging in VS 2010, correct?

 

What are these settings in your Project's Debugging page? ->

 

Command => C:\sdk\X5\debug\Mastercam.exe

Working Directory => C:\Program Files (x86)\mcamx5

 

*Command points to where the Debug Mastercam.exe exists on your system,

which would in a DEBUG folder under wherever you installed the (X5) CHook SDK to.

 

Is it possible to load the debug version outside of visual studio and attach to the process?

Sure can and this can be useful, but whether this will fix you current issue - I doubt it.

 

To attach, just do this...

In your Project's Debugging page toggle the Attach option to 'Yes'

Now before you Start Debugging in VS, you need to have already started the debug version of Mastercam.exe

I just create a desktop shortcut called X5-Debug with these settings ->

Target => C:\sdk\X5\debug\Mastercam.exe

Start in => C:\Program Files (x86)\mcamx5

 

Click on the shortcut to get Mastercam running, then

Debug - Start Debugging (F5) in Visual Studio to get it going and you're off.

 

*Using the "Attach" method can be a time saver, if ->

1> You do not have an FT file in the CHook folder that tells Mastercam about your CHook.

If you do the next tip will have no effect and you will need to rebuild/restart your debug session, you'll have to restart the (debug) Mastercam.exe

2> You add the MC_UNLOADAPP to the final return from your CHook. => return MC_NOERROR | MC_UNLOADAPP;

Now you can (usually) fire off your CHook, run it, go back to your code and make changes, fire off Start Debug (which will of course rebuild your DLL) and you're back debugging without having to wait to restart Mastercam! ;)

Link to comment
Share on other sites

Roger,

 

*Did you remember to kill the ART.FT file in the \Chooks folder when you installed Mastercam?

 

I looked for this file since I remembered it being a problem in X4...However, it does not appear in my mcamx5\chooks directory. Perhaps something is missing..?

 

What are these settings in your Project's Debugging page?

 

Command: C:\Program Files\mcamx5\sdk\debug\Mastercam.exe

 

Working Directory: C:\Program Files\mcamx5

 

I also tried the shortcut method (to load the debug version outside of visual studio)...

 

post-37624-0-61570500-1298983036_thumb.jpg

 

 

But I get the same error:

post-37624-0-71831900-1298983043_thumb.jpg

 

 

It seems that this is an issue that I am having with the debug version of mastercam.exe and nothing related to visual studio. I will try to reinstall MasterCam and the SDK just to see if that will make it happy.

 

Is there any possibility that the SDK did not install properly since it is trying to load the vcprojects / VCWizards into Microsoft Visual Studio 9.0 (which does not exist)?

Link to comment
Share on other sites

You'd be getting a different error if ART.FT was being found by Mastercam.

You said this error occurs when Mastercam (debug) is starting up, before you've even started your CHook, correct?

I almost sounds as if you have a mismatch between your X5 installation and the version of the Mastercam.exe in the debug folder of the CHook SDK.

 

I did a DUMPBIN (from the Visual Studio command window) ->

 

DUMPBIN /EXPORTS C:\Program Files (x86)\mcamx5\PSKernel.dll > c:\temp\dumpbin.txt [enter]

Looked in the resulting dumpbin.txt and this "missing" function does exist in the PSKernel.dll on my system.

 

1046 415 001FC980 PK_VERTEX_optimise

 

What are the Version Details on the PSKernel.dll on your system?

post-1117-0-37884500-1299010047_thumb.jpg

Link to comment
Share on other sites

Roger,

 

Yesterday I uninstalled and then reinstalled X5 as well as the SDK, but have the same error.

 

 

You said this error occurs when Mastercam (debug) is starting up, before you've even started your CHook, correct?

 

Yes, this occurs while the debug Mastercam is just beginning to load (I don't even see the MasterCAM Logo appear)

 

I did a DUMPBIN (from the Visual Studio command window) ->

 

I find this as well: 1046 415 001FC980 PK_VERTEX_optimise

 

The file properties are the same as yours post-37624-0-21597800-1299075281_thumb.jpg

 

 

Here are the file properties from the Mastercam.exe in the debug folderpost-37624-0-36254600-1299075413_thumb.jpg

Link to comment
Share on other sites

Today I searched my computer just to see if there were any conflicting versions of PSKernel.dll... I found one in my C:\WINDOWS\system32 directory and thought it might be overriding the PSKernel.dll located in the MasterCAM directory. To test this theory I:

  1. Renamed the original C:\WINDOWS\System32\PSKernel.dll to PSKernel.bak
  2. Placed the PSKernel.dll from C:\ProgramFiles\mcamx5 in c:\windows\system32
  3. Reran the debug version of MasterCAM using the desktop shortcut I created yesterday
  4. Nothing happened (it crashed immediately without displaying a dialog) so I ran the debug version from within Visual Studio and encountered the following upon load:

 

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\Mastercam.exe', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\opengl32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\glu32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ddraw.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\dciman32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\BackplotD.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCCore.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\UICtrls.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugMFC_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_c94a3a24\mfc90d.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcr90d.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\msimg32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6001.22319_x-ww_f0b4c2df\GdiPlus.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCCE.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcp90d.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCControl.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCMachineDef.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCGeomSld.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\psbodyshop.dll', Binary was not built with debug information.

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\PSKernel.dll', Binary was not built with debug information.

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\msvcr90.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_d889290f\msvcp90.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCMill.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\MCExcel.dll', Binary was not built with debug information.

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCLathe.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCRtClasses.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCMatss.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCIk.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCPost.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCWire.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCVerify.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCMSurf.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCMultiax.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCKernel.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\McHmm.dll', Binary was not built with debug information.

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\ZLib.dll', Binary was not built with debug information.

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\stlport.5.2.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_a96f9c14\mfc90u.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCRouter.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCPrvVerFile.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\mcamx5\sdk\debug\MCUI5Ax.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\psapi.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\ddefix.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\Sophos\Sophos Anti-Virus\sophos_detoured.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFCLOC_1fc8b3b9a1e18e3b_9.0.30729.4974_x-ww_19f00fd4\mfc90enu.dll', Binary was not built with debug information.

UICtrls.DLL Initializing!

Mastercam HMM v9.1.000

First-chance exception at 0x01aa0194 in Mastercam.exe: 0xC0000005: Access violation reading location 0x000000c0.

First-chance exception at 0x7c9673be in Mastercam.exe: 0xC0000005: Access violation.

Unhandled exception at 0x7c9673be in Mastercam.exe: 0xC0000005: Access violation.

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\DgApi.dll', No symbols loaded.

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\mpr.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\userenv.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\Program Files\DGAgent\plugins\09D849B6-32D3-4a40-85EE-6B84BA29E35B\AE_MailSensor_Plugin.dll', No symbols loaded.

'Mastercam.exe': Loaded 'C:\Program Files\DGAgent\plugins\09D849B6-32D3-4a40-85EE-6B84BA29E35B\AME_SmtpSensor.dll', No symbols loaded.

'Mastercam.exe': Loaded 'C:\Program Files\DGAgent\plugins\09D849B6-32D3-4a40-85EE-6B84BA29E35B\AME_OutlookSensor.dll', No symbols loaded.

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\wininet.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', Cannot find or open the PDB file

'Mastercam.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', Cannot find or open the PDB file

First-chance exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

Unhandled exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

First-chance exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

Unhandled exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

First-chance exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

Unhandled exception at 0x7864e202 in Mastercam.exe: 0xC0000005: Access violation reading location 0xfffffff0.

The program '[1676] Mastercam.exe: Native' has exited with code 0 (0x0).

 

 

I also ran DUMPBIN on the original C:\WINDOWS\system32\PSKernel.dll and PK_VERTEX_optimise does not exist in that version of the dll.

 

It appears that now there is a new problem associated with loading the debug version of MasterCam

Link to comment
Share on other sites

I would suggest getting a fresh copy of the X5 SDK that you know "matches" the version of Mastercam X5 you're running. I had developers in the past tell me that they are running the X5 SDK when in fact that had a Beta version of an SDK.

MisMatch == mystery headaches! :o

 

Placed the PSKernel.dll from C:\Program Files\mcamx5 in c:\windows\system32

I'd suggest that you don't start copying/moving files around, as that usually just makes the situation worse. ;(

 

-----------------------------

 

The "Cannot find or open the PDB file" messages are nothing unusual.

 

Everything looks as expected right up through these lines ->

 

UICtrls.DLL Initializing!

Mastercam HMM v9.1.000

 

-*-Now things start going weird-*-

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...