Support Forums

PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Use this forum to ask questions before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
User avatar
TestGebruiker
Posts: 5
Joined: Sat Nov 07, 2015 12:19 pm

PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby TestGebruiker » Sat Nov 07, 2015 12:37 pm

Language: VBSCRIPT
OS: Windows 7
Product: PrimalScript 64bit (Trial version)

Dear reader,

How to make IntelliSense (List Properties and Methods) working for external COM applications such as Excel

For example:
Set objXL = CreateObject("Excel.Application")

objXL. should show the list of properties and methods after the . (dot)

Can somebody tell if this is possible with PrimalScript 2015, and if so explain what steps to take to make this working with PrimalScript 2015 (Trail Version)

Thanks in advance
Arie
User avatar
Alexander Riedel
Posts: 5781
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby Alexander Riedel » Sat Nov 07, 2015 12:54 pm

That should be automatic as shown here:

11-7-2015 11-51-13 AM.png
11-7-2015 11-51-13 AM.png (26.39 KiB) Viewed 4431 times


Please note that the 64 bit version of PrimalScript cannot see 32 bit COM objects and vice versa.
The above screenshot was created on Windows 7 with the 32 bit version of PrimalScript 2015 and Office 2010 32 Bit.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
TestGebruiker
Posts: 5
Joined: Sat Nov 07, 2015 12:19 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby TestGebruiker » Sat Nov 07, 2015 6:00 pm

Thanks for pointing me in the right direction regarding Excel.
After I installed the 32-bits version of PrimalScript2015 I could see the list of Excel properties and Methods

However I still have some issues with other application / executable

Set objVDApp = GetObject(,"ViewDraw.Application.16")
Set objVDView = objVDApp.ActiveView

PrimalScript debugging is capable of debugging the above two lines. (See Attach screenshot)
However PrimalSense is not working for this application.

I have checked that it is a 32bit application so that shouldn't be the problem
Any idea why PrimalSense isn't working for this executable?
Attachments
PrimalScript 2015.JPG
PrimalScript 2015.JPG (251.7 KiB) Viewed 4419 times
User avatar
Alexander Riedel
Posts: 5781
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby Alexander Riedel » Sat Nov 07, 2015 7:01 pm

Generally PrimalScript requires a TypeLib for the COM object to provide PrimalSense. That is where all the data about type, methods and properties is stored.
If the Typelib is not embedded in the server object, correctly registered or, as it happens in some cases, simply not shipped and installed with the application, then there is just no information to display.

As you can see in the screenshot you attached, the object browser states "No Type information found". That indicates a missing or incorrectly registered TypeLib. Check in the application's installation folder if there is a .TLB file.
If not, you will need to contact the vendor of that application for that file.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
TestGebruiker
Posts: 5
Joined: Sat Nov 07, 2015 12:19 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby TestGebruiker » Sun Nov 08, 2015 1:44 am

Thanks for your explanation.

I am a novice programmer / script writer and struggle to see why the Object Browser of Microsoft Visual Basic 2010 Express is able to display the properties, methods of the ViewDraw application and PrimalSense isn't. (See snapshot)

Is this because in Visual Basic 2010 Express you make upfront an explicit reference to the ViewDraw executable? (Early binding)
For me this indicates that the ViewDraw executable is correctly installed and registered. Correct?
While with PrimalScript you don't so it has to figure this out by late binding? (Or is there a way to this too for a VBSCRIPT inside PrimalScript?)

As I am working for the company that owns the ViewDraw application (I am not a programmer) I wonder what should ask R&D to do to allow PrimalScript/Sense to see the properties and methods of ViewDraw? (Apparently something is missing inside our executable)

BTW: Being able to debug a VBSCRIPT is already a great step forward!
Attachments
Visual Studio - Object Browser.JPG
Visual Studio - Object Browser.JPG (300.02 KiB) Viewed 4402 times
User avatar
Alexander Riedel
Posts: 5781
Joined: Tue May 29, 2007 4:43 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby Alexander Riedel » Sun Nov 08, 2015 2:30 am

You need the .TLB file for the object. Once you have that I can tell you how to make PrimalScript use it, even if it is not registered correctly.
Yes, Microsoft Visual Basic probably instantiates the object to query it for its properties and methods.

We do not do this for a variety of reasons. PrimalScript itself does not bind to the object at all. So neither late nor early :D
1. It is a potential security risk to instantiate an object without requesting the explicit permission of the user.
2. The TLB file is supposed to be there and it is faster and more efficient to use.
3. Last but not least, using the TLB files allows to develop for objects that cannot even be installed on your local machine.
So in other words, you can have PrimalSense for an object on your Windows 7 client even though the object would require
Windows 2014 Server to be actually used.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
TestGebruiker
Posts: 5
Joined: Sat Nov 07, 2015 12:19 pm

Re: PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Postby TestGebruiker » Tue Nov 17, 2015 5:10 am

Dear Alexander,

I have a type library for the application which I have attached as a 7-Zip file: viewdraw.zip
Note: I had to rename the file extension from .7z to .zip in order to get it attached

Would you be so kind to explain how PrimalScript - PrimalSense can use this type lib as you indicated in your message below.

Kind regards
Ad
Attachments
viewdraw.zip
(42.53 KiB) Downloaded 139 times

Return to “Trial Software Questions”

Who is online

Users browsing this forum: No registered users and 2 guests