Discussion:
GetFileTypeFromExtension return NULL with html
Gabriel Fusca
2014-01-27 20:35:11 UTC
Permalink
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/
--
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
Ralph Pass
2014-01-27 21:50:35 UTC
Permalink
I just tried:

wxFileType * pfiletype;
pfiletype = wxTheMimeTypesManager->GetFileTypeFromExtension("html");
if (pfiletype)
{
printf("html was recognized");
}
else
{
printf("html was not recognized");
}
pfiletype = wxTheMimeTypesManager->GetFileTypeFromExtension(".html");
if (pfiletype)
{
printf(".html was recognized");
}
else
{
printf(".html was not recognized");
}


on my Mac with 2.9.3 and it work find (Both reported 'was recognized')


Ralph
wxFileType * pfiletype = wxTheMimeTypesManager->GetFileTypeFromExtension(
HotLinkExtension);
--
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
Ralph Pass
2014-03-23 13:40:19 UTC
Permalink
Has anyone out there gotten a new Mac with Mavericks and then gotten wxWidgets 3.0 to compile completely?

The Mac needs to have NEVER had an OS prior to Mavericks on it and is using Xcode 5.1.

If so, did you experience any problems? Any words of wisdom?


I have tried both 2.9.5 and 3.0 on a brand new machine without success. Audacity reports that there may be problems on Mac that did not have a prior operating system installed (e.g., Mountain Lion).


Thanks
Ralph Pass
--
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
Vadim Zeitlin
2014-03-23 15:18:10 UTC
Permalink
On Sun, 23 Mar 2014 09:40:19 -0400 Ralph Pass wrote:

RP> Has anyone out there gotten a new Mac with Mavericks and then gotten
RP> wxWidgets 3.0 to compile completely?

I haven't, but I'm pretty sure Stefan has.

RP> I have tried both 2.9.5 and 3.0 on a brand new machine without success.

Could you please give some more details?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Ralph Pass
2014-03-23 15:47:25 UTC
Permalink
I am going to go back and start from scratch (new Xcode download, new command line tools, fresh copy of wxWidgets, then a fresh copy of Dialogblocks. This will take a bit of time.

(and yes, I did have the command line tools installed)

Ralph Pass
Post by Vadim Zeitlin
RP> Has anyone out there gotten a new Mac with Mavericks and then gotten
RP> wxWidgets 3.0 to compile completely?
I haven't, but I'm pretty sure Stefan has.
RP> I have tried both 2.9.5 and 3.0 on a brand new machine without success.
Could you please give some more details?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.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
Ralph Pass
2014-03-24 18:11:28 UTC
Permalink
Okay, after a complete reload, I can build wxwidgets manually (and the samples) and they run. So my problem is not with wxWidgets per se

However, if I use DialogBlocks to build wxwidgets I have problems with things like:

"wxGet_wxConvLibcPtr()", referenced from:
wxString::wxString(char const*) in test-8cafd2.o
"wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)", referenced from:
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o
"wxString::npos", referenced from:
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o

so my search continues.

Ralph Pass
Post by Ralph Pass
I am going to go back and start from scratch (new Xcode download, new command line tools, fresh copy of wxWidgets, then a fresh copy of Dialogblocks. This will take a bit of time.
(and yes, I did have the command line tools installed)
Ralph Pass
Post by Vadim Zeitlin
RP> Has anyone out there gotten a new Mac with Mavericks and then gotten
RP> wxWidgets 3.0 to compile completely?
I haven't, but I'm pretty sure Stefan has.
RP> I have tried both 2.9.5 and 3.0 on a brand new machine without success.
Could you please give some more details?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
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
Julian Smart
2014-03-24 18:16:56 UTC
Permalink
Hi Ralph,

Once you've built wxWidgets via DialogBlocks, do the wxWidgets samples
compile and link? You can compile them from the command line inside the
build folder that DialogBlocks created for wxWidgets.

Also, I wonder if the .o files may be from an old build. It's worth
manually zapping all possible binaries from previous builds.

Regards,

Julian
Post by Ralph Pass
Okay, after a complete reload, I can build wxwidgets manually (and
the samples) and they run. So my problem is not with wxWidgets per se
wxString::wxString(char const*) in test-8cafd2.o
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o
so my search continues.
Ralph Pass
Post by Ralph Pass
I am going to go back and start from scratch (new Xcode download,
new command line tools, fresh copy of wxWidgets, then a fresh copy of
Dialogblocks. This will take a bit of time.
(and yes, I did have the command line tools installed)
Ralph Pass
Post by Vadim Zeitlin
RP> Has anyone out there gotten a new Mac with Mavericks and then gotten
RP> wxWidgets 3.0 to compile completely?
I haven't, but I'm pretty sure Stefan has.
RP> I have tried both 2.9.5 and 3.0 on a brand new machine without success.
Could you please give some more details?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
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
Ralph Pass
2014-03-24 18:43:05 UTC
Permalink
Julian:

Darn, I should have thought of this. They build. Using the explicit commands to compile and to link with my simple 'Hello World' cpp file also worked.

Next step is to configure DialogBlocks to provide the same compile and link commands and see if that works. Then to figure out what is really happening.
Post by Julian Smart
Hi Ralph,
Once you've built wxWidgets via DialogBlocks, do the wxWidgets samples compile and link? You can compile them from the command line inside the build folder that DialogBlocks created for wxWidgets.
Also, I wonder if the .o files may be from an old build. It's worth manually zapping all possible binaries from previous builds.
Regards,
Julian
Post by Ralph Pass
Okay, after a complete reload, I can build wxwidgets manually (and the samples) and they run. So my problem is not with wxWidgets per se
wxString::wxString(char const*) in test-8cafd2.o
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o
wxString::ImplStr(char const*, wxMBConv const&) in test-8cafd2.o
so my search continues.
Ralph Pass
Post by Ralph Pass
I am going to go back and start from scratch (new Xcode download, new command line tools, fresh copy of wxWidgets, then a fresh copy of Dialogblocks. This will take a bit of time.
(and yes, I did have the command line tools installed)
Ralph Pass
Post by Vadim Zeitlin
RP> Has anyone out there gotten a new Mac with Mavericks and then gotten
RP> wxWidgets 3.0 to compile completely?
I haven't, but I'm pretty sure Stefan has.
RP> I have tried both 2.9.5 and 3.0 on a brand new machine without success.
Could you please give some more details?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
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
Ralph Pass
2014-03-24 21:20:00 UTC
Permalink
After much experimenting I have found the following with Mac OSX and Mavericks:


1. If i build wxWidgets 3.0 from source under Mavericks using the provided instructions, the build command has the minimum OSX version set to 10.5. This works and the samples build.

2. If i, however, build wxWidgets with a minimum OS version of 10.9 then I get linker errors related to the standard template library.


This is interesting behavior. It is unexpected (at least to me).


Ralph Pass
--
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
Stefan Csomor
2014-03-23 15:25:25 UTC
Permalink
Hi Ralph
Post by Ralph Pass
Has anyone out there gotten a new Mac with Mavericks and then gotten
wxWidgets 3.0 to compile completely?
The Mac needs to have NEVER had an OS prior to Mavericks on it and is using Xcode 5.1.
If so, did you experience any problems? Any words of wisdom?
did you also install the command line tools for xcode ? are you building
with configure (if yes, please give your configure line) or with the
.xcodeproj (if yes, which one)

I usually start with fresh OS versions, but my 10.9 machine did have XCode
5.0 first, and the command line tools are installed

Best,

STefan
--
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
Vadim Zeitlin
2014-01-28 01:53:53 UTC
Permalink
On Mon, 27 Jan 2014 18:35:11 -0200 Gabriel Fusca wrote:

GF> I'm using wx 2.8.12 in a multi platform application.
GF>
GF> I want to obtain the appropriate file type for the file extension given by
GF> the parameter of the function. But when I try to get the file type for the
GF> extension given GetFileTypeFromExtension returns a null pointer.

It looks like you're just trying to open the file and are not interested
in the file type per se, so just use wxLaunchDefaultApplication() to do it.

GF> I'd be glad if somebody could shed some light onto this.

It looks like a bug, but you really need to retry your code with 3.0 as
only critical bugs (of which this isn't one) might still be fixed in 2.8.
If it still doesn't work with 3.0, please do report it to us, however, but
please mention your platform.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Gabriel Fusca
2014-01-28 18:34:39 UTC
Permalink
I'm finally decide to use a wxHtmlWindow to render the html rather to
obtain the appropiate file type handler.

Thanks
Post by Vadim Zeitlin
GF> I'm using wx 2.8.12 in a multi platform application.
GF>
GF> I want to obtain the appropriate file type for the file extension given by
GF> the parameter of the function. But when I try to get the file type for the
GF> extension given GetFileTypeFromExtension returns a null pointer.
It looks like you're just trying to open the file and are not interested
in the file type per se, so just use wxLaunchDefaultApplication() to do it.
GF> I'd be glad if somebody could shed some light onto this.
It looks like a bug, but you really need to retry your code with 3.0 as
only critical bugs (of which this isn't one) might still be fixed in 2.8.
If it still doesn't work with 3.0, please do report it to us, however, but
please mention your platform.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
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
Loading...