Ditto what was said above. But to answer the other part of your question you could do something like this to know the type.

This code isn't compilable but here's the idea.
Code:
enum Types
{
    String,
    Int
}

struct TypeHolder
{
    void* Data;
    Types Type;
}

int value = 10;
TypeHolder holder;
holder.Data = &value;
holder.Type = Int;

LPVOID param = &holder;