flat assembler
Message board for the users of flat assembler.

Index > Windows > GTK and FASM

Author
Thread Post new topic Reply to topic
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 02 Jan 2005, 12:57
Have you got any examples? I want to programming in FASM using GTK+ (under Windows), but I don't know how.

_________________
...
Post 02 Jan 2005, 12:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade 02 Jan 2005, 14:57
Well it would be very similar to the Linux GTK examples.. the actual gtk calls would be the same, but you would just have to change format ELF to format PE (thats what windows uses.. isnt it?), and if there are any kernel calls, then translate them to windows
Post 02 Jan 2005, 14:57
View user's profile Send private message Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 02 Jan 2005, 16:02
Yeah, but FASM for win doesn't support:
public
extrn, etc.

Can you give me any example for windows?

_________________
...
Post 02 Jan 2005, 16:02
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 02 Jan 2005, 18:48
You'd have to import the gtk dll's and functions you want to use.
Post 02 Jan 2005, 18:48
View user's profile Send private message Visit poster's website Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 02 Jan 2005, 19:08
crc wrote:
You'd have to import the gtk dll's and functions you want to use.


I found ~6dll's, but I don't know, in which dlls are that functions, what i need.

_________________
...
Post 02 Jan 2005, 19:08
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 02 Jan 2005, 19:59
1. Native documentation of GTK - there MUST be such.

2. If you can't find it or there is nothing about Windows programming (possible), then PEBrowse Pro is the answer of your question.

I hope you will post some examples when you have success with this good deed. Smile

Regards.
Post 02 Jan 2005, 19:59
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 03 Jan 2005, 18:25
If I will write something, of course, I'll show you some examle/s Smile

_________________
...
Post 03 Jan 2005, 18:25
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
dieboy



Joined: 30 Dec 2004
Posts: 41
Location: Poland, Elblag
dieboy 03 Jan 2005, 19:04
Hi! I wrote this example, but when i run him, I have error(standard winxp error window), this is code:

Code:
format PE GUI 4.0
entry main

include '%fasminc%\win32a.inc'

section '.data' data readable writeable

        hWindow dd ?

section '.code' code readable executable

main:
     invoke gtk_init, eax, ebx
     invoke gtk_window_new, 0 ;GTK_WINDOW_TOPLEVEL = 0
     invoke gtk_widget_show, [hWindow]
     invoke gtk_main



section '.idata' import data readable

        library kernel, 'KERNEL32.DLL',\
                libgtk, 'libgtk-win32-2.0-0.dll'

        import kernel,\
               ExitProcess, 'ExitProcess'

        import libgtk,\
               gtk_widget_show, 'gtk_widget_show',\
               gtk_init, 'gtk_init',\
               gtk_window_new, 'gtk_window_new',\
               gtk_main, 'gtk_main',\     


And if I use:
Code:
 proc main, argc, argv
....    

I have error(FASM): if use main

_________________
...
Post 03 Jan 2005, 19:04
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 03 Jan 2005, 19:50
Well this works (at least partially) for me.
The only problem is that my GTK dll's are located in "Program Files/Common files/GTK/bin" and the program can't find them. So, I simply copied the .exe to this directory in order to check it and it works.
Of course this is not a solution.

Code:
format PE GUI 4.0
entry main

include '%fasminc%\win32a.inc'

section '.data' data readable writeable

        hWindow dd ?

section '.code' code readable executable

main:
     invoke gtk_init, 0, 0
     invoke gtk_window_new, 0 ;GTK_WINDOW_TOPLEVEL = 0
     mov    [hWindow], eax
     invoke gtk_widget_show, [hWindow]
     invoke gtk_main



section '.idata' import data readable

        library kernel, 'KERNEL32.DLL',\
                libgtk, 'libgtk-0.dll'

        import kernel,\
               ExitProcess, 'ExitProcess'

        import libgtk,\
               gtk_widget_show, 'gtk_widget_show',\
               gtk_init, 'gtk_init',\
               gtk_window_new, 'gtk_window_new',\
               gtk_main, 'gtk_main'
    


Regards.
Post 03 Jan 2005, 19:50
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 03 Jan 2005, 21:32
Quote:

Yeah, but FASM for win doesn't support:
public
extrn, etc.

aren't there .o files of GTK? You could compile to COFF and link it no?
Post 03 Jan 2005, 21:32
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
crc



Joined: 21 Jun 2003
Posts: 637
Location: Penndel, PA [USA]
crc 04 Jan 2005, 04:19
Why should you need to compile GTK as COFF and use a linker when you can use the DLL's without to much hassle? (Compiling GTK as COFF would require GCC, LD (with COFF support), and many of the binutils; not fun to set up...)
Post 04 Jan 2005, 04:19
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.