Hello Guest it is November 20, 2019, 02:24:11 AM

Author Topic: Mach3 Plugin Tutorial Document and Prototype File Set  (Read 107701 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #80 on: March 21, 2009, 10:36:07 AM »
Hi Tom, here is the Microsoft HTMLHELP workshop download page:

http://www.microsoft.com/downloads/details.aspx?familyid=00535334-c8a6-452f-9aa0-d597d16580cc&displaylang=en

I am using a tool called HelpSmith, but it is not necessary, just a convenience.

Tooltips:

http://support.microsoft.com/kb/141758

http://www.codeguru.com/forum/showthread.php?t=413739

http://www.codeproject.com/KB/dialog/tooltips.aspx

Have fun!  I look forward to seeing what you have created.

-James

Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #81 on: April 03, 2009, 05:42:58 PM »
Hello,

I am having trouble with myCleanup(). It does not get executed if the plugin is disabled. This presents me with the problem  of how to cleanup after a plugin has been used and it is disabled just before shutting down Mach3.

I searched around and found some discussion about using myNotify(int msg) to cleanup. One discussion in particular looks for msg=0x12000e (or something like that). When I shutdown Mach3 I get msg=14 so am inclined to use that value to initiate cleanup.

What method do you recommend for cleanup when myCleanup() does not execute?

Tom Hubin
thubin@earthlink.net
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #82 on: April 03, 2009, 06:41:20 PM »
Yes, I use the shutdown notification which SHOULD be 0x12000e to circumvent this issue.  I hope Brian / Art didn't change this.  It was undocumented though...

-James
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #83 on: April 04, 2009, 01:36:59 AM »
Yes, I use the shutdown notification which SHOULD be 0x12000e to circumvent this issue.  I hope Brian / Art didn't change this.  It was undocumented though...

-James


Hello James,

I am using Mach3 demo version 3.039. The only messages going to myNotify(int msg) are values of 7 and 14 (0x000e). I am testing for 14 then calling myCleanUp() to shut down the plugin modeless dialog box.

void myNotify ( int msg )
{
    DbgMsg(("CustomPluginImpl myNotify entry"));

    char tmp[81] ;
    sprintf ( tmp, "msg=%i", msg ) ;
    DbgMsg((tmp));

    if ( msg == 14 )
    {
        DbgMsg(("Destroy Scan3d dialog box here"));
        myCleanUp() ;
    }

    DbgMsg(("CustomPluginImpl myNotify exit"));
}

Frankly, I don't see how you can use 0x12000e since that is a 24 bit number. How can you ever get that as a 16 bit int value coming in to myNotify(int msg)?

Tom Hubin
thubin@earthlink.net
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #84 on: April 04, 2009, 01:55:58 AM »
Hello,

My plugin (http://www.machsupport.com/forum/index.php/topic,10958.0.html) uses a wide modeless dialog box which is sometimes being clipped on the right end.

If the screen horizontal resolution is less than about 1000 pixels the dialog box does not fit on the screen. In that case the right end is cropped at the right edge of the screen. Dragging the dialog box to the left does not expose the right end of the dialog box. Resizing can make the dialog box smaller but not larger.

How can I get the right end of my wide modeless dialog box to display on a low resolution screen?

Tom Hubin
thubin@earthlink.net

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #85 on: April 04, 2009, 11:03:01 AM »
Did you or James find the "Message" or whatever to cleanly close the Modeless dialog window if the user Un-Checks the Enable plugin prior to closing mach3?

Also, where are you finding these Message numbers, is there a list in MFC or windows that shows that if you call 14 or 7 or whatever then that is a command to close modeless windows or something?

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #86 on: April 04, 2009, 11:35:12 AM »
Yes, I use the shutdown notification which SHOULD be 0x12000e to circumvent this issue.  I hope Brian / Art didn't change this.  It was undocumented though...

-James


Hello James,

I am using Mach3 demo version 3.039. The only messages going to myNotify(int msg) are values of 7 and 14 (0x000e). I am testing for 14 then calling myCleanUp() to shut down the plugin modeless dialog box.

void myNotify ( int msg )
{
    DbgMsg(("CustomPluginImpl myNotify entry"));

    char tmp[81] ;
    sprintf ( tmp, "msg=%i", msg ) ;
    DbgMsg((tmp));

    if ( msg == 14 )
    {
        DbgMsg(("Destroy Scan3d dialog box here"));
        myCleanUp() ;
    }

    DbgMsg(("CustomPluginImpl myNotify exit"));
}

Frankly, I don't see how you can use 0x12000e since that is a 24 bit number. How can you ever get that as a 16 bit int value coming in to myNotify(int msg)?

Tom Hubin
thubin@earthlink.net

Tom, use %d not %i in the sprintf - int is 32 bits, short int is 16 bits.  Also if you use %x you will see the hex value.

-James

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #87 on: April 04, 2009, 03:00:58 PM »
Well Spoke with Brian today.

  Here is the deal:  I had asked if he knew of a "Message" or "ID" that we could get that if a user changed the Green Check to a Red X under the plugin config that we could grab that message notification and use it to shut down our Modless window dialogs.

He said at this time there is no message in Mach3 for us to use.

BUT!!!  He said in version 4.0 he will add a Message for that so we can close our modless dialogs under the above user choices.!!!!

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #88 on: April 04, 2009, 03:26:26 PM »
Well Spoke with Brian today.

  Here is the deal:  I had asked if he knew of a "Message" or "ID" that we could get that if a user changed the Green Check to a Red X under the plugin config that we could grab that message notification and use it to shut down our Modless window dialogs.

He said at this time there is no message in Mach3 for us to use.

BUT!!!  He said in version 4.0 he will add a Message for that so we can close our modless dialogs under the above user choices.!!!!

scott

Hello Scott,

Personally, I would rather see myCleanUp() called whenever Mach3 shuts down. As I understand it, that is the purpose of myCleanUp().

In the meantime, there may not be a reliable way to do this since James gets 0x12000e and I get 0xe when Mach3 shuts down. Here is my latest version of myNotify that shows the sizeof(msg) to be 4 bytes, as James suggested, and the value I receive as 0x0e or decimal 14.

I wonder what these values are supposed to mean? I wonder if there is a different bit for each plugin?

void myNotify ( int msg )
{
    DbgMsg(("CustomPluginImpl myNotify entry"));

    char tmp[81] ;
    sprintf ( tmp, "sizeof(msg)=%i    msg=0x%x", sizeof(msg), msg ) ;
    DbgMsg((tmp));

    if ( msg == 0xe )
    {
        DbgMsg(("Destroy Scan3d dialog box here"));
        myCleanUp() ;
    }

    DbgMsg(("CustomPluginImpl myNotify exit"));
}   

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Mach3 Plugin Tutorial Document and Prototype File Set
« Reply #89 on: April 05, 2009, 12:11:39 PM »
I suspect it must vary or something, I tried your code in mine, by calling the cleanup from my notivy, and it crashed mach....

so, back to the drawing board..........

scott
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/