Hello Guest it is April 26, 2024, 02:32:03 AM

Author Topic: Automating Mach from external software  (Read 18767 times)

0 Members and 1 Guest are viewing this topic.

Re: Automating Mach from external software
« Reply #10 on: February 16, 2008, 03:15:53 PM »
You are welcome.  Since I run as a plugin I am not concerned with Mach3 lifetime control.

I'm glad you were able to get this running.

-James
Re: Automating Mach from external software
« Reply #11 on: March 02, 2008, 12:37:20 AM »
Hi Guys,
I am working on remoting mach from C# as well.  I have got most things working, but I am tearing my hair out with a problem.  Brian added into Mach3 the .GetMessage call (to display the status label data), this returns a BSTR, now that is well and good in C++ but it is killing me with C#.  Do you guys know of a way of accessing a BSTR in C#???
Thanks
Andrew
Re: Automating Mach from external software
« Reply #12 on: March 02, 2008, 11:17:43 AM »
Hi Guys,
I am working on remoting mach from C# as well. I have got most things working, but I am tearing my hair out with a problem. Brian added into Mach3 the .GetMessage call (to display the status label data), this returns a BSTR, now that is well and good in C++ but it is killing me with C#. Do you guys know of a way of accessing a BSTR in C#???
Thanks
Andrew

Hi,

I really don't know .NET at all, but I believe that you need to write a COM Interop for the Mach object model
Re: Automating Mach from external software
« Reply #13 on: March 04, 2008, 10:30:52 AM »
I am working on remoting mach from C# as well.  I have got most things working, but I am tearing my hair out with a problem.  Brian added into Mach3 the .GetMessage call (to display the status label data), this returns a BSTR, now that is well and good in C++ but it is killing me with C#.  Do you guys know of a way of accessing a BSTR in C#???

Andrew,

I haven't needed strings yet, but as I was getting started, the following article was helpful for me.

http://msdn2.microsoft.com/en-us/magazine/cc301501.aspx

Dave
Re: Automating Mach from external software
« Reply #14 on: March 10, 2008, 07:18:54 AM »
Hi,
Not sure if this would be any help to anyone, but here is a rough test application I was using to get the hang of remoting Mach3 from C#.  I can't post the finished code as it is for a customer, and I don't think he would like me posting it here.
Any questions or suggestions please give me a yell.

Regards
Andrew
Re: Automating Mach from external software
« Reply #15 on: March 29, 2008, 06:54:38 PM »
hi,
can we do this in VB.NET ?

regards
carlo
Re: Automating Mach from external software
« Reply #16 on: April 09, 2008, 06:53:19 PM »
Hi Carlo
Sorry for not replying sooner, but I have been away.
Yes you can do this with VB.net.  I have only just started using C#, I used to use vb.net for everything, but I am now a convert and use C#.
If you would like to use INSTANT VB (tangiblesoftwaresolutions.com), my C# example should convert to VB ok - I havn't tried this, but I have used this converter software in the past and it seems to work perfectly from C# to VB but a little dodgy from VB to C#.
Hope this helps

Andrew
Re: Automating Mach from external software
« Reply #17 on: April 15, 2008, 02:21:03 PM »
thanks Andrew,

I'll see what i can do.

i've never used the SDK untill now so i have a couple of questions befor starting.

* When we use VB.NET and Mach SDK, does it mean we can run MACH3 without acually running MACH3 standard application?
* When I run the test C#, on the screen ther is the load button, when i load the MACH from the test screen the standard Mach is running on the backround and displayed within the screen, I don't understand why to run a screen like test C# when you have the same screen running on the backround.

i hope you understand my point   ::) :-\