Machsupport Forum
Mach Discussion => Mach SDK plugin questions and answers. => Topic started by: Scoppio on February 17, 2011, 03:04:29 PM
-
Hello people,
I've started a project sometime ago and now its almost finished... "almost" because it was developed under vista and seven, but the final plataform is Windows XP
Today I tested it for the first time in the computer it will receive the program and for my surprise it didn't worked.
After some time crushing the head against the wall I realised the problem, when I call this specific and yet most important part of the code about the COM with the MACH4 the program was'nt answering:
Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");
Script = (Mach4.IMyScriptObject)Mach.GetScriptDispatch();
Actually, it was... it was saying that I could not handle an HResult from this COM, but I can't even start to understand why, for real, the program/plugin works automatizing the Mach3 (entirely constructed in c#), but when I try to start a connection with the program so I can send the Script.Code( ) or any other procedure/parametre it get stuck in this ******Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document");********
Have anyone ever passed by this kind of problem? I just can't realize why this would happen. I even tried to compile the program inside the XP but it didn't worked as well.
Thanks in advance
Lucas S.Coppio
-
Hi Lucas,
Checkout the installation of Mach3 on this computer.
Under some circumstances (AFAIK depending on the version of the installer), the entries in the registry are not complete.
Check for those or insert them:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Mach4.Document]
@="Mach4.Document"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Mach4.Document\CLSID]
@="{CA7992B2-2653-4342-8061-D7D385C07809}"
it should work then.
best regards,
Steffen
-
You hit the problem in its very roots! Literally!
The installer of the Mach3/4 was not creating a registry in the WinXP, no idea why... I just exported the register to a "*.reg" from my dev station and runned in the winXP test Station and it works
Thanks Steffen
-
thank you for detailed description...
after i modified the registry, it worked immediately.. thank you.
-
Hi,
i got some grey hair too, when i had this issue.
Here's a reg-file for easier adding the keys to the registry.
Steffen
-
Hi,
I have similar problem, when i Run Mach3, and then Application, it works fine, but when i close app and start again, in line
"Mach = (Mach4.IMach4)Marshal.GetActiveObject("Mach4.Document")" app stack.
I must close mach3 to app work again
Any ideas ? How to make application work without closing mach