[CONNECT Update 12 C] 'native C' migration from V8i

Hello,

I am on a migration project from V8i (native C) to CONNECT.
Different messages found on different forums are not clear for me...
The existing project is composed of 50000 lines of code - native C.
My goal is to minimise the changes to complete the migration.
==> The main question is "are native C projets still supported with CONNECT edition ?"

It seems that the migrate tool is *just* a string remapping from old V8i/C to CONNECT/C++.
For example, the constant 'UNIT_ANGLE_Radians' is remapped by 'StandardUnit::AngleRadians'
Surely this kind of syntax cannot be compiled in C file (but in a C++ file).
How can I use this tool if I want to stay in native C ?

It seems that the provided makefiles are not working with .C extension files.
The following message is displayed when the source file is a .C one : "This file is for C++ compilands only"
Is there a way to use those makefiles (with a define or someting) or are there specific makefiles available ?
 
On the other hand MicroStationCONNECTSDK\include\Mstn\MdlApi contains the needed .H (and .FDF) files with the 'C' functions prototypes.
For example 'mdlScan_initialize()' defined in msscan.fdf found in V8i SDK and CONNECT SDK.
So to me it must be a way keep using those old 'native C' API... No ?

Thanks a lot, Pascal.

Parents
  • the constant 'UNIT_ANGLE_Radians' is remapped by 'StandardUnit::AngleRadians'
    Surely this kind of syntax cannot be compiled in C file

    The C++ MicroStationAPI makes extensive use of namespaces, classes, smart pointers and templates, all of which are alien to C.

    I want to stay in native C

    That's a bad strategy.  We've been able to use C++ to write more functional, more concise, more readable, more reliable and higher performance applications than MDL since MicroStation V8 2004 Edition.  That was fifteen or more years ago.  But keep in mind that the ISO C++ standard is compatible with ISO C.

    it must be a way keep using those old 'native C' API

    Since MicroStation V8 2004 Edition, new functionality has been provided by the MicroStationAPI.  For example, the valuable GraphicElementEnumerator class has no MDL analogue.  Expect MDL to diminish while the MicroStationAPI grows.

    Much of MDL/C relied on complex macros and 'magic numbers'.  The MicroStationAPI eschews that style of secret programming in favour of a well-designed interface.

    For example 'mdlScan_initialize()'

    The mdlScan_api is an example of a horrible C interface.  Its use depends on a set of complex macros to select element types, and extensive bit-twiddling to choose levels.  Its design emulated Intergraph's hardware DGN file scanner, which was a physical bolt-on to the mini-computers used by their customers.

    With the MicroStationAPI, you can more simply enumerate elements.  You can abandon the mdlScan_api, although you might occasionally find a need to use its better-designed descendant, the mdlScanCriteria_api.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • the constant 'UNIT_ANGLE_Radians' is remapped by 'StandardUnit::AngleRadians'
    Surely this kind of syntax cannot be compiled in C file

    The C++ MicroStationAPI makes extensive use of namespaces, classes, smart pointers and templates, all of which are alien to C.

    I want to stay in native C

    That's a bad strategy.  We've been able to use C++ to write more functional, more concise, more readable, more reliable and higher performance applications than MDL since MicroStation V8 2004 Edition.  That was fifteen or more years ago.  But keep in mind that the ISO C++ standard is compatible with ISO C.

    it must be a way keep using those old 'native C' API

    Since MicroStation V8 2004 Edition, new functionality has been provided by the MicroStationAPI.  For example, the valuable GraphicElementEnumerator class has no MDL analogue.  Expect MDL to diminish while the MicroStationAPI grows.

    Much of MDL/C relied on complex macros and 'magic numbers'.  The MicroStationAPI eschews that style of secret programming in favour of a well-designed interface.

    For example 'mdlScan_initialize()'

    The mdlScan_api is an example of a horrible C interface.  Its use depends on a set of complex macros to select element types, and extensive bit-twiddling to choose levels.  Its design emulated Intergraph's hardware DGN file scanner, which was a physical bolt-on to the mini-computers used by their customers.

    With the MicroStationAPI, you can more simply enumerate elements.  You can abandon the mdlScan_api, although you might occasionally find a need to use its better-designed descendant, the mdlScanCriteria_api.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data