Re: argv revisited





On 05/08/2016 05:45 PM, Andrew Robinson wrote:
Like most people in this forum, you don't listen:

     My issue isn't with GTK2, it is with GTK3.
     I know Fedora has precompiled GTK2 binaries but doesn't help me with GTK3.

My original issue is clearly stated as using the following environment:

     32-bit version of GTK+ v3.18 on a 64-bit Windows7 OS

If you don't have at least one of those two things in your environment or
advice, you aren't trying to help, just like the rest of the people in this
forum aren't.

I like reminiscing about the good ol' times, so let's reminisce over the
wonderful advice I received from this group regarding the use of argc and argv
at the beginning of this thread:

     There should be no difference between using 32-bit GTK libs and 64-bit GTK
libs
     You are using 32-bit code, which is buggy/inferior to 64-bit code
     argc and argv are not processed by your app but by your compiler's runtime
     argc and argv are on the stack, unless you program in assembly
     GTK+ doesn't provide argc and argv until you call gtk_init()
     Calling convention is determined by the compiler, not the OS
     argc and argv work for me on Linux with a Linux app using GTK2




The argc and argv arguments are for C based programs only. Assembly based programs must use __getmainargs or __wgetmainargs functions from the C library to generate those variables like they are internally used by C based programs. See below MSDN article for details:

http://msdn.microsoft.com/en-us/library/ff770599.aspx

GTK has nothing whatsoever to do with argc and argv.

gtk_init: Before using GTK+, you need to initialize it; initialization connects to the window system display, and parses some standard command line arguments.

Therefore argc and argv exist before the call to gtk_init,
if in your program they do not exist you are doing something
wrong, in other words some steps are missing.
Write a simple test program in assembler with argv[1] = "Hello" and
argv[2] = "World" and when you are then able to print "Hello World"
to the terminal come back and the lovely people on this list
sure will help you for the next step.

Ciao,
Tito

All of which is pure, make believe nonsense (expect that last one, but which
is irrelevant to the issue). The people in this forum were offering me links
on the ELF format and on how the Linux loader works -- not a single one of
these links was applicable to the issue, and when they commented on the info
in those links, they made it obvious they didn't read through the entire
articles they linked to, and what little they read, they didn't even
understand. It was so laughable, I kept every single email I sent/received
from this thread so I can document this for others to see: This is the kind of
support/advice you can expect from the "experts" in the gtk-app-devel forum.

Meanwhile, in the real world, turns out the issue I was seeing was that
Windows doesn't provide argc and argv, it provides hWnd, uMsg, wParam, and
lParam. There is no argc and argv in Windows (unless you run a MsDOS program)
so all the example code they give for using GTK on Windows is flawed. When I
realized this, I used yet another function in GTK that doesn't work. I was
frustrated but seeing as I could use the laugh, I thought I would post that
issue to this forum and see if anything would change. It didn't.

So my question to this list is: do your mommys and daddys know you are on
their computer, posting to a forum as a make believe expert?

I spot one difference in that I call g_file_new_for_path to turn the
filename string into a GFile. Maybe this is relevant, maybe not, I can't
tell.

You know what, that might true. If it works, thank you. If it doesn't.



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