I have a strictly C background and have been scrambling to pick up C++ as I have just been switched to a C++ project and have run into some confusion in utilizing a hook provided by a library I'm using.
as a public method, and there is a call to the method in the library code which passes in a pointer to a function that returns a reference to a struct. Something like that.
Here is my application code where I want to react to the event. All I want to do is retrieve the value of one of the members of the struct.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
class DerivedClass : public SomeSpace::BaseClass
{
virtualvoid eventHook(const someStructure& /*dataStructure*/);
public:
DerivedClass (void);
DerivedClass (void);
};
void
DerivedClass::eventHook(const someStructure &dataStructure)
{
// I want to read data here
}
Well, nevermind I figured it out. I can access the members of the struct normally. It was just because of a forward declaration of the structure in question that was preventing IntelliSense from seeing them. Compiler accepted it all just fine.