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:

C-hook and NET-hook Developer's Guide


Recommended Posts

Hi. All.

 

A forever newbie with some programming experience, C/C++ (mostly console mode on old unix machine)

and Visual Basic/C# .NET.

Tried to learn C-hook several years ago, but didn't make it.

Come back once again.

 

I have two questions.

 

(1) C-hook Developer's Guide

Are there any updated version of C-hook and NET hook Developer's Guide?

The one I'm using, .pdf format, is dated 09/20/06.

Asked our Mastercam reseller, but no luck so far.

 

(2) Compiling error

Currently, I'm using Mastercam X4 mu3 and corresponding sdk installed.

As for programming, using Visual Studio 2008 Standard. Just installed it yesterday.

 

What I'm doing is making a very simple program, the very first one, "Hello from Mastercam!",

from aforementioned C-hook Developer's Guide.

 

Error message: .\Chooksample.cpp(103) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from

'const char [22]' to 'LPCWSTR'

 

I think I followed instructions, but I might have done something wrong or simple missed something.

Any pieces of advice will be appreciated.

Thank you.

Link to comment
Share on other sites

No, the CHook Dev Guide has not been updated in a long time.

 

Did you create your sample CHook using the CHook Wizard?

That is the definitely the best way to start off getting a good base project to add your code into!

 

Error message: .\Chooksample.cpp(103) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from

'const char [22]' to 'LPCWSTR'

It sounds like you have the 'Character Set' (CHook Project Properties, Configuration Properties, General page)

set to "Use Unicode Character Set". Should be -> "Use Multi-Byte Character Set"

 

If so this will not work ->

 

MessageBox(0, "Hello from Mastercam!", 
           "Sample C-Hook", MB_OK);

 

BTW, for Unicode you'd need to tell the Compiler ->

   MessageBox(0, L"Hello from Mastercam!", 
              L"Sample C-Hook", MB_OK);

The L prefix makes the string a wchar_t string.

Link to comment
Share on other sites
  • 11 months later...

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