Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 06:31:52 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 VB6
Pages: 1   Go Down
Print
Author Topic: Automating Mach from VB6  (Read 686 times)
0 Members and 2 Guests are viewing this topic.
DiyAddict
Active Member

Offline Offline

Posts: 4


View Profile
« on: October 23, 2010, 12:47:50 PM »

Hi everyone,
I'm trying to automate Mach from a VB6 program. Can anyone point me in the right direction?

Thanks in advance
Logged
DiyAddict
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #1 on: October 23, 2010, 03:12:52 PM »

Ok, after searching around, I've seen a couple of examples of code similar to the following:

Create a reference to mach3.exe, then:

Public objMach As mach4.IMach4                                          'Access the embedded type library

Private Sub test()                                                               'Simple test sub

    Set objMach = GetObject(, "Mach4.Document")                     'Create the object
    objMach.LoadGCodeFile "c:\mach3\gcode\roadrunner.tap"        'Load Gcode

    Set objMach = Nothing                                                       'dereference Mach3 object

End Sub


My problem is that each time this program gets to the GetObject line, I get an error message "Runtime error 429: ActiveX component can't create object"

I know that Mach3.exe is properly referenced, because it's interface's methods and events show up.

No one else has reported this problem, so here's my question: Am I getting this error because I'm using the trial version of Mach 3?

VB6 says something about this error occuring when a license key is not found.

Any light you can shed on this matter would be greatly appreciated

Logged
DiyAddict
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #2 on: October 25, 2010, 06:09:17 AM »

I think I've found the problem - it seems that the latest version of Mach3 (3.042.040) never creates the registry entry Mach4.Document, which is needed for the automation object to work.

The solution is to install version 2.63 first, then run it once, then install the latest version.

I'd be interested in comments - has anyone else had similar problems?
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!