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...
Unknown said:Getting sucked back into the MicroStation world
Welcome back! Which version (e.g. v10.x.y.z) of MicroStation are you using?
Regards, Jon Summers LA Solutions
Thanks, Jon
SDK version is v08.11.09
MicroSation is v8i SS3 (v08.11.09.578)
Located in C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\Documentation folder should be two chm files. MDLAPIFunctionReference.chm and MDLProgrammerGuide.chm.
Your path name could be slightly different.
mdlBitMask_logicalOperation is described in the Function reference. Search for mdlBitMask_logicalOperation and you should find the description of the function.
Jon can probably describe exactly what the code is doing but my guess looking at the call is it's trying to turn on any levels that are on in the "j" file on in the "k" file while leaving alone any levels already on in "k" since it's doing an "OR". (Again, this is a guess so I could be completely wrong).
In any case, if you didn't already know about the two documentation files they should be helpful to you. I believe they get installed when you install the SDK so they won't be there otherwise.
Regards,
Mike Lazear
Thanks, Mike. I did find those help files. I'll have a closer look through them to decipher what this code is actually doing
I should state the error is:
error: '=' : incompatible pointer types from 'struct BitMask *' to 'struct BitMask'
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.
Thanks for the links, Jon! Will have a look
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!!
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
Ah, ok. Thanks, Jon!