Re: gtk_file_chooser page faults (win32)



David wrote:

Did the original source I provided crash?  If so, which OS are
you running?  (I'm running Win98 - wondering if that has
something to do with it).

The original didn't crash either. However, it did output this:

(gtktest3:1888): Gtk-CRITICAL **: file gtkfilesystemwin32.c: line
578 (gtk_file_
system_win32_get_parent): assertion `g_path_is_absolute
(filename)' failed

When I commented out the line

gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),"");

it didn't output any warnings at all. Either way, it didn't crash.

I'm using Windows XP Pro, and my %HOME% variable is not set.


What libraries do you use?  My libraries come from links on
Tor's page, and I compile under msys/mingw with gcc.

I'm using the precompiled libraries from Tor's page.


If my original crashed on your system, and you are using the
same libraries I do, then it would appear that this problem
might be in the way the program is compiled/linked, because it
appears that your successful program is identical to mine
except for the entry point name. It appears that you don't use
any of the parameters passed to WinMain within the program.

Some explanation is in order here. I embellished the original to
make it run as a GUI-only program (no console) because I thought you were targeting Windows. As for WinMain, I think command-line argument handling using the traditional Windows API is a little different. IIRC they have a parseCmdLine function which takes the entire command line as a single string and extracts the options and arguments from it. As for GTK+, it requires the args in the form int*, char***, so I had to use the ones defined by stdlib.h.

hInstance and hPrevInstance are handles to the current instance
and the previous instance of the program (that are running at the
same time), and are also used in the Win32 API.

nCmdShow is basically a boolean -- should we show the window now
or not? Again, something that fits inside the Windows API. I think
GTK+ probably has other ways of dealing with this same issue.

HTH,

--
Yawar Amin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]