Hello Guest it is March 29, 2024, 05:34:37 AM

Author Topic: Plugin development in VS2005, VS2008  (Read 19597 times)

0 Members and 1 Guest are viewing this topic.

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Plugin development in VS2005, VS2008
« Reply #20 on: February 05, 2009, 08:12:41 PM »
thx Ed:

 Ill order that book, time I had an upgrade anyway. :)

Art
Re: Plugin development in VS2005, VS2008
« Reply #21 on: February 06, 2009, 04:59:10 AM »
Great, I'm happy to hear about that.

At the moment I'm using Visual Studio 2005 for any project but Mach3. It will be fine to have one VS-Installation only.

Here I've got 3 Plugins uner development which i can transfer to VS2005 to check for function.

Steffen

Offline j1sys

*
  •  16 16
    • View Profile
Re: Plugin development in VS2005, VS2008
« Reply #22 on: February 25, 2009, 07:23:01 PM »
For All -

Lastest update: I've worked almost exclusively on this project for the last ten days and I think I see the light at the end of the tunnel. I just hope it is not a train coming.

I have developed an .msi installer that will install a new Application Wizard called MachPluginWizard on either a Visual Studio C++ 2008 Standard or Visual Studio 2008 C++ Express installation. After installing MachPluginWizard a developer can create a new project with just a few clicks. MachPluginWizard includes the options of selecting the Win32, ATL, MFC, or .NET configuration and creates source code files tailored to the option selected. The ATL and MFC options are greyed out if MachPluginWizard detects that it is running inside of VS 2008 Express. It also selects all needed parameters in the VC project file. Optionally it can include standard code for a simple configuration dialog, Plugin Config menu items installation using exclusively Win32 calls, my new XMLProfile class for .NET, and the Post-Build event to copy the .dll to the C:\Mach3\Plugins directory. MachPluginWizard takes care of all textual edits needed to personalize the code to a plugin name that matches the project name.

The installer also installs my modified .h files in a subdirectory and MachPluginWizard sets the project to search that additional directory.

As I demonstrated to Scott last night, you can click on MachPluginWizard, name the project, accept the defaults, let it create the project, build the project, and then go to mach and see a new plugin raring to go!!

I've probably got another week of testing and tweaking all of the options for all of the environments before I can release it to my beta testers. Then I will work up some quick AVI tutorials on it's installation and operation.

As of now I believe I will not support VS 2005. I believe with all my work to support VS 2008 Express and .NET that anyone can use those tools for free and don't have to buy VS 2008 Standard or better unless they feel they have to use MFC to develop their plugins. The wizards and features I use may not be compatible with VS 2005 and I don't want to add another level of complexity to my plate.

----------------------------------

For Art/Brian -

In the mixed mode .Net version I developed a replacement to XMLProfile that uses .Net XML. Empirically I've tested it with my Mach3 and don't see any problems but want to run a few questions by you:

1) Do you see any problems with using an indented option on the XML file? I've tried it and it seem nots to mess up Mach3. Since you appear to be using the MSXML COM object and it will accept indented I think I'll be OK. It just makes it so much easier to look at.

2) Do you see any problems with plugins written in the new development environment doing the following when it is valid for them to work with XML file:

2a) Create a DOM object
2b) load the XML from the file
2c) interrogate and/or modify the DOM
2d) save the XML to the file (if needed)

3) So far it appears to work. I'm just not sure how this will interact with your handling of the XML file. I don't want to lose any of your changes and/or have you overwrite any of mine. Do you see any problems?

4) I've also added the option to allow plugin writers to create a simple tree structure within their section. They just have to enable it when they constuct the XMLProfile object and then they can use entry names like 'Dlg1/Int1', 'Dlg2/Txt2'. Again, empirically, it appears to not make any problems for Mach3 since the MSXML still loads and saves the file fine. Do you concur?

--------------------

For ALL -

Attached is a screenshot of the Mach3Mill.xml file in the Visual Studio editor with all of mach's sections collapsed and showing the new XML section of a plugin named XMLTest.

-Ed

Offline ART

*
  • *
  •  1,702 1,702
  • Tough as soggy paper.
    • View Profile
Re: Plugin development in VS2005, VS2008
« Reply #23 on: February 25, 2009, 08:44:36 PM »
Hi ED:

 Sounds like your almost there. :) , lets seee...


>>In the mixed mode .Net version I developed a replacement to XMLProfile that uses .Net XML. Empirically I've tested it with my Mach3 and don't see any problems but want to run a few questions by you:
1) Do you see any problems with using an indented option on the XML file? I've tried it and it seem nots to mess up Mach3. Since you appear to be using the MSXML COM object and it will accept indented I think I'll be OK. It just makes it so much easier to look at.

  Id have to see how ( or more likely when) your using it to be sure, but no, I dont think its an issue. The XML I use in Mach3 was a class object I got from somewhere, and modified a bit to work in Mach3. BUT, it has some inherent issues. For example, when used in the main timing loop, items get lost. This has somethign to do with the state of the context at time of call, but Ive never tracked it down, (Im more a master of the workaround :) ), so what I did was to temporarliy close the XML before notifying the plugin that its OK to save or get information from it. The plugin actually has its own opened XML, and MAch3 is not sharing it at all, when the plugin returns from that call, the xml is reopened by Mach3. So in your context , I suspect your fine no matter what, since Mach3 will usually not need any data in the xml, even it it doesnt understand the added entries, as long as the plugin does, no issues exists. 


>>>2) Do you see any problems with plugins written in the new development environment doing the following when it is valid for them to work with XML file:
2a) Create a DOM object

  No, again Mach3 will not try to read or use the DOM in any way, so as long as the plugin can, it shouldnt matter if it exists in the xml. Id only worry that MAch may, at some point, see the
additional entries as a corruption and skip other tags, but Ive never seen that happen, at worst it woudl simply skip over the entries till it find what its looking for.

>>2b) load the XML from the file
 
  No, again its closed whenever the Plugin has been told it can be used. So when the plugin opens it, its totally owned by the plugin for that brief period of time. :)

>>2c) interrogate and/or modify the DOM
>>2d) save the XML to the file (if needed)

 Nope, same as above, as long as the file is valid on close, it shoudl be fine when Mach reopens it.

>>3) So far it appears to work. I'm just not sure how this will interact with your handling of the XML file. I don't want to lose any of your changes and/or have you overwrite any of mine. Do you see any problems?

  I think your safe, I use the XML as a simple tagged entry list, nothing nfancy at all, I could have as easily just made it a text file and written my own parser for the data, but xml looked easier. ( I can tell by your questions your by far the expert on xml matters, :)

>>4) I've also added the option to allow plugin writers to create a simple tree structure within their section. They just have to enable it when they constuct the XMLProfile object and then they can use entry names like 'Dlg1/Int1', 'Dlg2/Txt2'. Again, empirically, it appears to not make any problems for Mach3 since the MSXML still loads and saves the file fine. Do you concur?

  Yup, totally, in fact I think its a brilliant solution, it makes the xml an extendable file that can be upgraded massively in future to contain much more usefull data , kinda like a hive of its own for Mach3, sounds to me like youve done real well.

  Ive been real deep in the code so I havent been watching close, but Brett will let me know when youve posted this, I promise Ill stop and test it out, then post anything I see that may cause some concern in future, I use VS2008 exclusively now in my own projects so it'll be an interesting test. :) ,

Thanks again for all your doing, from my simple plugin solution ( as you know I never planned for one, just kinda added it one weekend when it occured to me) , your creating a much more usefull and extendable solution.. Im impressed.

Thx
Art


Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Plugin development in VS2005, VS2008
« Reply #24 on: February 25, 2009, 11:36:07 PM »
I tell you this, having got to see it in action, it is SO much easier to do Dialogs and stuff!!!  Proffessor ED will be going over his Plugin solution as a 3 hour class at the mach con 2.

scott
fun times