Page 1 of 1

PrimalScript - VBSCRIPT: How to make IntelliSense working ..

Posted: Sat Nov 07, 2015 11:37 am
by TestGebruiker
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

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

Posted: Sat Nov 07, 2015 11:54 am
by Alexander Riedel
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 7495 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.

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

Posted: Sat Nov 07, 2015 5:00 pm
by TestGebruiker
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?

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

Posted: Sat Nov 07, 2015 6:01 pm
by Alexander Riedel
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.

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

Posted: Sun Nov 08, 2015 12:44 am
by TestGebruiker
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!

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

Posted: Sun Nov 08, 2015 1:30 am
by Alexander Riedel
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.

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

Posted: Tue Nov 17, 2015 4:10 am
by TestGebruiker
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