He he, I'm the first guy to post anything on this forum. OK here's my question.
How do you export functions etc in C++
I want to make a C++ back end for various VB projects I'd prefer to make a load of class mopdules but functions would be fine, I can write the C++ code I need and make the classes but I've learnt C++ mainly from seeing examples of windows programming so I know nothing about how to compile C++ code into anything apart from a console mode APP.
Are there any web sites etc that can show me how to connect to C++ (I can do the VB end)
You don't have to compile to a console mode APP. There
should be many different types of files you can compile
into that will fit your purpose better.(Static Libraries and DLL's). Try using one of these.
Since C++ Is an advanced language, I'd recommend reading
books to get you started. Teach yourself VC++ in 21 days is a great one for beginners.
If you are trying to learn then I recommend: Microsoft Visual C++ 5 by Steven Holzner or just simpy C++. It comes from sybex Inc, http://www.sybex.com
HTH
I'm working on something similar but the back end is a real time system. Does anyone know the performance hit that you'll take by compiling C code into a dll and then using VB as the front end? I'm not to savy with the MFC yet and it's going to take too long to get familiar enough with the classes to actually write the GUI using it. Am I right in thinking that a static DLL is going to be faster than a shared lib? It may just stay a console app if DLL performance is going to be slower..
um...rchiav...what d'you mean, static DLL? The idea of a DLL is that it is dynamic, so you resolve the names of functions at run time. The code runs at the same speed anyway, and if you statically link your library into your executable, then there's not much difference except it doesn't need to load the DLL into memory, find the function, and run it. Anyway, you _can_ statically link a C++ library into Visual Basic code, but it's one hell of a bumpy (and v. painful) ride...
Well I did some tests and it doesn't really run as fast. There's a performance hit when entering the dll. It's probably not noticeable in most applications but it is in what I'm working on. The program is staying as a console app for now. Eventually it will have a VC GUI once we get some other things ironed out.. thanks for your feedback..