.xml file presence

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4152
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

.xml file presence

Post by ONEEYEMAN » Sun Aug 28, 2005 1:18 am

Hi, ALL,
I have a resource file on a Windows compiled with wxrc and I generated the .cpp and .h files. I put them in the ./res directory, added the .cpp file to the project, compiled and run the program. Now my question is: Do I still need the .xml file present? Or I can kill the file forever?
Also, when I will port it on Linux/UNIX with wxGTK, where should I store those files? Do I have to store it in the project/src dierectory, orI could create the <my_project/src/res directory and store them there? Do I need the .xml file in order to run the program?

I am asking this because I have a problem with the wxGTK port. Here is my code:

Code: Select all

void InitXmlResource()
{
// Check for memory FS. If not present, load the handler:
	{
		wxMemoryFSHandler::AddFile( wxT( "XRC_resource/dummy_file" ), wxT( "dummy one" ) );
		wxFileSystem fsys;
		wxFSFile *f = fsys.OpenFile( wxT( "memory:XRC_resource/dummy_file" ) );
		wxMemoryFSHandler::RemoveFile( wxT( "XRC_resource/dummy_file" ) );
		if( f )
			delete f;
		else
			wxFileSystem::AddHandler( new wxMemoryFSHandler );
	}
	wxMemoryFSHandler::AddFile( wxT( "XRC_resource/resource.cpp$._resource.xml" ), xml_res_file_0, xml_res_size_0 );
//	wxString temp( xml_res_file_0, wxSTRING_MAXLEN );
//	(void) wxMessageBox( _T(temp), _T( "testing!!!" ) );
	wxXmlResource::Get()->Load( wxT( "memory:XRC_resource/resource.cpp$._resource.xml" ) );
}
On the last line it fails giving the SIGSERV. Is it possible that the program simply doesn't have enough memory?

Thank you in advance.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4152
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Sun Aug 28, 2005 8:35 am

OK, by looking at the code it goes into the wxMimeFile-related classes, which supports mainly the picture files.
I am trying to use the simple dialog from the resource .cpp file. It might work on Windows (I have an XP), but it doesn't work on wxGTK...

Tha actual failure occur in the wxMimeTypesManagerImpl::GetMimeInfo()->wxMimeTypesManagerImpl::ReadMailcap().

Could someone explain relevance, please for using the Mime format.

Thank you in advance.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4152
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Post by ONEEYEMAN » Wed Aug 31, 2005 2:46 am

Hello... Anybody...
The last wxGTK line from the "Frame Stack" in KDevelop, and the next line looks like those:

Code: Select all

std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>::assign() from /usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.5-20050130/libstdc++.so.5
wxMimeTypesManagerImpl::ReadMailcap from /usr/lib/libwx_baseud-2.6.so.0
What, nobody works with the old plain GUI anymore? :)

Thank you.;

Post Reply