Click to See Complete Forum and Search --> : how to pass an argument into built-in functions originally not allow more arguments


rosymary
June 30th, 2006, 08:01 AM
Hi, I'm programming in VC++.net.

I want to pass a string type argument into the built-in function
private: System::Void wmp1_PlayStateChange(System::Object * sender, AxInterop::WMPLib::_WMPOCXEvents_PlayStateChangeEvent * e)
{}

How?

Can I overide the function definition? How?

Thanks!

Krishnaa
June 30th, 2006, 08:09 AM
It dosent take any string type argument ? Why and what you want to pass ?

rosymary
June 30th, 2006, 08:23 AM
No, it doesn't. As you can see :
(System::Object * sender, AxInterop::WMPLib::_WMPOCXEvents_PlayStateChangeEvent * e)

so it only allows two types of arguments.

Now I'd like to pass a string type argument into this funtion.
Say, everytime the function is called, set the url of a windows media player control. The url string will not specified until the program runs. So the problem is how to use that variable in this
private: System::Void wmp1_PlayStateChange(x,x){...} function if a global variable is not preferred?

cilu
June 30th, 2006, 02:38 PM
wmp1_PlayStateChange is a event handler called by the framework. You should not call it directly. I'm not exactly sure what you want, but I suggest creating a helper method, that can take any parameters you want and can be called both from such a handler and other functions at your like.