Hello,
I start with the SDK.
I have Visual Studio 2017 and .NET 4.6.2 Framework installed
I have compiled examples and build a sample dll in c# and in c++
Everything builds successfully
- I can load c# "Hello world" sample.dll (created from c# template) in MicroStation
- I can load any .ma examples
- I get error message "MDL Loader: Could not load application" when trying to load c++ sample.dll (created from c++ template)
- I get error message "MDL Loader: Could not load application" when trying to load myapp.dll
Do you know why ?
Many thanks
Remy
Rémy Weill said:I get error message "MDL Loader: Could not load application" when trying to load c++ sample.dll (created from c++ template)
What do you mean by 'created from C++ template'?
A C++ app. must have a DllMdlApp resource. Look in ..\DialogBoxes\myapp\myappcmd.r to see an example. When you build your app, that resource is compiled and placed in your Weill.ma file. When you type mdl load Weill, MicroStation looks in that file to find the DLL name.
DllMdlApp
..\DialogBoxes\myapp\myappcmd.r
Weill.ma
mdl load Weill
Regards, Jon Summers LA Solutions
Jon Summers said:What do you mean by 'created from C++ template'?
Hello John
I mean I use the templates provided here: https://communities.bentley.com/products/programming/microstation_programming/m/mediagallery/274053
The C# sample works well while the c++ one compile but refuse to load
I can load .ma apps and .dll build from c# source code. I cannot load .dll build from c++ source code
Rémy
Hi Rémy,
Rémy Weill said:I can load .ma apps and .dll build from c# source code. I cannot load .dll build from c++ source code
it's not correct, because:
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hello Jan,
Ok. I was trying to load a .dll while I should have load the corresponding .ma file (But, I didn't find it)
Thanks for the explanation
Rémy Weill said:I was trying to load a .dll while I should have load the corresponding .ma file
in its basic (minimum) version, the only responsibility of .ma file is to define task id and in what dll file, the entry point (main() in normal C/C++ apps) is defined:
Rémy Weill said:But, I didn't find it
When application is built using bmake, there are always rules defined how to compile .r > .rsc and how to create .ma from this .rsc.
Hi Jan,
Jan Šlegr said:When application is built using bmake, there are always rules defined how to compile .r > .rsc and how to create .ma from this .rsc.
That is the trick. the myapp.ma file is not created in my case even if the rules are included in the myapprsc.mki file
The build process stops to the .mi file
Maybe this has something to do with the french version of microStation because of the attempt of translation ?
Hi Rémy Weill,
Can you confirm these two items?
Thank you,Bob
Hello Robert
Robert Hook said:Verify the MicroStation Developer Shell (shortcut properties) is set to Run as Administrator?
Yes it is.
Robert Hook said:Can you provide us with verbose build output logs?
Pleas find attachedBuild-myapp-Verbose-Output.txt
Rémy Weill said: the myapp.ma file is not created in my case even if the rules are included in the myapprsc.mki file
Please post your make (myapp.mke) and include (myapprsc.mki) files.
I suspect it does have something to do with your install of MicroStation, but in my honest opinion not (yet proven) related to language, but possibly due to timing and conditions (required).
The MicroStation SDK even though things have been improved (unfortunately) still requires Microsoft 8DOT3NAME compliance. So on the Drive letter and/or at the time you installed MicroStation; I suspect Microsoft 8DOT3NAMES were not (fully) enabled on your system.
The reason (and evidence from the log) I believe this is the case is because the MicroStation SDK path on your C: drive are definitely using 8DOT3 names; showing use of: e.g. MICROS~1.
Where your MicroStation Product path on your D: drive does not appear to be using Microsoft 8DOT3 names; showing incomplete paths and file names in the log.
I would suggest enabling Microsoft 8DOT3NAMES on your C: drive then simply re-installing MicroStation since this will ensure new/required 8DOT3NAMES will be generated and available to the MicroStation SDK. The alternate is to install MicroStation product in a path without having (any) spaces and this would accomplish the same effect.
Bob
Target: D:\Program[== Building D:\Program, (C:\Users\ADMINI~1\AppData\Local\Temp\Bentley\MICROS~1\objects\myapp.mi) ==]rlib @C:\Users\ADMINI~1\AppData\Local\Temp\Bentley\MICROS~1\objects\make.optMicroStation Resource Librarian 03.21.02Macro (myapprsc.mki:45): ERRORLEVEL=0End: C:\PROGRA~1\Bentley\MICROS~1\examples\DialogBoxes\myapp\myapprsc.mkiResume: C:\PROGRA~1\Bentley\MICROS~1\examples\DialogBoxes\myapp\myapp.mke at line 146End: C:\PROGRA~1\Bentley\MICROS~1\examples\DialogBoxes\myapp\myapp.mkeThu Oct 21 15:36:45 2021, elapsed time: 0:05
Answer Verified By: Rémy Weill
Hi Bob
I have enabled 8dot3names on drive D:
D:\>fsutil 8dot3name query d:
The volume state is: 0 (8dot3 name creation is enabled).The registry state is: 2 (Per volume setting - the default).
Based on the above two settings, 8dot3 name creation is enabled on d:
and unisnstall/reinstall MicroStation and sdk on drive D:
But it seems the problem is still there (even worse..)
D:\Program Files\Bentley\MICROS~2\examples\DialogBoxes\myapp\myapp.mke(58) : error : Missing Dependency: Files\Bentley\MICROS~2\examples\DialogBoxes\myapp\myappcmd.rBMAKE: call trace line: 58, D:\Program Files\Bentley\MICROS~2\examples\DialogBoxes\myapp\myapp.mkeFri Oct 22 12:51:58 2021, elapsed time: 0:01
Rémy Weill said:D:\Program Files\Bentley\MICROS~2\examples\DialogBoxes\myapp\myapp.mke(58) : error : Missing Dependency: Files\Bentley\MICROS~2\examples\DialogBoxes\myapp\myappcmd.r
The first file (myapp.mke) continues to use a Windows long file name D:\Program Files\....
myapp.mke
D:\Program Files\...
The error tells us that the build process can't find file Files\Bentley\ ... \myappcmd.r. In other words, the file path has been split at the space character in Program Files.
Files\Bentley\ ... \myappcmd.r
Program Files
Hello John,
Yes, I saw.
The problem is that changing shortname behavior only creates the short names for new files and folders. Not for existing ones.
I have rename Program files and reinstall and it's working now
Many thanks John, Bob and Jan for your help