Page 1 of 2

connecting/attaching to an external process when debugging

Posted: Wed Feb 20, 2013 11:16 am
by samuelz
Hi,
I am new to PrimalScript, so my questions might be answered somewhere in the forum already.
the external application I use support COM, and in Visual Studio, if you use VB, you can use GetObject() to get the main application, and then from there, you can run debuger in VS and it automatically connects to my application, at the same time I can use Watch, etc., in VS, while is also able to watch changes, etc. in my application. is there a way to do the same thing using PrimalSCript?
Thanks for the help.

connecting/attaching to an external process when debugging

Posted: Wed Feb 20, 2013 12:21 pm
by jvierra
Yes - Just hit F5 and the debugger will start an step into your script.

You should post PrimalScript specific questions in the PrimalScript forum. Thisis the forum for VBScript.

http://www.sapien.com/forums/index.php? ... imalscript

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 1:27 pm
by samuelz
the script I am using is VBScript, that is why I posted my question here! I hope you understood my question before you answer, it is not about on how to run debugger, but instead, when running debugger, how to "connect" it to the external application declared using GetObject

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 3:40 pm
by jvierra
That is not a scripting question. It is a question about how to use the PrimalScript debugger. You are also slightly mistaken about how VS works. In VS we can step into an external program that is attached to. That is a function of the advanced system debugger.

This capability is not available for VScript with PrimalScript. You cab, however, attach VS to the external program and set a breakpoint. I have done this but don't remember how. The technique has nothing to do with VBScript.

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 4:56 pm
by samuelz
I have figured out how to make it work. thank you for your "help"!

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 5:17 pm
by jvierra
And how did you get PrimalScript to debug an external process?

Are you saying you found out how to debug into the system debugger? What was your solution. Others might be looking here for a solution.

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 5:20 pm
by Alexander Riedel
Hi James. Thanks as always for volunteering your help. It's unfortunate that not everyone here conducts themselves in a professional manner.

Alexander Riedel
SAPIEN Technologies, Inc.

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 5:34 pm
by jvierra
Hi Alex,

I am not sure but it is possible that the OP decided to use VS to debug both. Thisis possible but very hard to set up.

If I have code written in VS for an automation object that I will load under VBScritp with CreateObject then I can set up VS witht the project and set it as JIT and run. When I step into the DerateObejct in PrimalScript it will trap in the VS debugger. I jsut tested a quick call into a COM enabled application to prove that an errro was in teh API and nott in teh script or applicaiton design. I hadn't done this for a couple of years but it worked first time painlessly.

My point here was that the OP should post in the PrimalSript forum as it is a PrimalScript debugger issue or question. I also know of no way to have PrimalScript step into compiled code. This is why I felt the OPs experience would be useful.

I hope we get a response.

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 5:39 pm
by Alexander Riedel
I know. I was just not happy about the quotes around the word help in the response.

connecting/attaching to an external process when debugging

Posted: Thu Feb 21, 2013 5:54 pm
by jvierra
I try to ignore those things. Sometime people just want an instant solution and when they do not get it they get aggravated.

We try. Luckily most appreciate it.

I am surprised that someone would claim to know there is a way to 'attach' using PrimalScript. I suspect that many do not have enough experience to understand that the concept of 'attaching' to a process requires access to the low-level debug API. This would be nice in PrimalScript but not really all that useful and I suspect it would add an awful lot of extra cost and maintenance to the product.