Hi,
In pure MDL, dls file specification (see below) allows to call functions in MDL program (used as Shared library) from another pure MDL program.How may this be done between two "native" MDL programs?
Thanks for help
Best regards,
Jean-Claude
/*----------------------------------------------------------------------+| || Function - || || MDL Shared Library Example Application Dynamic Link || Specification File || |+----------------------------------------------------------------------*//* Specify the version number. */
%Version 0x551
%InterfaceType Mdllib
%ModuleName pixdted
%Functions
GetPointAltitudeFromDtedUsingDisplayedRaster (dtTools_GetPointAltitudeFromDtedUsingDisplayedRaster) GetPointAltitudeFromDted (dtTools_GetPointAltitudeFromCurrentSousLotDted)
%EndFunctions
%Variables
%EndVariables
%End
Jean-Claude FISCHER said:How may this be done between two "native" MDL programs?
A native MDL program usually builds as a DLL. It follows the rules of Windows DLLs and publishes an interface that conforms to the C calling protocol. Another app. loaded into the same MicroStation address space can call that public interface.
That's the dynamic (DLL) approach. You can alternatively build a static (*.lib) library. Like a DLL, that library must have a public interface. Much of the MicroStation API is delivered in the *.lib files that you are familiar with when using bmake.
*.lib
The 'public interface' of a DLL or library is the list of class and function declarations that you put in a header (*.h) file.
*.h
Visual Studio makes it easy to build either a DLL or a static library. Consult a Microsoft MSDN site for more information.
Regards, Jon Summers LA Solutions
Hi Jean-Cluade,
at first, PLEASE use Insert > Insert code tool to share any piece of code. It's annoying to see code formatted as plain text. Why to waste time to read such text?
MDL shared libraries were marked as obsolete long time ago and even in MDL documentation there is a recommendation to use DLL instead.
So the discussion moves to "how to create DLL library, that can be consumed by more application".
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point