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:

Recommended Posts

Hi guys,

 

I have built a custom DLL which is referencing the new NetHook API.

 

My own dll as well as the nethook2_0.dll are both installed under the directory McamX2chooks.

 

I did noticed that my dll is always using the NetHook API existing under McamX2 directory and not the one that I have deployed in the same directory as the application.

 

Is there something I am missing here ?

 

Thanks in advance !

 

--Titus

Link to comment
Share on other sites

Hi Mick,

 

Sorry, in my previous message there was a typo in the directory name. It should have read McamX2chooksmy_application.

 

As to why I am placing another nethook API in my own directory when there is already one in McamX2, that's a good question...

 

Well, because I want to ensure my clients are using an up-to-date API and to avoid conflicts with the external context. For example, the NetHook2_0.dll I have in my McamX2, dated Sep. 2006, does not contain the IsOperation() method. The version that I am deploying, dated Dec. 2006, does contain it.

 

My question is why does my DLL always use the Nethook API which exists under McamX2 rather than using my version ?!

 

Thanks a lot !

 

--Titus

Link to comment
Share on other sites

Titus,

 

Managing versions is tough, and I feel your pain. But I'm afraid the NetHook API doesn't quite work like that. See, each build of the NetHook API is tied to a specific release of Mastercam. The December 2006 build of the NH API is the X2 SP1 build, which will only work properly with Mastercam X2 SP1. The September 2006 build is probably the right date for Mastercam X2. The changes in the API you cited would seem to echo that.

 

What that means is you're not going to be able to ship an updated version of the API with your app. You're either going to have to not use aspects of the API that are specific to, say, X2 SP1 and beyond, or you're going to have to tell all of your users that your app will only run with Mastercam X2 SP1 or later installed. (The API's are always backwards compatible between major versions - so if you build an app for X2 SP1, you're guaranteed it will work for X2 MR1, X2 MR2, etc.)

 

Good rule of thumb? You'll generally want to set up your build environment to use whatever API is in the Mastercam directory you'll be testing with. That way you never need to worry about the problem you're having.

 

Also, it sounds like your Mastercam installation doesn't have the X2 Service Pack 1 installed - you should go out and get it!! smile.gif

 

 

Let me know if you need any more help,

Link to comment
Share on other sites

Oh! Thanks a lot guys !! Now I understand better how the versioning works...

 

I'd have another concern about the deployment of my DLLs. One of my CHooks is calling a .NET library through an unmanaged wrapper. I am able to make everything works only if the wrapper and the .NET library are both placed in McamX2 folder.

 

Should I use manifest or configuration files in order to load an assembly elsewhere than McamX2 ?

 

Thanks !!

 

--Titus

Link to comment
Share on other sites

Titus,

 

I think the question comes down to what you're trying to do. Obviously now we're more in the realm of CHooks than NetHooks, but I think I can probably swing that too. smile.gif

 

Could you be a little more specific? Are you having trouble getting Mastercam to launch your CHook wrapper from a different directory? Or are you having trouble getting your CHook wrapper to load the .NET library from a different directory? Either way we should be able to help you out.

 

Let me know,

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