How to work with multiple structure? RRS feed

  • Question

  • I have a Parameter to a Function which says i can set a structure indeed will return specific values. But In This callback i want to specify multiple structure. How do i do that. i should mention that the parameter type is PVOID.


    Monday, December 14, 2015 4:45 PM


  • are you asking about how to create a context structure for the callback that can contain multiple pieces of information? Remember PVOID is a generic pointer type, the implementor of the callback doesn't know what type you will use so the context is PVOID but the underlying type can be whatever you want. if you want multiple structures to be passed in, create a top level struct like this

    struct {

       PTYPE_1 One;

       PTYPE_2 Two;

       PTYPE_3 Three;


    etc etc and initialize it properly


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, December 14, 2015 5:28 PM