[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
  • Good evening

    Thank you very much for the full and fast answers.

    First I don't doubt it is a good idea to follow the evolution imposed by the connect ecosystem (C++ and so on).
    Unfortunately rewriting with new API and new language means understand what the code does and then rewrite (and optionaly optimize) it with C++.
    My knowledge is much higher in C programming than in CAD :-)
    So if the migration consists in mechanical substitutions it's fine for me.

    Concerning the MicroStationCONNECT_MigrationWorkshop.pptx
    May be want I to read and understand only what would please me, but page 91, I can read that 'MDL C API (native)' is a supported platform (also page 42).
    OK it's the third choice but if it is still working, it's fine for me ;-). 

    I want to be 100% sure rewriting is C++ this is the only way to migrate.
    If so, the planning and the needed resources to complete this project won't certainly be the same !!

    Thanks again, Pascal

  • Hi Pascal,

    I can read that 'MDL C API (native)' is a supported platform (also page 42).

    I think it's not ideal formulation. In my opinion your can use "pure C" concepts (no own classes, functions only) as long as you will be compatible with API, which is strongly typed C++ (so the code has to be compiled as C++). Because I have had no reason, I have never checked new API whether any "C only" parts exist.

    I am sure is able to provide more details as he lead the workshop.

    I want to be 100% sure rewriting is C++ this is the only way to migrate.

    My feeling is that several different options with different level of complexity are mixed in this discussion:

    What is required is to make your code compatible with the new API. Technically it means to use C++ constructions where it's required by API, which is mostly about replacement of old macros by strongly typed enums and similar modifications (methods names...). Even this step can require a lot of work, but mostly mechanical. On the other hand, when the code is old, a substantial part of necessary modifications are not because of new C++ API, but because of new compiler is more strict and does not accept old code.

    What is recommended (but not mandatory) is to remove old C constructions and replace it with new, better and more robust, classes. It's what Jon and Volker recommend (I agree, scanning in C is complicated, today iteration is simple), but it should be second optional step in my opinion, because without perfect knowledge what the code does it will be quite risky.

    My knowledge is much higher in C programming than in CAD :-)

    You will need somebody with MicroStation knowledge anyway, at least from these reasons:

    • MicroStation CONNECT Edition is very different from V8i, especially in GUI, so it has to be evaluated whether old application (GUI, dialogs etc.) can be used in new GUI to do not make users too much confused.
    • The code functionality, especially when the application has long history, should be analysed for an overlap with existing MicroStation tools. I remember one migrated (not very complex) application, where we were able to remove about 50% of the code because the same functionality exists now in MicroStation. To make the transition as simple as possible, the application GUI remained the same (old toolboxes), but standard MicroStation tools were called at background.
    If so, the planning and the needed resources to complete this project won't certainly be the same !!

    The migration may require a huge amount of work, especially when code is old, undocumented and poorly written. It's hard to guess upfront. But for sure it's not about "recompilation only".

    With regards,

      Jan

Reply
  • Hi Pascal,

    I can read that 'MDL C API (native)' is a supported platform (also page 42).

    I think it's not ideal formulation. In my opinion your can use "pure C" concepts (no own classes, functions only) as long as you will be compatible with API, which is strongly typed C++ (so the code has to be compiled as C++). Because I have had no reason, I have never checked new API whether any "C only" parts exist.

    I am sure is able to provide more details as he lead the workshop.

    I want to be 100% sure rewriting is C++ this is the only way to migrate.

    My feeling is that several different options with different level of complexity are mixed in this discussion:

    What is required is to make your code compatible with the new API. Technically it means to use C++ constructions where it's required by API, which is mostly about replacement of old macros by strongly typed enums and similar modifications (methods names...). Even this step can require a lot of work, but mostly mechanical. On the other hand, when the code is old, a substantial part of necessary modifications are not because of new C++ API, but because of new compiler is more strict and does not accept old code.

    What is recommended (but not mandatory) is to remove old C constructions and replace it with new, better and more robust, classes. It's what Jon and Volker recommend (I agree, scanning in C is complicated, today iteration is simple), but it should be second optional step in my opinion, because without perfect knowledge what the code does it will be quite risky.

    My knowledge is much higher in C programming than in CAD :-)

    You will need somebody with MicroStation knowledge anyway, at least from these reasons:

    • MicroStation CONNECT Edition is very different from V8i, especially in GUI, so it has to be evaluated whether old application (GUI, dialogs etc.) can be used in new GUI to do not make users too much confused.
    • The code functionality, especially when the application has long history, should be analysed for an overlap with existing MicroStation tools. I remember one migrated (not very complex) application, where we were able to remove about 50% of the code because the same functionality exists now in MicroStation. To make the transition as simple as possible, the application GUI remained the same (old toolboxes), but standard MicroStation tools were called at background.
    If so, the planning and the needed resources to complete this project won't certainly be the same !!

    The migration may require a huge amount of work, especially when code is old, undocumented and poorly written. It's hard to guess upfront. But for sure it's not about "recompilation only".

    With regards,

      Jan

Children
No Data