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:

X2 crashes after storing note from Net Hook


Recommended Posts

The following code to store a note works fine in X SP2 but X2 crashes shortly after the routine is exited

 

code:

{

ent entity;

int len;

int lev;

char txt[256];

char *cptr;

ulong mtid;

DB_LIST_ENT_PTR ptr;

attributes new_attrib;

MC_BOOL succf;

 

lev = 3987;

strcpy(txt, "Test Note");

len = strlen(txt) + 1;

 

InitNOTE(&entity);

 

cptr = (char *) mTableAlloc(len, &mtid); /* allocate table item */

entity.u.n.mtid = mtid; /* assign memory table */

strcpy(cptr, txt); /* copy string */

 

/* Create new note */

new_attrib.width = 0;

new_attrib.style = 0;

new_attrib.pen = 0;

new_attrib.pstyle = 0;

new_attrib.filler = 0;

 

store_ent (&entity, &ptr, 0, 0, lev, new_attrib, &succf);

}

A message window pops up with the error

 

"Mastercam X2 has encountered a problem and needs to close"

 

The Net Hook is written in C# and it calls this routine in a dll written in C. It was compiled in X and is being run under X2.

 

Any help greatly appreciated.

Link to comment
Share on other sites

Thanks for the response, Roger.

 

By "compiled in X" I meant linked using the libraries from the X SDK. Do I need to download and use the X2 SDK? If it it linked with the X2 libraries will it run under X? Also, I am using VS2003. Do I need to use VS2005?

 

Thanks again for the help

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

I am back working on this problem. I am now using the MasterCAM X2 SDK and VS 2005. MasterCAM no longer crashes when the store_note function is called but the note does not get stored. This code works fine in MasterCAM X using VS 2003. Any suggestions greatly appreciated.

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