Hello Guest it is April 23, 2024, 07:39:22 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - andrewk

Pages: 1
1
General Mach Discussion / Running Mach3 via VB.NET
« on: October 20, 2009, 07:23:44 AM »
Good morning :-)

After a long run of extensive searching and finding great help through the forums, I've hit a roadblock.

I'm trying to control Mach3 through VB.net and have the basic foundation.  I'm able to do basically everything I want with the Mach4 COM API, but my problem is that every time I restart my vb.net program, I get an error that says "Cannot create ActiveX control" on the line that reads: mach = GetObject(, "Mach4.Document")

Here is some simple code:

Code: [Select]
Dim mach As Mach4.IMach4
Dim scriptObject As Mach4.IMyScriptObject

mach = GetObject(, "Mach4.Document")
scriptObject = mach.GetScriptDispatch()

scriptObject.LoadFile("11 CUX56.TXT")

scriptObject.RunFile()

While (scriptObject.IsMoving() <> 0)
    System.Threading.Thread.Sleep(1)
End While


If I close Mach3 and restart it after the error, the program runs fine.  The problem occurs when I close my vb.net program and reopen it (rebuild it, to be exact) without closing Mach3.

Am I not creating my object properly?  Is there a code to reset the control or to close the link to reopen it?  If I run the code with Mach3 closed, I get the same error.

I'm guessing it's related, but when I close Mach3 after getting the error, I get a popup box that says "Error Found  ,Art Code: 9991, Attempt Recovery?".

Any ideas?  Thank you very much in advance!

2
VB and the development of wizards / Running Mach3 via VB.NET
« on: October 19, 2009, 10:29:45 AM »
Good morning :-)

After a long run of extensive searching and finding great help through the forums, I've hit a roadblock.

I'm trying to control Mach3 through VB.net and have the basic foundation.  I'm able to do basically everything I want with the Mach4 COM API, but my problem is that every time I restart my vb.net program, I get an error that says "Cannot create ActiveX control" on the line that reads: mach = GetObject(, "Mach4.Document")

Here is some simple code:

Code: [Select]
Dim mach As Mach4.IMach4
Dim scriptObject As Mach4.IMyScriptObject

mach = GetObject(, "Mach4.Document")
scriptObject = mach.GetScriptDispatch()

scriptObject.LoadFile("11 CUX56.TXT")

scriptObject.RunFile()

While (scriptObject.IsMoving() <> 0)
    System.Threading.Thread.Sleep(1)
End While


If I close Mach3 and restart it after the error, the program runs fine.  The problem occurs when I close my vb.net program and reopen it (rebuild it, to be exact) without closing Mach3.

Am I not creating my object properly?  Is there a code to reset the control or to close the link to reopen it?  If I run the code with Mach3 closed, I get the same error.

I'm guessing it's related, but when I close Mach3 after getting the error, I get a popup box that says "Error Found  ,Art Code: 9991, Attempt Recovery?".

Any ideas?  Thank you very much in advance!

Pages: 1