What version of C++

What version of C++ (M$ Visual C++ 6.0) is required to create a native Win32 application to interface with Ustn V8i via. mdl?
Parents
  • I happen to have MicroSoft VS2005 Pro, so I am interested in using it for mdl. But I have not the slightest idea how to do that. There are some projects for NativeCode in the examples; I tried to compile "cellexp", but I didn't succeed at all (I must also confess that I cannot get on very well with the Bentley-style makefiles). Would there by any chance be an example project to show how to use VS2005?

    regards, Jan Willem

Reply
  • I happen to have MicroSoft VS2005 Pro, so I am interested in using it for mdl. But I have not the slightest idea how to do that. There are some projects for NativeCode in the examples; I tried to compile "cellexp", but I didn't succeed at all (I must also confess that I cannot get on very well with the Bentley-style makefiles). Would there by any chance be an example project to show how to use VS2005?

    regards, Jan Willem

Children
  • Hi Jan,

    Make a copy of the mstndevvars.bat file and give it a name that defines the version of Microstation that it will be used with, as you can do this for all versions, not just V8i.  Edit the file and add the following line to the end of it.

     "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe"

     

    Next, create a shortcut to your new batch file (I've got mine on my quickstart bar), right-click to go to the shortcut properties and add the following line to the 'Target' line.

    "C:\Documents and Settings\jwillem\My Documents\Visual Studio 2005\VS2005_V8i.bat" "C:\Program Files\Bentley\MicroStation V8i\MicroStation\" "C:\Program Files\Bentley\MicroStation V8i\MicroStation\"

    I also change the icon to help identify the version of Microstation this shortcut is used with, but... That's it.  This shortcut will open Visual Studio and set up all the relevant paths etc for MDL development.

    P.S. you may also want to add the path for the MDL header files to your projects (Project->Name Properties->Configuration Properties->C++->General->Additional Include Directories), to give you the browse and intellisense information.

    "C:\Program Files\Bentley\MicroStation\mdl\include"

     Micheal

  • Hi Jan Willem,

    lets divide your problem into 2 areas: How to compile examples delivered with MicroStation SDK and how to wrote your own native code application:

    Cellexp and other delivered examples: What happen if you start MicroStation Developer Shell (Bentley V8i > MicroStation V8i SDK > MicroStation Developer Shell), go to cellexp directory and compile the example with bmake cellexp command? If both your MicroStation and VisualStudio installations are fine, the application should be compiled without error message.

    It is recommended to compile the application not from VisualStudio, but from Developer Shell with bmake, as both Shell and bmake do a lot of work for you. Until you will be not able to compile standard examples, I think it is not good to start own development, as the successful compilation is a proof that your installation and configuration are fine.

    Native code application development: There are some material available on Wiki, e.g. BDN articles (http://communities.bentley.com/Administrators/Wiki/w/Wiki/bdnzine-articles.aspx) like MDL - Native Code Application Development. And of course check BDN forum (http://communities.bentley.com/Programs/Bentley_Developer_Network/f/267.aspx).

    HTH Jan

  • Implement an MDL Application in a DLL using VC++

    Jan:
    I happen to have MicroSoft VS2005 Pro, so I am interested in using it for MDL.

    When you write an MicroStation Development Library (MDL) application using Visual C++, you aim to create a DLL. You will:

    1. Moving all executable code into .cpp files
    2. Call into the MDL just as you would call a Win32 function
    3. #include the MDL function prototype (.fdf) and other header .h files so the C++ compiler understands the calls
    4. Link with the MDL library files

    Some resource data can continue to live in (.r) files that you compile using the Bentley tools. For example, you can implement dialog boxes using MDL resources or use Microsoft Foundation Library (MFC) or Windows Template Library (WTL) resources. It's also moot whether you should store messages in MDL (.r) files or VC++ string tables.

    There's some information about:

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • hello Jon, Jan and Michael,

    I am going to try all of your suggestions in a couple of days. I am very curious. Thanks a lot.

    Jan Willem

  • Hi Jan,

    I forgot to mention how to set up an external tool for the bmake command.  Go to Tools->External Tools... to open the External Tools dialog.  Click the Add button and enter the following and uncheck all options except for Use Output Window:

    Title: BmakeCommand: C:\Program Files\Bentley\MicroStation V8i\MicroStation\mdl\bin\bmake.exeArguments: -lw $(TargetName)Initial Directory: $(ProjectDir)

    Do this for both the Bmake and Bmake All (arguments = -lwa $TargetName) commands and add buttons for these commands to a new or existing toolbar via the Customise menu.

    I agree that until you know you can compile an application, use the developers shell.  After that, forget it!  If you compile your applications using the external tool and have the Use Output Window checked, all error messages are directed to the output window and can be double-clicked to drive you directly to the error (rather than wading through the output in the developers shell and entering line numbers with the Ctrl+G command).

    Micheal