Error 193 loading custom application

I created an .MA application and corresponding dll using Visual Studio 14.0.

When launching MicroStation CE version 10.16.00.80, I specify a specific configuration (-wu<config>) on the command line which contains the entry MS_DGNAPPS indicating that my application should be loaded at startup.

Works great.

So far, so good.

On a different PC, I have the very same version of MicroStation but at startup it gives me error 193 (the OS could not load myappl.dll).

I did some googling and this error should indicate that I'm trying to load a 32 bit DLL, which is not true (I checked it with DUMPBIN /HEADERS).

Within MicroStation I tried to load the MDL manually (Ribbon Design/Utilities/MDL applications). It does show me my custom applications but when trying to load one of them, I get the very same error.

I'm quite sure I'm missing something stupid but I can't figure out what it is.

Thanks,

Robert

Parents Reply Children
  • when MicroStation CONNECT Update 16.1 releases Microsoft Visual Studio 2019 (MSVC 14.2) will be the default toolset required [for C++]

    What are the .NET requirements for Update 16.1?

     
    Regards, Jon Summers
    LA Solutions

  • Hi ,

    Unless something changes, it looks like we are still requiring and supporting Microsoft .NET Framework 4.6.2; that Microsoft supports beyond April 26, 2022 (the date lesser framework versions/releases loose support on).

    HTH,
    Bob



  • Hi Robert,

    Thanks for your reply. I'll check it out and be back to you.

    The question is: how come everyting does work on the PC on which I compiled everything? 

  • Hi Robert.

    I was wrong when I said I compile with VS 14.0. It appears to be VS 2019 version 14.16.27023.

    Does that make any difference?

    Below find the installed versions on the PC that works (the first image) and the one that does not work (the 2nd).

  • Below find the installed versions on the PC that works (the first image) and the one that does not work (the 2nd)

    The working computer has a later version (14.29.30038) of the Microsoft C++ redistributable library.

    How do you install your app?  Using XCopy or a genuine installer such as Lindersoft SetupBuilder?  You should ensure that the target computer is updated with the same version of the C++ redistributable library as your development computer.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Robert,

    I was wrong when I said I compile with VS 14.0. It appears to be VS 2019 version 14.16.27023.

    Visual Studio 2019 is not supported (but will be in CE Update 16.1). You have to use Visual Studio 2017.

    There is a way, how to use VS2019, but it requires to be MSVC and Visual Studio guru to ensure the right toolset (MSVCRT verison) is used, and also modification of mki file(s) is necessary. Probably there is no serious reason why to choose such way.

    Below find the installed versions on the PC that works

    I agree with Jon the problem is caused probably by wrong (or missing) version of MSVCRT. When the right tools are used, the problem does not exist, because both MicroStation and Visual Studio compiler use the same MSVCRT.

    Below find the installed versions on the PC

    I can see you use MicroStation SDK CE U14 with MicroStation CE U16. Are you serious about such development style?

    For every MicroStation version, proper SDK version was released. Exceptions existed, but it's not the case of U16, where SDK CE U16 is available.

    When you prefer to use C++ to create native applications for MicroStation, to follow strict rules about used tools and their versions is mandatory. Otherwise the result is not predictable and unstable. To combine some version of MicroStation with another SDK, in parallel to unsupported Visual Studio version, just cannot lead to robust result.

    With regards,

      Jan

  • When creating my development environment, I simply installed the latest version of VS. I'll try to uninstall VS2019 and install VS2017.

    MS CE Update 16 was installed when the Connection Client suggested me to do so. I didn't know about SDK update 16.

    I'll start from scratch and see what happens.

    Thank you so far

  • I got various versions of Windows SDK on my PC. Can I simply uninstall them after having uninstalled VS 2019? Does the installation of VS 2017 include the correct version of Windows SDK?

    Thanks,

  • I got various versions of Windows SDK on my PC. Can I simply uninstall them after having uninstalled VS 2019? Does the installation of VS 2017 include the correct version of Windows SDK?

    Those are questions for a Microsoft support site.  We're happy to advise about MicroStation development on this Forum, and there are many more people on other Forums who like to discuss Viz Studio and the Windows SDK.

     
    Regards, Jon Summers
    LA Solutions

  • Hi Robert,

    When creating my development environment, I simply installed the latest version of VS.

    honestly, I do not understand the logic. When I want to develop anything in any language, using any tool, the first thing is to check and follow prerequisites exactly (regardless it's MicroStation using C++ or iTwin.js using TypeScript). It's never like "just to install the latest version", even in a case of such flexible environment like NET ... and especially not in the case of C/C++, famous because of problems with MSVCRT versions and "dll hell".

    I'll try to uninstall VS2019 and install VS2017.

    There is no reason to uninstall VS2019, when used for another projects. I typically have 2 or 3 versions installed in parallel, of course not as full installations (because it does not makes sense and consumes too much space), but in configurations containing what I need for active projects.

    Because I use VS2019 for all NET development, I typically use it as editor for C++ code also. When such code is compiled using bmake, VS2017 (C++ compiler/linker) is used automatically, so no compatibility problem exists.

    MS CE Update 16 was installed when the Connection Client suggested me to do so.

    It's automatic, no exceptions: When new MicroStation version is installed and you want to develop application for such version, you have to reinstall SDK also.

    When new MicroStation or MicroStation SDK is released, it's announced in MicroStation Announcements forum, so there is no obstacle to be informed when a pair Microstation + SDK is available.

    I'll start from scratch and see what happens.

    When new MicroStation SDK is installed, it's always recommended to try to compile (all) delivered examples and to test some, to test everything is installed and set correctly.

    I got various versions of Windows SDK on my PC. Can I simply uninstall them after having uninstalled VS 2019?

    It's up to you, whether you need them or not.

    Does the installation of VS 2017 include the correct version of Windows SDK?

    I am not sure what do you mean by "correct version of Windows SDK". "Correct" for what? If you mean "for MicroStation", I recommend to check SDK release announcement, where required VS parts are mentioned, Also, what is necessary from Visual Studio installation was discussed several times in this forum, so use search.

    When you need any specific version of Windows SDK for other project than MicroStation, it makes sense to install it independently from Microsoft archive, because Windows SDK is independent completely. Visual Studio should be able to recognize the installation automatically (even when maybe does not work when the latest SDK and old VS combination is used).

    Regards,

      Jan