I'm trying to use the Win32::OLE module to control a Windows application. I know that the developers of the application provide an OLE Object to control it, but I don't know the name of the object.
On an old version of the program, I managed to reference the object in Perl by the following line:
$ref = new Win32::OLE 'object.name'
but the new version of the program has a different object name.
Is there any way of checking which OLE objects exist for applications that are currently running on Windows?
Win32::OLE comes with an OLE browser. Keep in mind, it only works with Internet Explorer and only when you load the HTML document from your local system.
Of course, you could also install Microsoft's development tools and get the native OLE/COM Object Viewer:
You can also find the names and components of Win32::OLE objects for other products (Excel, Word) by starting the product, then typing Alt-F11. This should open the VBA editor. Once in the VBA editor, type F2 (or use the pull-down menu from View) to start the Object Browser. This will list the objects relevant to that product. Here is an example from Excel.
Related
Is it possible to hide the Driver script for each execution in HP-UFT?
Instead of using a driver script, you can create the COM object of Quicktest.Application inside your UI application itself. If you are using Excel as UI, you can use the same driver script code in a function and it will work in excel. All languages will have similar methods to create COM objects. A C# example would be this
I want to use QTP AOM(Automation Object Model) using vbscript. I use VbsEdit to develop this script but I did not get any intellience from this editor even I also try this from excel developer window. There also intellence assistance is not available.
I need this because if it is not appear then how can I know the available(open) methods and properties from this COM object.
I have also another question that we write this below line to instantiate a QTP object using vbs
CreateObject("QuickTest.Application")
For excel
CreateObject("Excel.Application")
How can I know the COM objects name means can I list down all COM object name programmatically.
There are two questions here.
Why don't you get intelisense for the QTP object in the IDE you're using (VBSEdit)
Intelisense is a feature of the IDE, you should tag this question VBSEdit, not QTP
Where can I get a list of all the COM objects in the system?
When you use CreateObject you're specifying a ProgID which is a string identifyier for a COM class (slightly more human readable than a CLSID. COM uses the registry to maintain its Prog and Cls IDs, you can find the ProgId's under the HKEY_CLASSES_ROOT registry hive (look for keys with a child CLSID key).
I am a beginer with ruby and sketchup.I need to select and import multiple files at the same time when open a dialog for importing. I used a class, which is inherited from Importer interface of SketchUp . But if i want to import multiple file, it means that i have to open importer dialog many time for doing that. It is inconvenience.
After importing, it is return all the paths of all file i have imported .Do you have any idea for implementing that?
Thanks you so much !
Unfortunately the Ruby API doesn't implement any API to select multiple files in a file dialog.
Further more, if you use the Importer class you are stuck with the file dialog it displays. It's single select only.
If you know all files in the folder should be read you should let the user pick a single file, then extract the path from that and read all the files from that directory.
If you drop the Importer class you can craft your own alternative. The best would then to create a Ruby C Extension that calls the OS API to display a multi-select dialog.
Alternatively, you can create a WebDialog that display the files and let the user pick multiple files. But that means you'll have to create all the UI from scratch and it'll not lok like the native OS file dialogs.
http://www.sketchup.com/intl/en/developer/docs/ourdoc/webdialog.php
https://github.com/thomthom/sketchup-webdialogs-the-lost-manual/wiki
If you are making a Windows only plugin you can make use of the drag and drop feature of HTML5. Though this also has drawbacks of requiring the user to have a recent IE version. (OSX hides the WebDialogs when SU isn't active - so you cannot use it as a drop target when you drag files from Finder.)
I made a proof of concept a while back: https://github.com/thomthom/DropZone
I have created a Fire Monkey HD app in Rad Studio xe2.I have created text file for windows in my application using AssignFile() method.Now I want to create text file for MAC OSx.How can I do it??
Delphi includes the System.IOUtils.TFile this is a record containing methods used to perform various operations on files, So to create a text file you can use the TFile.WriteAllText passing the content of the file directly or use the TFile.Create method that create a file and return a TFileStream. Also you can use the TFileStream class directly.
All the above methods works in Windows and OSX.
AssignFile is a seriously outdated function.
In modern (and cross platform) apps you should be using streams.
I understand the process needed to customize a right click menu going through the regedit etc. However I need to the ability to go multiple levels such as in applications like WinZip. Here's a picture for clarification of what I need
alt text http://img14.imageshack.us/img14/9658/multiplemenus.jpg
You need to write a Shell Extension; there is a guide for writing one in managed code (C#) here. It will involve doing a bunch of interop and implementing COM interfaces that the windows shell will consume, namely IShellExtInit and IContextMenu.
However, one could argue that writing a Shell Extension in managed code is not advisable; it will force windows explorer to load the CLR, (or any app that uses the standard windows 'Open File' dialog) - native code (C++) would be a better choice for this.