Error loading .xrc file

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Error loading .xrc file

Tim Burgess-5
Hi,

I have the following code in the construcgtor of a class:

wxXmlResource::Get()->InitAllHandlers();
wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");

When I run the application I get an error:

Cannot load resources from dxemb_AutoProbe.xrc

The error gives no additional information as to why the failure happened. At
first I thought that the problem might be the file location (it's in the
same folder as the executable), but disproved this by deliverately
introducing an error into the .xrc file. This caused an additional dialog to
appear at run-time indicating a parse error, so I'm confident that the
executable is finding the file.
 
What other causes of this error can I investigate, please?

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf
Of Vadim Zeitlin
Sent: Monday, November 28, 2016 13:09
To: [hidden email]
Subject: Re[2]: Build Failure - wx version 3.0.0 - Windows 10 64-bit -
Visual Studio Community Edition 2015

On Mon, 28 Nov 2016 15:23:54 +0500 asif saeed wrote:

as> Sorry, I ran the build again just now; the build error is about
as> snprintf macro redefinition ("Macro definition of snprintf conflicts
as> with Standard Library function declaration"). The warning and errors
as> are point to the same thing. The source of ALL these errors is
as> wxTiff project. I'll be thankful if you help me get wxWidgets build
as> without errors on 32/64 bit Windows and 32/64-bit Linux.

 You need to use the latest sources from 3.0 branch with MSVS 2015 or apply
this fix manually:

https://github.com/wxWidgets/wxWidgets/commit/c06c8edb5a275682f16a44a048b9de
79332e2b5f

 Regards,
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 [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Error loading .xrc file

David Hart-4
Hi,

I suggest you check your xrc file with an xml validator. There are various of those online, or you can download one.

Other possibilities are trying to load your xrc file in the xrcdemo sample, and/or try to load one of that sample's xrc files in your program and access one of its constituents. That should distinguish between a problem with the file or with the program.

Regards,

David

On Wednesday, 8 February 2017 10:49:37 UTC, Tim Burgess wrote:
Hi,

I have the following code in the construcgtor of a class:

wxXmlResource::Get()->InitAllHandlers();
wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");

When I run the application I get an error:

Cannot load resources from dxemb_AutoProbe.xrc

The error gives no additional information as to why the failure happened. At
first I thought that the problem might be the file location (it's in the
same folder as the executable), but disproved this by deliverately
introducing an error into the .xrc file. This caused an additional dialog to
appear at run-time indicating a parse error, so I'm confident that the
executable is finding the file.
 
What other causes of this error can I investigate, please?

Best wishes.

Tim Burgess

-----Original Message-----
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VaxoJEw1CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="VaxoJEw1CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@googlegroups.com] On Behalf
Of Vadim Zeitlin
Sent: Monday, November 28, 2016 13:09
To: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="VaxoJEw1CAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@...
Subject: Re[2]: Build Failure - wx version 3.0.0 - Windows 10 64-bit -
Visual Studio Community Edition 2015

On Mon, 28 Nov 2016 15:23:54 +0500 asif saeed wrote:

as> Sorry, I ran the build again just now; the build error is about
as> snprintf macro redefinition ("Macro definition of snprintf conflicts
as> with Standard Library function declaration"). The warning and errors
as> are point to the same thing. The source of ALL these errors is
as> wxTiff project. I'll be thankful if you help me get wxWidgets build
as> without errors on 32/64 bit Windows and 32/64-bit Linux.

 You need to use the latest sources from 3.0 branch with MSVS 2015 or apply
this fix manually:

<a href="https://github.com/wxWidgets/wxWidgets/commit/c06c8edb5a275682f16a44a048b9de79332e2b5f" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FwxWidgets%2FwxWidgets%2Fcommit%2Fc06c8edb5a275682f16a44a048b9de79332e2b5f\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE_UJYY6msrbi_Rw_gcYRiUDxpHSQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FwxWidgets%2FwxWidgets%2Fcommit%2Fc06c8edb5a275682f16a44a048b9de79332e2b5f\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE_UJYY6msrbi_Rw_gcYRiUDxpHSQ&#39;;return true;">https://github.com/wxWidgets/wxWidgets/commit/c06c8edb5a275682f16a44a048b9de
79332e2b5f

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               <a href="http://www.tt-solutions.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.tt-solutions.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhPHTZbdYZYM-AqcnZXykG1ueWhw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.tt-solutions.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFhPHTZbdYZYM-AqcnZXykG1ueWhw&#39;;return true;">http://www.tt-solutions.com/

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Error loading .xrc file

oneeyeman
Hi,  Tim,

On Thu, Feb 9, 2017 at 5:13 PM, David Hart
<[hidden email]> wrote:

> Hi,
>
> I suggest you check your xrc file with an xml validator. There are various
> of those online, or you can download one.
>
> Other possibilities are trying to load your xrc file in the xrcdemo sample,
> and/or try to load one of that sample's xrc files in your program and access
> one of its constituents. That should distinguish between a problem with the
> file or with the program.
>
> Regards,
>
> David
>
> On Wednesday, 8 February 2017 10:49:37 UTC, Tim Burgess wrote:
>>
>> Hi,
>>
>> I have the following code in the construcgtor of a class:
>>
>> wxXmlResource::Get()->InitAllHandlers();
>> wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");
>>
>> When I run the application I get an error:
>>
>> Cannot load resources from dxemb_AutoProbe.xrc
>>
>> The error gives no additional information as to why the failure happened.
>> At
>> first I thought that the problem might be the file location (it's in the
>> same folder as the executable), but disproved this by deliverately
>> introducing an error into the .xrc file. This caused an additional dialog
>> to
>> appear at run-time indicating a parse error, so I'm confident that the
>> executable is finding the file.
>>
>> What other causes of this error can I investigate, please?

In addition - make sure that the file is readable by the user that
tries to read the file.
And the user has a read access to the folder where the file is located.

Thank you.

>>
>> Best wishes.
>>
>> Tim Burgess
>>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]] On Behalf
>> Of Vadim Zeitlin
>> Sent: Monday, November 28, 2016 13:09
>> To: [hidden email]
>> Subject: Re[2]: Build Failure - wx version 3.0.0 - Windows 10 64-bit -
>> Visual Studio Community Edition 2015
>>
>> On Mon, 28 Nov 2016 15:23:54 +0500 asif saeed wrote:
>>
>> as> Sorry, I ran the build again just now; the build error is about
>> as> snprintf macro redefinition ("Macro definition of snprintf conflicts
>> as> with Standard Library function declaration"). The warning and errors
>> as> are point to the same thing. The source of ALL these errors is
>> as> wxTiff project. I'll be thankful if you help me get wxWidgets build
>> as> without errors on 32/64 bit Windows and 32/64-bit Linux.
>>
>>  You need to use the latest sources from 3.0 branch with MSVS 2015 or
>> apply
>> this fix manually:
>>
>>
>> https://github.com/wxWidgets/wxWidgets/commit/c06c8edb5a275682f16a44a048b9de
>> 79332e2b5f
>>
>>  Regards,
>> 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 [hidden email]
> 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 [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: Error loading .xrc file

Tim Burgess-5
Hi,

Apologies - I should have included my other trouble-shooting. I'd already tested my code with a known good .xrc file and hit the same issue, so the fault is with the program and not the file. The file resides in a folder that contains other .xrc files that are successfully loaded by other modules of the same application, so access permissions shouldn't be an issue either.

Thanks for both replies - it's much appreciated. It's a shame that the error message isn't a little more specific as to its cause:)

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Igor Korot
Sent: Thursday, February 9, 2017 22:17
To: [hidden email]
Subject: Re: Error loading .xrc file

Hi,  Tim,

On Thu, Feb 9, 2017 at 5:13 PM, David Hart <[hidden email]> wrote:

> Hi,
>
> I suggest you check your xrc file with an xml validator. There are
> various of those online, or you can download one.
>
> Other possibilities are trying to load your xrc file in the xrcdemo
> sample, and/or try to load one of that sample's xrc files in your
> program and access one of its constituents. That should distinguish
> between a problem with the file or with the program.
>
> Regards,
>
> David
>
> On Wednesday, 8 February 2017 10:49:37 UTC, Tim Burgess wrote:
>>
>> Hi,
>>
>> I have the following code in the construcgtor of a class:
>>
>> wxXmlResource::Get()->InitAllHandlers();
>> wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");
>>
>> When I run the application I get an error:
>>
>> Cannot load resources from dxemb_AutoProbe.xrc
>>
>> The error gives no additional information as to why the failure happened.
>> At
>> first I thought that the problem might be the file location (it's in
>> the same folder as the executable), but disproved this by
>> deliverately introducing an error into the .xrc file. This caused an
>> additional dialog to appear at run-time indicating a parse error, so
>> I'm confident that the executable is finding the file.
>>
>> What other causes of this error can I investigate, please?

In addition - make sure that the file is readable by the user that tries to read the file.
And the user has a read access to the folder where the file is located.

Thank you.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Error loading .xrc file

David Hart-4
In that case I suggest you run the program in your debugger, first putting a breakpoint on wxXmlResource::Load in src/xrc/xmlres.cpp where that wxLogError message is generated. When it's hit, stepping though the function may be revealing. If not, look at the backtrace and see if that helps.

If neither help, repeat the process in a module that does load successfully and see if there's a visible difference in e.g. the format of the filemask_ parameter.

On Friday, 10 February 2017 08:53:58 UTC, Tim Burgess wrote:
Hi,

Apologies - I should have included my other trouble-shooting. I'd already tested my code with a known good .xrc file and hit the same issue, so the fault is with the program and not the file. The file resides in a folder that contains other .xrc files that are successfully loaded by other modules of the same application, so access permissions shouldn't be an issue either.

Thanks for both replies - it's much appreciated. It's a shame that the error message isn't a little more specific as to its cause:)

Best wishes.

Tim Burgess

-----Original Message-----
From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZtBZriXMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZtBZriXMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@googlegroups.com] On Behalf Of Igor Korot
Sent: Thursday, February 9, 2017 22:17
To: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZtBZriXMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">wx-u...@...
Subject: Re: Error loading .xrc file

Hi,  Tim,

On Thu, Feb 9, 2017 at 5:13 PM, David Hart <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ZtBZriXMCAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">google.grou...@dfgh.net> wrote:

> Hi,
>
> I suggest you check your xrc file with an xml validator. There are
> various of those online, or you can download one.
>
> Other possibilities are trying to load your xrc file in the xrcdemo
> sample, and/or try to load one of that sample's xrc files in your
> program and access one of its constituents. That should distinguish
> between a problem with the file or with the program.
>
> Regards,
>
> David
>
> On Wednesday, 8 February 2017 10:49:37 UTC, Tim Burgess wrote:
>>
>> Hi,
>>
>> I have the following code in the construcgtor of a class:
>>
>> wxXmlResource::Get()->InitAllHandlers();
>> wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");
>>
>> When I run the application I get an error:
>>
>> Cannot load resources from dxemb_AutoProbe.xrc
>>
>> The error gives no additional information as to why the failure happened.
>> At
>> first I thought that the problem might be the file location (it's in
>> the same folder as the executable), but disproved this by
>> deliverately introducing an error into the .xrc file. This caused an
>> additional dialog to appear at run-time indicating a parse error, so
>> I'm confident that the executable is finding the file.
>>
>> What other causes of this error can I investigate, please?

In addition - make sure that the file is readable by the user that tries to read the file.
And the user has a read access to the folder where the file is located.

Thank you.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: Error loading .xrc file

Tim Burgess-5

OK, thanks. Will do.

 

Best wishes.

 

Tim Burgess

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of David Hart
Sent: Friday, February 10, 2017 10:18
To: wx-users <[hidden email]>
Subject: Re: Error loading .xrc file

 

In that case I suggest you run the program in your debugger, first putting a breakpoint on wxXmlResource::Load in src/xrc/xmlres.cpp where that wxLogError message is generated. When it's hit, stepping though the function may be revealing. If not, look at the backtrace and see if that helps.

If neither help, repeat the process in a module that does load successfully and see if there's a visible difference in e.g. the format of the filemask_ parameter.

On Friday, 10 February 2017 08:53:58 UTC, Tim Burgess wrote:

Hi,

Apologies - I should have included my other trouble-shooting. I'd already tested my code with a known good .xrc file and hit the same issue, so the fault is with the program and not the file. The file resides in a folder that contains other .xrc files that are successfully loaded by other modules of the same application, so access permissions shouldn't be an issue either.

Thanks for both replies - it's much appreciated. It's a shame that the error message isn't a little more specific as to its cause:)

Best wishes.

Tim Burgess

-----Original Message-----
From: <a href="javascript:" target="_blank">wx-u...@... [mailto:<a href="javascript:" target="_blank">wx-u...@...] On Behalf Of Igor Korot
Sent: Thursday, February 9, 2017 22:17
To: <a href="javascript:" target="_blank">wx-u...@...
Subject: Re: Error loading .xrc file

Hi,  Tim,

On Thu, Feb 9, 2017 at 5:13 PM, David Hart <<a href="javascript:" target="_blank">google.grou...@...> wrote:


> Hi,
>
> I suggest you check your xrc file with an xml validator. There are
> various of those online, or you can download one.
>
> Other possibilities are trying to load your xrc file in the xrcdemo
> sample, and/or try to load one of that sample's xrc files in your
> program and access one of its constituents. That should distinguish
> between a problem with the file or with the program.
>
> Regards,
>
> David
>
> On Wednesday, 8 February 2017 10:49:37 UTC, Tim Burgess wrote:
>>
>> Hi,
>>
>> I have the following code in the construcgtor of a class:
>>
>> wxXmlResource::Get()->InitAllHandlers();
>> wxXmlResource::Get()->Load("dxemb_AutoProbe.xrc");
>>
>> When I run the application I get an error:
>>
>> Cannot load resources from dxemb_AutoProbe.xrc
>>
>> The error gives no additional information as to why the failure happened.
>> At
>> first I thought that the problem might be the file location (it's in
>> the same folder as the executable), but disproved this by
>> deliverately introducing an error into the .xrc file. This caused an
>> additional dialog to appear at run-time indicating a parse error, so
>> I'm confident that the executable is finding the file.
>>
>> What other causes of this error can I investigate, please?

In addition - make sure that the file is readable by the user that tries to read the file.
And the user has a read access to the folder where the file is located.

Thank you.

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
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 [hidden email]
or visit http://groups.google.com/group/wx-users