compiler: VC++ 6.0.
we are relatively new to C++ programming. we are trying to access a DLL, created in VB6, from C++.
to use the DLL, we used the #import command, and some other functions that were shown in a tutorial that we don't remember where we found.
initializing the DLL (COM) works; the problem arises when we try to call a function of it. the program's code is below. the VB DLL's project is named mbr and it contains a class named mbrl. when the function t->speak(...) is called, the following error happens:
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention."
here is the code (a small program):
thank you in advance.
using namespace std;
using namespace mbr;
int main(int argc, char* argv)
_bstr_t bstrValue("k 100 100\n");
freqe = 1;
dure = 1;
vole = 1;
pite = 1;
if(hresult == S_OK)
returne = t->speak(bstrValue, freqe, dure, vole, pite, dbe, oute); // <- ERROR HAPPENS HERE