C++/Using MSVC++ libraries in VB6
I am simply wanting to call a C++ function through Visual Basic 6.0, without making it dependent on any DLL files, or other files for that matter.
I want to make a simple, very basic, C++ function, and Reference it through VB.
What is the simplest way for me to compile C++ source code (I have access to MSVC++ but I do not care if it is another compiler), and to make it accessible through VB6 *WITHOUT* using Dynamic Linking: I need this to be a completely self-contained VB program.
I am getting frustrated as it seems like a simple concept, but I can't find any solution. I have noticed that some references VB has in its list are "TLB" file extensions, or Type-libraries. It is quite simple to create my own through VB, but when it comes to making one in C++, I only have choices of bloated object oriented projects which are confusing to understand.
Again, I am simply wanting to call a C++ function through VB, that's all! I know this may be possible through .NET, but I have VB6, not .NET.
Is there something I am missing? Sorry if this is from my lack of reading the manuals. It seems that this should not be a problem but I cannot find any simple solution.
Thanks if you can help.
belltheo , Thank you for your question.
I believe that Visual Basic does not support mixed-language executables. So the only way you can execute nontrivial C++ code is to put it into an ordinary DLL and on the VB side load the DLL and call a function in the DLL. There are examples of doing this in the MSDN library; it is not clear from your question what error messages you might be receiving.
I suggest that you post this question at www.experts-exchange.com, which is more advanced than allexperts.com.