[CONNECT C++] Setting up C++ Visual Studio Project problems

hoping someone might be able to help me out. I have been writing addins in C#, but now im trying to start out with using c++/Cli for some wrappers. but I'm getting errors from the start...

here are the steps I took to create a c++/Cli  class project.

1.open VS2015 and create new c++/CLI class project,

2. close and open the sln file from MicroStation SDK command prompt

3. add include location to properties.

4. add lib location to properties

5. then all I did was start to add using statements to my header file. I only added #include<Mstn\MdlApi\MdlApi.h>

once I added that I got 2 errors.

cannot open source file "_config-eccp.h"

and #error directive: Data Alignment must be defined in basedefs.h.

im a newbie what it comes to c++...

Parents Reply Children
  • Hi ,

    Thank you for the update and feedback (and code snips) and certainly glad to hear you are making more progress. Also, if one or more contributions on this thread helped resolve the post, please feel free to mark one or more of the responses as More > Verify Answer so other users can quickly pick up relevant pieces towards a solution.

    Again, thank you for your update.

    Bob



  • a c++/CLI example would be great.

    Well, I am aware one existing example delivered right now with MicroStation SDK is not "a lot", but at least there is some code to start with.

    I would like to see an example of wrapping a function so c# developers and use things like adding fields to text like the CreateForElement function.

    There are tens and problably hundreds of "how to wrap native for managed access" available on Internet in a form of blogs, discussions and tutorials. And there is literaly no difference between some native class and MicroStation one.

    write a function and export it to c.

    It's funny to see how personal perspectives, based on different experiences, can be different: I treat this approach more complicated than to write the wrapper in C++/CLI ;-)

    With regards,

      Jan

  • Jan,

    There are tens and problably hundreds of "how to wrap native for managed access"

    while I agree that there are examples out there. and I have used them. and have successfully created ones. the main difference I guess comes down to the bmake files I think, which the example does have some stuff.

    but I was more so talking about an c++/cli example as a visual studio project (with a solution file I can open). I cant get that part to work, most likely because of the make files if I had to guess.

    It's funny to see how personal perspectives, based on different experiences

    yeah I tried to go the cli route first, just not good enough with the make files. the export to c route was really easy, but only after using the visual studio extensions Robert linked..since the main problem im having is with the set up. Too bad this stuff wasn't in .net then I wouldn't have to go down this road...im great with c#..i try to avoid c++.