connecting/attaching to an external process when debugging

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
samuelz
Posts: 14
Joined: Wed Feb 20, 2013 12:16 pm

connecting/attaching to an external process when debugging

Post by samuelz » Wed Feb 20, 2013 12:16 pm

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.

User avatar
jvierra
Posts: 13718
Joined: Tue May 22, 2007 9:57 am
Contact:

connecting/attaching to an external process when debugging

Post by jvierra » Wed Feb 20, 2013 1:21 pm

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

User avatar
samuelz
Posts: 14
Joined: Wed Feb 20, 2013 12:16 pm

connecting/attaching to an external process when debugging

Post by samuelz » Thu Feb 21, 2013 2:27 pm

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

User avatar
jvierra
Posts: 13718
Joined: Tue May 22, 2007 9:57 am
Contact:

connecting/attaching to an external process when debugging

Post by jvierra » Thu Feb 21, 2013 4:40 pm

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.

User avatar
samuelz
Posts: 14
Joined: Wed Feb 20, 2013 12:16 pm

connecting/attaching to an external process when debugging

Post by samuelz » Thu Feb 21, 2013 5:56 pm

I have figured out how to make it work. thank you for your "help"!

User avatar
jvierra
Posts: 13718
Joined: Tue May 22, 2007 9:57 am
Contact:

connecting/attaching to an external process when debugging

Post by jvierra » Thu Feb 21, 2013 6:17 pm

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.

User avatar
Alexander Riedel
Posts: 7023
Joined: Tue May 29, 2007 4:43 pm

connecting/attaching to an external process when debugging

Post by Alexander Riedel » Thu Feb 21, 2013 6:20 pm

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.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13718
Joined: Tue May 22, 2007 9:57 am
Contact:

connecting/attaching to an external process when debugging

Post by jvierra » Thu Feb 21, 2013 6:34 pm

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.

User avatar
Alexander Riedel
Posts: 7023
Joined: Tue May 29, 2007 4:43 pm

connecting/attaching to an external process when debugging

Post by Alexander Riedel » Thu Feb 21, 2013 6:39 pm

I know. I was just not happy about the quotes around the word help in the response.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13718
Joined: Tue May 22, 2007 9:57 am
Contact:

connecting/attaching to an external process when debugging

Post by jvierra » Thu Feb 21, 2013 6:54 pm

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.

Locked