Hello. New guy here...well, old new guy :D
Was a MicroStation user for many years (many years ago) and took the one and only MDL programming course that was available at the time. Getting sucked back into the MicroStation world and trying to recompile an MDL app. I'm slowly working my way through it, but have hit something I'm not sure how to fix. I looked and am not finding much in the help files.
The offending line of code is:
mdlBitMask_logicalOperation( (*type)->view.files[k].levels, view->files[j].levels, BITMASK_OR);
I understand the the arguments are now BitMaskP and BitMaskCP, but just have no idea what the above code is doing. Are there resources out there to explain what this syntax means?
Thanks in advance for any direction...
Thank you, Jan!
Hi Bruce,
your questions are about to understand how C and C++ code is compiled to object files and linked to exe or dll. This process is not specific to MDL, so you can use any C (e.g. GCC) tutorial. There are some differences (especially resources, that are not part of standard C/C++ but specific to MicroStation), but it's quite similar.
I guess you should start with Building Application chapter in MicroStation Programmer Guide.
Unknown said:How do I know what is being used?
There is no simple answer, because it's developer's responsibility to maintain clean file and folder structure. Compiler and linker only process defined files and don't care about others.
When an editor like Visual Studio is configured properly, it can help, because dev editors are able to parse C files (despite of it's not C but "MicroStation version of C") and to understand all #include statements.
Another way can be to create a list of source files and to fulltext search other file whether they are used there or in mke file.
And if there are not many files, you can remove everything except mke file, start compilation again and again and to return back removed files, but in every step only the file reported as missing.
Unknown said:Does the .mke file tell me everything I need to keep?
In idea case yes, but the world is not ideal. But it's good start.
Unknown said:I guess I'm asking how to FORCE a compile in case you are not sure if the existing .ma file was created from the existing source.
There are two way how to achieve the full recompilation:
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
So, I got this thing to compile :-) Thanks for help provided thus far!!!!
My next question is...there's a whole lot of files in the folder structure for this thing. For clarity, I would like to remove anything not required to build this MDL app. How do I know what is being used? Obviously the ones I had to edit are being used. Does the .mke file tell me everything I need to keep?
Also, I tried to recompile a different app, but nothing new got created when I ran bmake for that app. Is that because there were no changes to any of the source files? The only file that changed was the make.opt file. I guess I'm asking how to FORCE a compile in case you are not sure if the existing .ma file was created from the existing source.
Thanks again!!
As Jon stated -> is the pointer operator. In essence it's a shortcut for (*info).num_file. It reads better and is commonly used.
Ah, ok. Thanks, Jon!
Unknown said:What does the "->" mean in the offending code?
That is the pointer operator. Use it to get at the nested contents of a pointer...
typedef views_info ViewsInfo; ViewsInfo* info = ... get info from somewhere // Get num_files value info->num_files
Regards, Jon Summers LA Solutions
The comments in the code indicate *type is a pointer argument passed to this function (get_type). The view variable in the offending code is defined:
Views_Info *view
Views_Info is a custom typedef:
typedef struct views_info{ int num_files; char name[64]; char label[64]; Files_Info *files;}
Files_Info is a custom typedef:
typedef struct files_info{ int mode; char name[MAXFILELENGTH]; // GDG Sep 2006 char logical_pre[64]; char logical_post[64]; short level_num; short level_val; BitMaskP *levels;} Files_Info;
What does the "->" mean in the offending code?
Thanks again for the help!!
Thanks for the links, Jon! Will have a look
Unknown said: incompatible pointer types from 'struct BitMask *' to 'struct BitMask'
The compiler is telling you that it expected a pointer but you passed an unqualified variable. Without more information I can't say what the problem is, but probably you need to write &variable rather than plain old variable.
&variable
variable
Unknown said:I understand the the arguments are now BitMaskP and BitMaskCP
This article about MDL Structures, Typedefs, and #include may throw some light on those type names.
I should state the error is:
error: '=' : incompatible pointer types from 'struct BitMask *' to 'struct BitMask'