Hey guys, I have two structs and I have two functions in two DLL's. DLL-A is attached to a process and collects data. When the data is requested by DLLB which is attached to a second process, DLLA maps the data for B to read.
The problem is, I cannot seem to get it to transfer structs or vectors. It transfers Integers perfectly fine but not Floats or objects/containers. Is there a way to share these across memory?
struct FontChar
{
GLuint ID;
GLchar Symbol;
GLboolean LastFont;
GLint TCount, VCount;
struct
{
GLint VX[4], VY[4];
GLint TX[4], TY[4];
} Quad;
};
struct Model
{
GLint SX, SY;
GLuint Stride;
unsigned long ID;
GLint TriangleCount;
GLboolean NullVertex;
GLboolean ShowVertices;
const GLvoid* VertexPointer;
std::vector<Vector3D> Vertices;
};
std::vector<Model> ListOfModels;
std::vector<FontChar> ListOfFonts;
//In my communication function for DLL-A, this is the one of two cases that do not work:
case GLHook_GetModels:
{
Data[1] = GLStatusReturned;
Data[3] = &ListOfModels[0];
}
break;
case GLHook_Fonts:
{
Data[1] = GLStatusReturned;
Data[3] = &ListOfFonts[0];
}
//Finally in DLL-B:
GL_EXPORT char* GLHGetTextArea(int X1, int Y1, int X2, int Y2)
{
int* Data = static_cast<int*>(RequestSharedMemory());
Data[0] = GLHook_GetTextArea;
Data[1] = GLStatusSent;
Data[3] = X1; Data[4] = Y1;
Data[5] = X2; Data[6] = Y2;
if (SharedDataFetched())
{
return reinterpret_cast<char*>(Data[7]);
}
return NULL;
}
GL_EXPORT void* GLHGetModels()
{
int* Data = static_cast<int*>(RequestSharedMemory());
Data[0] = GLHook_GetModels;
Data[1] = GLStatusSent;
if (SharedDataFetched())
{
return reinterpret_cast<void*>(Data[3]);
}
return NULL;
}