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:

Disabled Blocking Autocursor


Recommended Posts

Hi there,

 

in my chook I prompt the user to select a point for calculation. I use code like this:

 

CString str = _T("Nullpunkt")
p_3d nullpt;
char pt_option;
MC_BOOL valid_pt;
point_proc (str,&pt_option, nullpt, &valid_pt);

 

In X5 it works fine, the blocking option for autocursor is enabled and I can use it to select for instance an intersection point between two lines. But in X6 the blocking option is not enabled, so I can't use it for pointselection.

 

I use VS 2010pro for coding. Is there an option which I have to set before using the point_proc function to enable the blocking option or should I use a different function to prompt the user to select a point?

 

There must be a solution, because the chook "DrawPock.dll" asks also for a point and then the blocking option is enabled for using.

 

Perhaps somebody can help me to solve it.

 

Thanks in advance

 

Karsten

Link to comment
Share on other sites
  • 2 weeks later...

Hi Roger,

 

sorry for my late response, but I was the last two weeks in france, where I got no internet.

 

With blocking option I mean what you discribed, setting autocursor manually to intersection etc.

My question was on X6 and X6MU1 32bit. I've tested now also on 64bit X6MU1, same problem, when my chook is active, the blocking option is still disabled. You can see it an attached picture. On X5 all is ok.

 

I tried something:

 

My Main-Function looks like this sample:

extern "C" __declspec(dllexport) int m_main (int not_used)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

// for testing
CString str = _T("Nullpunkt");
p_3d nullpt;
char pt_option;
MC_BOOL valid_pt;
point_proc (str,&pt_option, nullpt, &valid_pt);
// end testing

// startfunction
StartMatrix_M();
return MC_NOERROR, MC_UNLOADAPP;
}

 

When I disable this codeline:

AFX_MANAGE_STATE(AfxGetStaticModuleState());

then the autocursor-option is enabled, but than I have a bigger problem, in my startfunction

StartMatrix_M();

I start some mfc-dialogs from CDialog-class, these dialogs are not running anymore, when the line is disabled. That means my chook does not work anymore, nothing happens. I need those dialogs urgently.

 

Do you have any suggestions what I can do to use the autocursor-option?

 

Thanks in advance

 

Karsten

post-13779-0-80762500-1339958980_thumb.jpg

Link to comment
Share on other sites

AFX_MANAGE_STATE(AfxGetStaticModuleState());

Tells me that your CHook, code has not been updated to a MFC extension style DLL.

You do want to do that...

Build a basic CHook using the CHook Wizard supplied with the X6 SDK.

Take a look at the <project_name>.CPP

You will see that it is Extension DLL style code.

Now you can copy in your "working" code, removing all AFX_MANAGE_STATE(AfxGetStaticModuleState()); lines.

 

*If you look at MFC Extension DLL information on the web...

Do NOT add the CDynLinkLibrary command as shown in those examples to your CHook code.

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