Q:

Quick one: GetProcAddress of Struct member?

Let's say I have the following definition of a struct in a DLL:
typedef struct {
    double varOne;
    double varTwo;
} structOne;

structOne myStruct;

It is then possible to do the following from the main application which loads the DLL:
structOne * sPtr = (structOne *)GetProcAddress(libraryHandle, "myStruct");

My question is if it would be possible to do something of the likes of:
double * dPtr = (double *)GetProcAddress(libraryHandle, "myStruct.varOne");

If you understand what I want and it is possible; what is the syntax?
If it is not possible; why?
If you do not understand my question; say so in a comment!

Regards and hopeful for answers!

A:

No, this is not possible. GetProcAddress has access only to the dynamic linker info. Information about the layout of the classes/structures is part of the compiler info. Compiler places this info into PDB files. It is not directly present in the binary modules. GetProcAddress has access only to the info that is stored in the EXE/DLL files. PDB files are primarily used by debuggers with a really few exceptions like StackWalk.

