C++ Lib -> Dll (Wrapper)

chuawenching

Well-known member
Joined
Jul 26, 2003
Messages
66
Hi there.

I want to write a managed c++.net wrapper for the physics engine Tokamak. The problem is i had no experience in c++ except c#.

I want to write a wrapper for tokamak so that my c# samples can reference to that dll and implement together with Directx 9.

The problem is i dont know how to start?

Should i choose c++.net at the first place or i should go to unmanaged c++ to do all this.

Can you guys tell me what are the tutorials which i need to pick up along the way to achieve that?

I had the time and willing to learn. Just no idea how to start.

Thanks.

Regards,
Chua Wen Ching :p
 
First Learn c++ I recomend reading one of those in 21 days books or similar to get you familliar with the syntax and oop in c++ and take some classes at a local college (There usualy pretty good and cheap). C# and C++ .Net are quite a bit different than C++ 6, The advantage is your code wil be reusable and most large projects are in C++ .Then you will see that there is no advantage (in this case) using C++ .Net. If you need more help getting started seek the help of a local guru, you probably know one and dont know it.

VSNT
BABCS
 
Have you considered other engine, such as ODE, to handle your physics? It may have the same compiling/language problems, but at least you get the source code...

I havent worked with Tokamak so I cant say how it works. If it just exposes functions, you can probably work with C# by creating all the propery DllImport lines in your C# code.

Of course the easiest way to use that engine would be to use C++, but that means learning C++ which is generally a LOT more than just the language. This is different than C#, which you can learn relatively quickly. If you want to learn C++, Id first go through a C++ book, NOT a Visual Studio C++ book. Youll really want to learn C++ before you learn C++ in .NET.

After you feel comfortable with C++ (maybe as soon as week or two, depending on how much time you have and how fast you learn), you can use a Visual Studio C++ or C++ .NET book to learn about C++ in .NET, or just read through some online tutorials and MSDN. The big issue is setting up include directories, library directories, excluding libraries, etc.

If Tokamak is made for standard C++ libraries, you might also run into issues using managed C++ if youre using .NET 2003. They moved a bunch of the standard libraries, such as iostream, to a new namespace and it means pretty much NO compatability with older C++ code. Its a pain.

If you get that far, ask lots of questions, maybe we can help :)

-Nerseus
 
Back
Top