[jawsscripts] Re: COM DLL template project

  • From: Csaba Godo <arpadhazi68.jawsul@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Sun, 5 Jan 2020 20:54:29 +0100

Hi Jan!

There is some help how to use COM objects from JAWS Script.

First the caller function, which creates the object in JAWS Script:

object Function CreateobjectFromProgID (string ProgID)
; Create a COM object from a ProgID string, trying an alternate method 
if the default one fails
  var
        object oReturn

         oReturn =  CreateobjectEx (ProgID, TRUE)
                                If !oReturn Then
                 oReturn =  CreateobjectEx (ProgID, FALSE)
        EndIf
        Return oReturn
EndFunction; CreateobjectFromProgID


Than an example how to use:

Object Function GetFileSystemObject ()
; Creates a FileSystem object and returns its reference

        Return CreateObjectFromProgID (FILESYSTEMOBJECT)
EndFunction ; GetFileSystemObject

int Function GetFileSize (string sFile)
;Get size of a file
var
        object oSystem, object oFile,
        int iReturn

        oSystem =  GetFileSystemObject ()
        oFile = oSystem.GetFile(sFile)
        iReturn = oFile.size

        NullObject (oFile)
        NullObject (oSystem)

        Return iReturn
EndFunction ; GetFileSize


HTH,

Csaba





2019. 12. 14. 10:05 keltezéssel, Jan Hegr írta:

Hello,
please, is somewhere available a template project of a COM DLL with
all the stuff needed to be called from JSL and a script using it?
It seems to me that this is a non-inventive procedure requiring to
set-up lot of things properly, but could be well solved by a "start
project" template. So I believe someone had to prepare it already.

Thank you very much.
Jan
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: