Can we build a Microstation Application(C++, dll)just with Visual studio, just as we develop a general dll?

Hi Experts, 

    I am new to Microstation Application(C++) development,  and i have no experience about the make file configuration, and would like to write, compile and link code with just Visual studio, so my question is whether we can avoid to use Miscrostation SDK tool to build and link the C++ code,

can we just configure the Visual Studio project to reference the right Include head files, and the reference .lib files, then build the dll, load by Microstation?

   I have read a lot thread in the forum,and  start with this wiki: https://communities.bentley.com/communities/other_communities/bdn_other_communities/b/bdn-blog/posts/mdl-1  

   to build my first application, but the environment configuration is really difficult for me,  i can't successfully build the Hello application.

thanks,

Rick

  • Hi Rick,

    the answer is "mostly yes" technically, but "no" in practice.

    A process of building C/C++ application is not magic ... despite of for many people who learned programming through GUIs only ("push the button to build the app" workflow) it may looks like the magic ;-), because they are not aware of compilation of separate modules, linkging libraries and merging all object files into target file that happen in background.

    MicroStation Development shell "only" creates corectly configured environment, a set of mki files provides rules for nearly any potential situation and task, so bmake is able to call different tools (C++ compiler, linker, Bentley proprietary tools etc.) properly. Visual Studio uses MSBuild (if not configured to use different make tool) in exactly the same way: It opens shell in the background and starts MSBuild that consumes a project file (csproj...) and builds the application.

    MicroStation applications are normal native code dlls and standard Visual C++ compiler is called by bmake, so if you will set up Visual Studio project in such way that the same compiler and linker parameters will be used, you should receive the same result, compatible with MicroStation. But it requires pretty good knowledge of Visual Studio C++ project configuration and also VS C++ compiler and linker parameters.

    You should be aware there are some files, that cannot be compiled by Visual Studio tools itself, because they are not standard C++ files. Usually the application needs to have command table and every native code application has to have DLL loader specification (small ma file that loads dll file). These types of files have to be compiled using MicroStation SDK tools (rcomp.exe), but not necessarily by bmake (maybe simple batch file is enough in this case).

    So the question is: What is easier / More cpmplicated: To learn how to write own bmake file or to go deep into Visual Studio C project configuration? It depends on local conditions and skills, I know some people use bmake and some Visual Studio. I usually configure Visual Studio to call bmake files at background (in other words, I have never been patient enough to try to configure tens of parameters of VS project to be able to remove bmake ;-)

    With regards,

      Jan

    Answer Verified By: Rick cheng 

  • There is a company called Innovocad, https://www.innovocad.com/ that provides rather nice integration between MicroStation an Visual Studio. The provide template projects for C++ and C#, addins and dll's.

    /Krister

    Owner consultant at Surell Consulting AB

  • thanks, i am already configured the VS2005 to build the MDL application