Hello Guest it is October 20, 2019, 12:30:43 AM

Author Topic: Load Gcode file from vb.net  (Read 2425 times)

0 Members and 1 Guest are viewing this topic.

Offline db1

*
  •  2 2
    • View Profile
Load Gcode file from vb.net
« on: June 22, 2015, 05:22:05 PM »
Hello all,

I created a simple vb.net application that generates a gcode file for some simple shapes. After the file is created the user can click a button that is used to load the gcode into mach3 (This is just for convenience for the user) but when the button is clicked vb throws the following error :

                An unhandled exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll

                Additional information: Cannot create ActiveX component


Can anyone help interpret and fix this error? I have done a few google searches and was able to find threads with the same problem but none of the ones I found were answered.

Thank you for any help!



Below is the vb.net code that I use:

        Dim mach As Mach4.IMach4
        Dim scriptObject As Mach4.IMyScriptObject

        mach = GetObject(, "Mach4.Document")      <------- This is the line the error happens at
        scriptObject = mach.GetScriptDispatch()

        scriptObject.LoadFile(Filename)