I have a dll that someone made me in C++. I needed to use this dll in VB, in order to do that I had to make another dll in C++ that has functions I can call in VB.
The C++ dll I made has 4 functions. 2 callback functions that retrieve information from the original C++. And 2 functions that I can call from VB to send that information.
I know the original dll works fine as Ive tested it endlessly in a console app.
However when I use it with my dll and VB.. I get random crashes.
There is almost no code in my VB app as its just for testing. It just outputs the information so theres no problem there.
I believe the problem is in the C++ dll I made. I am pretty new with C++.
I think maybe a variable gets accessed in 2spots at the same time (is this possible?) and causes it to crash?
Heres the basic layout of my C++ dll
char* info=new char;
//call back function 1
HANDLE OnInfo(SendInfo* tempInfo)
//function for vb
BSTR _stdcall vbInfo()
allInfo=allInfo.Right(20000); //get last 20,000 characters
Message = SysAllocStringByteLen (info, lstrlen(info));
Crash seems to happen completely randomly.