Is there any example of a shared library (.dll)? No .ma file.

I have a shared library (stand alone .dll file. No .ma file.) Is there any example of this in the CONNECT SDK?

Parents
  • Hi ,

    As Mike requests, if you can provide some brief information related to your workflow or needs it may help provide better recommendations early on.

    As Jon suggests, for MDL (.cpp Native Code) both a .DLL + .MA are required "to load" an application and access functionality defined in the .DLL library file - and - common Microsoft DLL library dependencies and common address space interactions are possible w/o need for Inter-Process Communication (a.k.a. IPC named pipes and queues preferred).

    For MDL (.cs Managed Code) only a .DLL (standalone) file is generated as output; however behind the scenes the MicroStation .NET loader will create a temporary .MA image if not present "to load" a MDL .NET Addin application.

    Bob



  • appName = fplcommon

    MSJ_SKIP_SIGNRSCS = 0

    DLM_NO_SIGN = 0


    privateInc = $(baseDir)

    %include mdl.mki

    %if defined (_MakeFilePath)
    baseDir = $(_MakeFilePath)
    %else
    %if defined (powerc) || (m68k)
    baseDir = /
    %else
    baseDir = ./
    %endif
    %endif

    #---------------------------------------------
    # mdl.mki contains the default rules for creating .rsc, .mo, etc files
    #---------------------------------------------
    %if defined (MLINK_STDLIB)
    libraryExt = dlo
    %else
    libraryExt = ml
    %endif

    # Display compile warning in MS/J
    moreMdlCompileOpts + -b
    #------------------------------------------------
    # Set up to use dlmcomp.mki and dlmlink.mki
    #------------------------------------------------

    DLM_OBJECT_DEST = $(o)
    DLM_LIBDEF_SRC = $(baseDir)
    DLM_NAME = fplcommon
    DLM_OBJECT_FILES = $(o)$(DLM_NAME)$(oext)
    DLM_LIBRARY_FILES = $(mdlLibs)dgnfileio.lib $(mdlLibs)toolsubs.lib
    dlm_special_linkopt=-Fixed:no

    #------------------------------------------------
    # Compile the source files for the DLM
    #------------------------------------------------
    %include dlmcomp.mki

    $(o)$(DLM_NAME)$(oext): $(baseDir)$(DLM_NAME).c

    #------------------------------------------------
    # Use dlmlink.mki to compile the Dynamic
    # Load Specification (.dls) file and link
    # the DLM.
    #------------------------------------------------

    %include dlmlink.mki

    #---------------------------------------------
    # Compile the Dynamic Link Specification
    #---------------------------------------------

    $(o)fplcommon.dlo : $(baseDir)fplcommon.dls

    $(mdlapps)$(appName).dll : $(mdlapps)$(appName).dll
    $(msg)
    -copy $(mdlapps)$(appName).dll ..\bin\$(appName).dll
    ~time

  • I was not more clear about my goal. I have a SS3 DLL I am trying to upgrade to CONNECT

    OK, that's make sense!

    Please insert your entire bmake file rather than a copy.  There are a few things in there that are a hangover from MicroStation V7 days.  There are some things in there that would not have built correctly in V8.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Ken,

    Jon wrote it already: Please attach the file (use Insert > Insert image/video/file tool). Or when you decide to share its content, use Insert > Insert code to ensure it will be readable and not displayed as plain not formatted text.

    I am simply trying to convert the make file at this point.

    In the first step, you should remove all macros that makes no sense:

    • As Jon wrote, they are some definitions, that were used in MicroStation/J era and were not valid even in V8: MSJ_SKIP_SIGNRSCS
    • Other macros are valid for old MDL (pseudocode) development, not supported in CE: MLINK_STDLIB and everything targeting "MDL shard libraries" with dlo and ml extensions
    • Check mki files (both in V8 and CE SDK) what is defined as obsolete and remove it or replaced it: E.g. dlmcomp.mki is obsolete from V8 time
    • Migrate from C to C++, so there are no files with .c extension.
    It is not as obvious how to use 'myapp' as a template to update this for CONNECT.

    My knowledge of using shared dll files in MicroStation native apps is limited, but I guess there is no big difference between "main dll" and "shared dll": When dll is to be loaded by MicroStation as "MicroStation application", there must be MdlMain method exported and .ma loader compiled, whereas shared .dll does not contain these definitions.

    I recommend also to check dlmlink.mki for overview of DLM_ definitions, that can be used to configure different aspects of build process.

    With regards,

      Jan

  • Hi ,

    Back around the 2000 BDN developer conferences Bentley made recommendations to 3rd party developers to Migrate Interpreted MDL code to Native code where that article provides the initial process and steps recommended in the migration chain you are likely need to exercise (now); being:

    Migrating to CONNECT (parent topic and below list of migration actions needed between each major release)

    1. Migrate V7 Code
    2. Porting MDL Applications To MicroStation V8 (V8 to XM)
    3. MicroStation V8 XM Edition View Code Updates (XM to V8i)
    4. Migrating MDL Applications To Native Code (V8i to CONNECT)
    5. [Recommended] Become familiar and productive with the new CONNECT APIs.
      1. Developer Training > CONNECT API Training, CONNECT APIs
      2. SDK Docs > SDK Help and Visual Studio Extensions
    6. [Optional] Due to limited effectiveness in a 1:1 source code migration.
      1. MicroStation CONNECT SDK - Introduction (MigrationTools)

    HTH,
    Bob



  • appName = fplcommon
    
    MSJ_SKIP_SIGNRSCS = 0
    
    DLM_NO_SIGN  = 0
    
    
    privateInc = $(baseDir)
    
    %include mdl.mki
    
    %if defined (_MakeFilePath) 
    	baseDir = $(_MakeFilePath)
    %else
    	%if defined (powerc) || (m68k)
    		baseDir = /
    	%else
    		baseDir = ./
    	%endif
    %endif
    
    #---------------------------------------------
    # mdl.mki contains the default rules for creating .rsc, .mo, etc files
    #---------------------------------------------
    %if defined (MLINK_STDLIB)
    	libraryExt = dlo
    %else
    	libraryExt = ml
    %endif
    
    # Display compile warning in MS/J
    moreMdlCompileOpts + -b
    #------------------------------------------------
    #	Set up to use dlmcomp.mki and dlmlink.mki
    #------------------------------------------------
    
    DLM_OBJECT_DEST     = $(o)
    DLM_LIBDEF_SRC      = $(baseDir)
    DLM_NAME            = fplcommon
    DLM_OBJECT_FILES    = $(o)$(DLM_NAME)$(oext) 
    DLM_LIBRARY_FILES 	= $(mdlLibs)dgnfileio.lib $(mdlLibs)toolsubs.lib
    dlm_special_linkopt=-Fixed:no
    
    #------------------------------------------------
    #	Compile the source files for the DLM
    #------------------------------------------------
    %include dlmcomp.mki
    
    $(o)$(DLM_NAME)$(oext): $(baseDir)$(DLM_NAME).c
    
    #------------------------------------------------
    #	Use dlmlink.mki to compile the Dynamic 
    #       Load Specification (.dls) file and link
    #       the DLM.
    #------------------------------------------------
    
    %include dlmlink.mki
    
    #---------------------------------------------
    #   Compile the Dynamic Link Specification
    #---------------------------------------------
    
    $(o)fplcommon.dlo   : $(baseDir)fplcommon.dls
    
    $(mdlapps)$(appName).dll              :   $(mdlapps)$(appName).dll
    	$(msg)
    	-copy $(mdlapps)$(appName).dll ..\bin\$(appName).dll
    	~time
    
    

    I confess my knowledge of the intracacies of how make files work is limited. But this attached file does work in producing a usable DLL for my other V8 SS3 applications with no apparent errors.

    Bentley Systems Make Utility. Version 08.11.09.02, Jan  5 2010
    Wed Apr 13 16:22:40 2022
     PolicyFile = D:\mdl\MicroStation\mdl\include\AssertPublicMicroStationPolicy.mki
    
    [== Building D:\mdl\MicroStation\mdl\objects\fplcommon.obj, (D:\mdl\fpl\devStudio\fplcommon\src\fplcommon.c) ==]
    cl  -Dtarget_is_dlm  -ID:\mdl\MicroStation\mdl\include -ID:\mdl\MicroStation\mdl\include\geom -ID:\mdl\MicroStation\mdl\include\shareids  -GS- -fp:fast -EHc -GR -GdF -D_X86_=1 -Di386=1 -c -W3 -DWIN32 -DwinNT -MD -D_VISCXX -Gy -wd4996 -Ox -Oy- -Os -D_SECURE_SCL_THROWS=1 -D_CONVERSION_DONT_USE_THREAD_LOCALE -D_SECURE_SCL=0 -DWIN32_LEAN_AND_MEAN   -nologo -WX -Zi -FdD:\mdl\MicroStation\mdl\objects\objects.pdb    -EHs  -arch:SSE2 -FoD:\mdl\MicroStation\mdl\objects\fplcommon.obj D:\mdl\fpl\devStudio\fplcommon\src\fplcommon.c 
    fplcommon.c
    
    [== Building D:\mdl\MicroStation\mdl\objects\fplcommon.dlo, (D:\mdl\fpl\devStudio\fplcommon\src\fplcommon.dls) ==]
    D:\mdl\MicroStation\mdl\bin\dlmspec @D:\mdl\MicroStation\mdl\objects\temp.cmd
    MicroStation Dynamic Load Specification Compiler 08.11.09
    
    [== Building D:\mdl\MicroStation\mdl\objects\dllentry.obj, (D:\mdl\MicroStation\mdl\library\dllentry.c) ==]
    cl  -Dtarget_is_dlm  -ID:\mdl\MicroStation\mdl\include -ID:\mdl\MicroStation\mdl\include\geom -ID:\mdl\MicroStation\mdl\include\shareids  -GS- -fp:fast -EHc -GR -GdF -D_X86_=1 -Di386=1 -c -W3 -DWIN32 -DwinNT -MD -D_VISCXX -Gy -wd4996 -Ox -Oy- -Os -D_SECURE_SCL_THROWS=1 -D_CONVERSION_DONT_USE_THREAD_LOCALE -D_SECURE_SCL=0 -DWIN32_LEAN_AND_MEAN   -nologo -WX -Zi -FdD:\mdl\MicroStation\mdl\objects\objects.pdb    -EHs  -arch:SSE2 -FoD:\mdl\MicroStation\mdl\objects\dllentry.obj -GS- D:\mdl\MicroStation\mdl\library\dllentry.c
    dllentry.c
    
    [== Building D:\mdl\MicroStation\mdl\objects\fplcommon.lib, (D:\mdl\MicroStation\mdl\objects\fplcommon.def) ==]
    lib @D:\mdl\MicroStation\mdl\objects\fplcommonlib.rsp
    Microsoft (R) Library Manager Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    -out:D:\mdl\MicroStation\mdl\objects\fplcommon.lib 
    -def:D:\mdl\MicroStation\mdl\objects\fplcommon.def 
    -machine:X86 
       Creating library D:\mdl\MicroStation\mdl\objects\fplcommon.lib and object D:\mdl\MicroStation\mdl\objects\fplcommon.exp
    
    [== Building "C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll", (D:\mdl\MicroStation\mdl\objects\fplcommon.obj) ==]
    link -out:"C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll"  -WX  -OPT:NoWin98    -Ignore:4087 -Ignore:4089 -Release   -debug -incremental:no -fixed:no @D:\mdl\MicroStation\mdl\objects\fplcommonlink.rsp
    Microsoft (R) Incremental Linker Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    -dll 
    "-out:C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll" 
    "-implib:D:\mdl\MicroStation\mdl\objects\fplcommon.lib" 
    -entry:LibMain@12 
    -map:D:\mdl\MicroStation\mdl\objects\fplcommon.map 
    "-pdb:C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.pdb" 
    -Fixed:no 
    -MANIFESTFILE:D:\mdl\MicroStation\mdl\objects\fplcommon.dll.Manifest 
    D:\mdl\MicroStation\mdl\objects\fplcommon.obj D:\mdl\MicroStation\mdl\library\dgnfileio.lib D:\mdl\MicroStation\mdl\library\toolsubs.lib D:\mdl\MicroStation\mdl\objects\dllentry.obj D:\mdl\MicroStation\mdl\objects\fplcommon.exp 
    D:\mdl\MicroStation\mdl\library\mdlbltin.lib 
    C:\PROGRA~2\MI30EB~1\VC\platformsdk\lib\gdi32.lib C:\PROGRA~2\MI30EB~1\VC\platformsdk\lib\user32.lib C:\PROGRA~2\MI30EB~1\VC\platformsdk\lib\kernel32.lib C:\PROGRA~2\MI30EB~1\VC\lib\msvcrt.lib 
    mt.exe -manifest D:\mdl\MicroStation\mdl\objects\fplcommon.dll.Manifest -outputresource:"C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll";2
    Microsoft (R) Manifest Tool version 5.2.3790.2075
    
    Copyright (c) Microsoft Corporation 2005. 
    
    All rights reserved.
    
    
    [== Building D:\mdl\MicroStation\mdl\objects\fplcommon.dlo, (D:\mdl\fpl\devStudio\fplcommon\src\fplcommon.dls) ==]
    D:\mdl\MicroStation\mdl\bin\dlmspec @D:\mdl\MicroStation\mdl\objects\make.opt
    MicroStation Dynamic Load Specification Compiler 08.11.09
    
    [== Building C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll, (C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll) ==]
    copy C:\PROGRA~2\Bentley\MICROS~1\MICROS~1\mdlapps\fplcommon.dll ..\bin\fplcommon.dll
            1 file(s) copied.
    Wed Apr 13 16:22:43 2022, elapsed time: 0:03
    

  • my knowledge of the intracacies of how make files work is limited

    I know how you feel. 

    Here's an updated version of your bmake file.  Keep in mind that I can't test it because I have none of your source code.  It's a shot in the dark...

    KenAdams.zip

     
    Regards, Jon Summers
    LA Solutions

Reply Children