Gabriel Fusca
2014-01-27 20:35:11 UTC
I'm using wx 2.8.12 in a multi platform application.
I want to obtain the appropriate file type for the file extension given by
the parameter of the function. But when I try to get the file type for the
extension given GetFileTypeFromExtension returns a null pointer.
Here is a sample of the implementation that I'm using:
/** Function definition **/
wxString GetCommandString(std::string& HotLinkExtension) {
wxFileType * pfiletype =
wxTheMimeTypesManager->GetFileTypeFromExtension(
HotLinkExtension);
return pfiletype ? pfiletype->GetOpenCommand(filepath) : "";
}
// somewhere in the application.
/** Function uses **/
wxString command = GetCommandString("html");
if (!command.empty())
wxExecute(commandstr);
I'd be glad if somebody could shed some light onto this.
Thanks!
--
Gabriel Fusca
SUR Emprendimientos Tecnológicos
Perú 345 Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
***@suremptec.com.ar
http://www.suremptec.com/
I want to obtain the appropriate file type for the file extension given by
the parameter of the function. But when I try to get the file type for the
extension given GetFileTypeFromExtension returns a null pointer.
Here is a sample of the implementation that I'm using:
/** Function definition **/
wxString GetCommandString(std::string& HotLinkExtension) {
wxFileType * pfiletype =
wxTheMimeTypesManager->GetFileTypeFromExtension(
HotLinkExtension);
return pfiletype ? pfiletype->GetOpenCommand(filepath) : "";
}
// somewhere in the application.
/** Function uses **/
wxString command = GetCommandString("html");
if (!command.empty())
wxExecute(commandstr);
I'd be glad if somebody could shed some light onto this.
Thanks!
--
Gabriel Fusca
SUR Emprendimientos Tecnológicos
Perú 345 Piso 5to Oficina "B" (C1067AAG)
Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
***@suremptec.com.ar
http://www.suremptec.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users