` Printed Icetips Article

Icetips Article



Par2: How to create an "Application CLASS" that is compiled and linked into a DLL
1998-06-26 -- Dave Berton
 
is the solution we use - an 'Object Exporter' template which
will allow you to easily export objects and methods from the object
DLLs you create.

#INCLUDE() this in an existing template chain:

--begin objexp.tpw
#EXTENSION(ObjectExporter,'Export Objects from a DLL'),APPLICATION
#DISPLAY('')
#DISPLAY('Export selected objects from this DLL.')
#DISPLAY('')
#DISPLAY('Insert all objects and methods here:')
#BUTTON('Objects'),MULTI(%ObjectsToExport,%ExportedObject),INLINE
    #PROMPT('Object',@S50),%ExportedObject,REQ
    #DISPLAY('')
    #DISPLAY('Object methods to export:')
    #BUTTON('Exported methods'),MULTI(%ExportedMethods,%MethodName &
        ' ' & %MethodPrototype),INLINE
        #PROMPT('Method',@S100),%MethodName,AT(,,100)
        #PROMPT('Prototype',@S255),%MethodPrototype,AT(,,100)
    #ENDBUTTON
#ENDBUTTON
#ATSTART
#DECLARE(%ObjectMethodPrototype)
#ENDAT
#AT(%DLLExportList)
;Start of Object Exporter
    #FOR(%ObjectsToExport)
    #SET(%ExportedObject,UPPER(%ExportedObject))
TYPE$%ExportedObject @?
VMT$%ExportedObject @?
        #FOR(%ExportedMethods)
            #IF(SUB(%MethodPrototype,1,1) = '(')
                #SET(%ObjectMethodPrototype,SUB(%MethodPrototype,1,1)
& %ExportedObject & ',' &
SUB(%MethodPrototype,2,LEN(CLIP(%MethodPrototype))))
            #ELSE
                #SET(%ObjectMethodPrototype,'(' & %ExportedObject & ')')
            #ENDIF
%(LINKNAME(%MethodName & %ObjectMethodPrototype)) @?
        #ENDFOR
    #ENDFOR
;End of Object Exporter
#ENDAT



Printed May 10, 2024, 3:14 am
This article has been viewed/printed 35119 times.