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.
This topic is 11 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
samuelz
Posts: 14
Last visit: Tue Nov 25, 2014 12:13 pm

connecting/attaching to an external process when debugging

Post 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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

connecting/attaching to an external process when debugging

Post 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
User avatar
samuelz
Posts: 14
Last visit: Tue Nov 25, 2014 12:13 pm

connecting/attaching to an external process when debugging

Post 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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

connecting/attaching to an external process when debugging

Post 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.
User avatar
samuelz
Posts: 14
Last visit: Tue Nov 25, 2014 12:13 pm

connecting/attaching to an external process when debugging

Post by samuelz »

I have figured out how to make it work. thank you for your "help"!
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

connecting/attaching to an external process when debugging

Post 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.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

connecting/attaching to an external process when debugging

Post 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.
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

connecting/attaching to an external process when debugging

Post 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.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

connecting/attaching to an external process when debugging

Post by Alexander Riedel »

I know. I was just not happy about the quotes around the word help in the response.
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

connecting/attaching to an external process when debugging

Post 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.
This topic is 11 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked