Sharing data between apps via DLL
How can I do this? I've reseached on Google for about 10 hours, tried
what I found and nothing works.
Dev: Visual Studio 2010 C++
App1: Metatrader 4
App2: Metatrader 4 (Different instance).
I can send data to the DLL, do some math, and send back to the same
instance. That works beautifully. But trying to go in between apps
is getting to be a nightmare.
Can this even be done? If so, how? My C++ is sooooooooo old.
Here's the code that have:
..cpp:
#define WIN32_LEAN_AND_MEAN
#define MT4_EXPFUNC _declspec(dllexport)
//Global variables w/ Global scope in DLL ONLY!
#pragma data_seg (".myseg")
double varIBFX, varAlpari;
#pragma data_seg()
//For IBFX to put data and get back from Alpari
MT4_EXPFUNC double _stdcall GetValueForIBFXFromAlpari(double
varPutValue)
{
varIBFX=varPutValue;
return(varAlpari);
}
//For IBFX to put data and get back from Alpari
MT4_EXPFUNC double _stdcall GetValueForAlapriFromIBFX(double
varPutValue)
{
varAlpari=varPutValue;
return(varIBFX);
}
code for .def:
LIBRARY "EURUSD"
EXPORTS
GetValueForIBFXFromAlpari
GetValueForAlapriFromIBFX
SECTIONS
.MYSEG READ WRITE SHARED
I know these don't look like they do much, but I need to get the pass
off to work first. Then I can start the "good stuff".