sub onSourceBrowse()
{
DSTRING path[260] ;
path = FileRequest("Browse for wma file", d1, TRUE, "wma Files|*.wma||", "wma") ;
if (path[0])
{
CButton *pButton = GetControl(EDIT_FILEIN);
pButton->SetText(path) ;
SetDefaultDestination() ;
}
return ;
}
What's wrong in this code ?
There is first a problem with the FileRequest() function. I don't know how to use it correctly with my dialog "d1)
Then, when i compile my code , i got an invalid argument to if statement error.
i tried "if (path[0] = true) but it doesn't work either.
And finally, the most important error is with the getcontrol() function.
I got an "undeclared function GetControl" error to each line with GetControl.Even with this :
CButton *pButton = GetControl(EDIT_FILEIN);
pButton->SetText(path) ;
I, then wonder if the declaration error is not caused by the use of the getcontrol() function (in a subroutine as above) other than in the implementation of Oncontrol() for instance.
Well, all this is very new to me , so i apologize for not saying things correctly :D
Try this
sub onSourceBrowse()
{
DSTRING path[260] ;
path = FileRequest("Browse for wma file", this, TRUE, "wma Files|*.wma||", "wma") ; // this
if ( len(path) )
{
CButton *pButton;
pButton = GetControl(EDIT_FILEIN);
pButton->SetText(path);
SetDefaultDestination();
}
return ;
}