I have the same problem. A didn`t have any LPT on my motherboard so i decided to control mi driver trough USB. I have my progrma writen in C# which gets and sends data to my PIC trough the USB using HID. A managed to control a stepe motor trough the PC and now Im working on making Servo controler mith my PIC18F2455.
First i thought that i wil capture the LPT data which Mach3 sends and redirect it to the USB and the PIC but when i dont have a LPT it sounds imposible unles i make some Emulated LPT.
But now i am workingo on making plugin for Mach3 . I want to do it in C# .NET
I`ve read this topic
http://www.machsupport.com/forum/index.php/topic,11589.0.html and i`m trying to acces the Mach3 , But i get an error
System.Runtime.InteropServices.COMException was unhandled
Message="Невалиден низ за клас (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))"
Source="mscorlib"
ErrorCode=-2147221005
StackTrace:
at System.Runtime.InteropServices.Marshal.CLSIDFromProgID(String progId, Guid& clsid)
at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID)
at Test_Mach3_plugin.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Asen\Documents\Visual Studio 2008\Projects\Test Mach3 plugin\Test Mach3 plugin\Form1.cs:line 33
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Test_Mach3_plugin.Program.Main() in C:\Users\Asen\Documents\Visual Studio 2008\Projects\Test Mach3 plugin\Test Mach3 plugin\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: