Hello Guest it is December 09, 2019, 09:31:15 PM

Author Topic: Program works great on Vista/Seven... but when it's about the XP...  (Read 7110 times)

0 Members and 1 Guest are viewing this topic.

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
Re: Program works great on Vista/Seven... but when it's about the XP...
« Reply #1 on: February 18, 2011, 08:50:24 PM »
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:

Code: [Select]
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
Re: Program works great on Vista/Seven... but when it's about the XP...
« Reply #2 on: February 21, 2011, 01:01:04 PM »
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
Re: Program works great on Vista/Seven... but when it's about the XP...
« Reply #3 on: March 10, 2011, 02:47:55 AM »
thank you for detailed description...
after i modified the registry, it worked immediately.. thank you.
Re: Program works great on Vista/Seven... but when it's about the XP...
« Reply #4 on: March 15, 2011, 09:02:22 AM »
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