Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2008, 09:19:32 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach SDK plugin questions and answers.
| | |-+  Automating Mach from external software
Pages: « 1 2   Go Down
Print
Author Topic: Automating Mach from external software  (Read 1812 times)
0 Members and 1 Guest are viewing this topic.
jemmyell
Active Member

Offline Offline

Posts: 70


View Profile WWW
« 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
Logged

babinda01
Active Member

Offline Offline

Posts: 12


View Profile
« 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
Logged
jemmyell
Active Member

Offline Offline

Posts: 70


View Profile WWW
« 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
Logged

davew
Active Member

Offline Offline

Posts: 8


View Profile
« 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
Logged
babinda01
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #14 on: March 10, 2008, 06: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

* Mach.Remote.zip (513.25 KB - downloaded 40 times.)
Logged
carlo
Active Member

Offline Offline

Posts: 7


View Profile
« Reply #15 on: March 29, 2008, 05:54:38 PM »

hi,
can we do this in VB.NET ?

regards
carlo
Logged
babinda01
Active Member

Offline Offline

Posts: 12


View Profile
« Reply #16 on: April 09, 2008, 05: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
Logged
carlo
Active Member

Offline Offline

Posts: 7


View Profile
« Reply #17 on: April 15, 2008, 01: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   Roll Eyes Undecided
Logged
Pages: « 1 2   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!