Qbasicnews.com

Full Version: c++ wrapper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
what is this c++ wrapper i keep looking at for using C++ Header library's in freebasic?
Quote:what is this c++ wrapper i keep looking at for using C++ Header library's in freebasic?
I haven't heard of it.

There's the GCC frontend which should allow us to use C++ stuff, and other things from just about every other modern programming language AFAIK (Or maybe it's just that anything not written in C is usually written in C++ or ASM lolz)... Someone FBC smart please banish me to hell for my mistakes in this paragraph.
to use c++ library in fb using wrappers is possible. In this scenario wrapper is a thin layer that implements c++ library in a C procedural way.

Forxample wx-c is a wrapper that warps wxWidgets into C like api. or MFC that wraps winapi into more OOP style.

Anonymous

like, in c++ you can have an object with a bunch of methods, lets say your object is called myTimer and it has methos set, print, restore. then in c++ you could do like

Code:
myTimer::set()
myTimer::print()


but in procedural you need only function calls, so a wrapper would be like this (in fb pseudo code)

Code:
sub myTimer_Set()

  myTimer::set()

end sub


of course, it wouldnt be sub...end sub in c++, i just did that so it'd be easier to understand.