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:

Masercam keeps Chook fileHandle open


Recommended Posts

Hi,

Has anyone noticed that Mr1 keeps the filehandle of the last run chook .dll open? That means if you are working on a Chook you have to quit Mastercam and restart every time you want to overwrite the .dll with the newly compiled version. I tried with the shipped Chooks, running one and leaving Mastercam running and then trying to delete/overwrite the chook I had just run and it was stil "open" even though Mastercam was now doing other stuff. If anyone can suggest what I am undoubtedly missing here I would be most grateful.

Thanks, Nick

Link to comment
Share on other sites

You can try the setting the return value from your C-Hook’s m_main function.

 

extern "C" __declspec(dllexport) int m_main (int param)

{

AFX_MANAGE_STATE(AfxGetStaticModuleState());

 

RunApp();

return (MC_NOERROR | MC_UNLOADAPP);

}

 

 

Return values are defined in cgui_ch.h ---

 

code:

enum MC_RETURN { 

MC_NOERROR, /// Executed normally

MC_ESCAPE, /// Escape key hit

MC_EXITFUNC, /// Exit current task requested (from outside current task)

MC_ERROR, /// General error code

MC_UNLOADAPP = 0x80000000 }; /// Unload Application on return (you may OR this with other return types)

Note that if the C-Hook is referenced in an FT (Function Table) file (which makes it available for mapping to a toolbar and/or keystroke), the MC_UNLOADAPP will have no affect. X loads all the DLLs in the FT files on startup and holds on to them until you shutdown X.

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