I have created a dll but I'm not sure how to interact with a class member function in the client code.
Say there's a function called Foo laid out like this inside a .hpp in the dll:
Why don't you just export the class/struct so it can be instantiated within the client? Do you know how to do that? You would need the class header describing the class available to the client. The client needs to know the layout of any classes or structures instantiated within the server that are referenced by the client. It doesn't need to instantiate any, but just know their layout.
GetProcAddress() is most suitable for obtaining the virtual memory address of simple exported functions - not member functions of a class. For a simple function not a member of a class you would simply provide the HINSTANCE of the dll and the textural name of the function.
It looks to me like you are making things hard on yourself.
GetProcAddress could work for this, but you'd end up using your object through void pointers and it gets all kinds of needlessly complicated from there.
Sorry, I forgot to add the exp/imp define in the example I provided.
Alright then, that clears a lot up. So, I guess with dlls, class members just aren't the done thing? But is there a way to export static member functions normally?