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:

Chook - Dialog Box Manager Sample


Recommended Posts

I am trying to run the sample from the Chook SDK on chapter 22 page 19-24.

 

I had copy the scr file, create the sample.c file and also the sample.txt file.

 

I am running Win2000, MC 9.1 SP2, MS-VC 6.0.

 

When I execute the sample.dll chook, I got two errors:

 

a) DBM Alert: Invalid control type

B) DBM Alert: Internal fatal error... cannot run dialog.

 

The SDK scr file says it's a Version 7.0 scrversion. Do I need to change anything in the script file?

Did anybody try this sample dialog before?

What did I do wrong here?

 

Please help. Thanks

Link to comment
Share on other sites

Bryan,

 

I can compile the shapes example but I couldn't execute it in MasterCAM.

 

It always said program entry not found no matter what I change in my settings.

 

I am using VC++ 6.0. Can you show me what you did?

 

I can write program in plain C without any MFC linking. When I have my file in .cpp, I cannot make it work. Which is the reason I wanna try the dbm from the chook library.

 

also, sometime MC will say incompatible script version when execute the chook w/dbm. Anybody knows what should be done?

 

Thanks

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I've wanted to create a dialog box for one of my C-Hooks but can't ever seem to get it. Is there a sample I'm missing in the SDK? MFC, DBM, etc... don't really care which, just want to learn it.

Link to comment
Share on other sites

James,

There's a sample from the Chook SDK on chapter 22 page 19-24 that shows you how to create a chook dialog without any MFC. However, I haven't make it to work. Hope you get a better luck than me.

 

You can always create your own C++ dialog in MFC too. The first chapter of the SDK shows a pretty good example. Again, I am just not smart enough to make it work.

 

Please let me know if you can make both sample work.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

quote:

...I am just not smart enough to make it work...

I'm in that boat right now so I guess I'm in good company. wink.gifbiggrin.giftongue.gif

 

Guess I'll just have to keep trying, then again, I've put less than a half-hearted effort into it so what should I expect? rolleyes.gif

 

 

James teh coder wannabe biggrin.gif

Link to comment
Share on other sites

Bryan,

 

quote:

I just used them to start a new mfc/c++/chook project and they worked fine.

Did you change anything to make it work?

 

I did exactly what Bulliness said and I still get that anoying Fatal Error: Program Entry Not found error.

 

The only thing that I change is commented out the #UNDEF export line. If I have those lines, I will have three compiler errors.

 

Please help. Thanks

Link to comment
Share on other sites

program entry not found sounds like your missing the

code:

 extern "C" void CH_ENTRY m_main (long *ptrs)

{

if (open_app (ptrs))

if (product_level_1_or_design_enabled())

{

AFX_MANAGE_STATE(AfxGetStaticModuleState());

/* put your function here */

your_function();

}

close_app (ptrs);

}

Sounds like MC is looking for the m_main and can't find it.

 

Bryan smile.gif

Link to comment
Share on other sites

code:

  

extern "C" void CH_ENTRY m_main (long *ptrs)

{

if (open_app (ptrs)) // open interface to Mastercam

{

// Enable use of the MFC dynamically linked libraries

AFX_MANAGE_STATE(AfxGetStaticModuleState());

 

// call our main function

main_whatever();

}

close_app (ptrs); // close interface to Mastercam

}

I do have these lines of code and it still gimme the same error message.

 

Any clue? Thanks

Link to comment
Share on other sites

I got the following message when I compile my program.

 

--------------------Configuration: whatever - Win32 Release--------------------

Compiling resources...

Compiling...

StdAfx.cpp

Compiling...

whatever.cpp

WhateverDlg.cpp

Generating Code...

Linking...

Creating library Release/whatever.lib and object Release/whatever.exp

 

whatever.dll - 0 error(s), 0 warning(s)

 

Am I suppose to see some kind of message indicating that the two critical object file have been link to the project?

 

How can I be sure that those two files have been compiled?

 

Do I need to change any setting in the link tab of the project setting?

 

Please help. Thanks

Link to comment
Share on other sites

quote:

Am I suppose to see some kind of message indicating that the two critical object file have been link to the project?

 

How can I be sure that those two files have been compiled?

 

Do I need to change any setting in the link tab of the project setting?


During compilation/linking, you won't see that the DLL is linked to the OBJ files. As long as the OBJ files are part of the project, you'll be fine:

 

obj_chook.jpg

Link to comment
Share on other sites
  • 1 year later...

OK thanks, but it seems like the samples have not been included in the new chm file. Maybe the Chdocs9 would be useful to me. Unfortunately I don't have SDK version 9. I tried www.mastercamextranet.com and www.mastercam.com, but couldn't find it.

 

Therefore, would someone please give me advice, where I could find SDK 9 or upload it to ftp.mastercam.com?

Link to comment
Share on other sites
  • 2 weeks 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...