Dynalib Miscellaneous

From TeamDeveloperWiki

Jump to: navigation, search

This page covers Dynalib miscellaneous tips & tricks.

Contents


Image:Pointer.pngHow to determine dynalib filename

At runtime it could be handy to determine the dynalib filename of the current execution context.
This can be used to display the dynalib name in error messages within the dynalib where the error occurred.
Specially for finding the location of the issue, displaying the name of the dynalib could help alot.

Use this piece of code within the dynalib to get the filename (with or without path).
It also works when executed within an executable. Then the exe name is determined !
Both SalOutline functions are undocumented.

! First get the current outline handle. Every dynalib in the system has an unique handle at runtime
Set nCurrentOutline = SalOutlineCurrent( )

! Now get the filename of this handle.
! The boolean parameter indicates if the receive variable sFile will have the full path (TRUE) or only the filename (FALSE)
Call SalOutlineGetFileName( nCurrentOutline, sFile, FALSE )

A sample can be downloaded here
WIKI_GetDynalibFilename.zip

Personal tools