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:

What is the difference for C-Hook between Mastercam X and X2


Recommended Posts

I started my C-Hook development with X2. After the X3 was released, I update my program to make it compatible with X3.

 

Today I tried my C-Hook(built with X2 SDK) in Mastercam X MR2. It doesn't work.

 

Anybody can tell me the changes between the X and X2 SDK.

 

Any help will be appreciated.

Link to comment
Share on other sites

I am just guessing here, but it is enough to change a structure, by inserting another member for example. If the new (X2) layout is used to compile your C-hook, you can not make a function call with it into the old (X) Mastercam, because the function will read/write information from the offsets in the structure that do not match the new layout.

 

There are numerous other possible causes, like changing the number of parameters of a function.

Link to comment
Share on other sites

Libraries are not identical between releases. We rebuild, and this means that any change in a header file is going to change call signatures, and functions are not guaranteed to even be in the same place. Also, as markov said, the definition of basic structures and classes (like ent and operation) change between releases, often growing in size as more data is added.

 

You need to rebuild with the SDK for the version you are aiming your chook at.

Link to comment
Share on other sites

Rather than a change in SDK, I believe the real significant change was in the underyling architecture of C-Hooks. Prior to X2, C-Hooks were built as "WinApp" dlls. With X2, they are now built as "Extension" dlls. This added a significant change to the way the C-Hook is accessed within Mastercam. This change was reflected in the C-Hook wizard. So, if you use the wizard as the starting point for your C-Hook, your skeleton code will be built to work with the underlying Mastercam archtecture.

Link to comment
Share on other sites

I compiled the demo project. I run it in the Mastercam X. It can run. But all the resources disappear. For example: all the captions of the buttons disappear. And the buttons can not react the click event. At this time you have to terminate the Mastercam thread.

 

I don't know how to stick a image. Otherwise I can post the picture.

 

Anybody can give me a demo case with the modal dialog?

 

Thanks!

Link to comment
Share on other sites

Mastercam X MR2

 

I've got nothing that old that I know of.

If I do, it's in an archive on one of my external drives, so I'll have to dig around and see what I can find for an example project for that version.

-or-

If you wish, send me a zipped up copy of your CHook project and some screen shots/explanations of what's happening and I may be able to assist.

Send me an email via the email icon on this posting and I'll respond with and email address to can send to with your attachment.

Link to comment
Share on other sites

This is just to clarify on what Mike H. said earlier...

quote:

Prior to X2, C-Hooks were built as "WinApp" dlls. With X2, they are now built as "Extension" dlls. This added a significant change to the way the C-Hook is accessed within Mastercam.

This line should have been ->

 

With X3, they are now built as "Extension" dlls.

Link to comment
Share on other sites

sigmawave,

 

In the Project1 you supplied, looking at the Start.cpp file tells me that this DLL is being built as an MFC "extension" style DLL.

code:

static AFX_EXTENSION_MODULE StartDLL = { NULL, NULL };

I must assume that this Chook project was created using the CHookWizard for version X3.

 

*The use of the "extension" style DLLs came about in Mastercam X3.

For versions of Mastercam prior to X3, your CHook must be a "regular" DLL (one that is derived from CWinApp).

Regular DLLs Dynamically Linked to MFC

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