flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Reverend 06 Nov 2005, 17:03
|
|||
![]() |
|
BXM 06 Nov 2005, 19:00
Here's how to update the example /FASM/EXAMPLES/DIALOG
This code is from an elder update of Thomas Grysztar but today obsolete due to the evolution of FASM syntax http://board.flatassembler.net/topic.php?t=170 Ok here we go. Open the folder /FASM/EXAMPLES/DIALOG Add a new file called manifest.xml which contains Code: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="x86" version="5.1.0.0" type="win32" name="DIALOG.exe"/> <description>Mx XP Program</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86"/> </dependentAssembly> </dependency> </assembly> Now Open DIALOG.ASM it is in /FASM/EXAMPLES/DIALOG After label "start:" just above "invoke GetModuleHandle,0" add: Code: invoke InitCommonControls In section '.idata' add a new library (Dont forget the ,\ to continue the same line): Code: comctl,'COMCTL32.DLL' To declare the function we want to import (that we invoked at the beginning) add after the imports from user: Code: import comctl,\ InitCommonControls,'InitCommonControls Lastly in the section '.rsrc' add Code: RT_MANIFEST = 24 Modify the line Code: directory RT_DIALOG,dialogs So that it looks like this: Code: directory RT_DIALOG,dialogs,\ RT_MANIFEST,manifests Then add a new ressource entry: Code: resource manifests,\ 1,LANG_ENGLISH+SUBLANG_DEFAULT,manifest At the very end of the file add Code: resdata manifest
file 'manifest.xml'
endres At this point, the code is ready for compile. But you can have the same result without an external XML file: Just modify the latest section "resdata manifest" to be like this: Code: resdata manifest db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10 db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10 db '<assemblyIdentity name="DIALOG2.exe" processorArchitecture="x86" version="5.1.0.0" type="win32"/> ',13,10 db '<description>no</description>',13,10 db '<dependency>',13,10 db '<dependentAssembly>',13,10 db '<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />',13,10 db '</dependentAssembly>',13,10 db '</dependency>',13,10 db '</assembly>',13,10 endres In both cases you won't need to release the XML file with your application as the XML code is embedded in the exe. |
|||
![]() |
|
shism2 06 Nov 2005, 23:22
C:\Documents and Settings\Owner\Desktop\crap\fasmexp\freaker.asm [331]:
directory RT_DIALOG,dialogs,\ C:\WinAsm\Assemblers\fasm\INCLUDE\macro/resource.inc [19] directory [14]: dd type,80000000h+label-root@resource error: undefined symbol. This is what I have right now.. section '.rsrc' resource from 'res1.res' data readable RT_MANIFEST = 24 directory RT_DIALOG,dialogs,\ RT_MANIFEST,manifests resource manifests,\ 1,LANG_ENGLISH+SUBLANG_DEFAULT,manifest resdata manifest db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10 db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10 db '<assemblyIdentity name="DIALOG2.exe" processorArchitecture="x86" version="5.1.0.0" type="win32"/> ',13,10 db '<description>no</description>',13,10 db '<dependency>',13,10 db '<dependentAssembly>',13,10 db '<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />',13,10 db '</dependentAssembly>',13,10 db '</dependency>',13,10 db '</assembly>',13,10 endres |
|||
![]() |
|
madmatt 07 Nov 2005, 06:58
Here is a converted fasmw examlple that uses the WindowsXP '.xml' style sheet.
|
|||
![]() |
|
shism2 07 Nov 2005, 20:38
App just closes...Doesn't even start
where you do the cmp eax,0 after dialogparama.. eax = FFFFFFFF |
|||
![]() |
|
shism2 08 Nov 2005, 01:51
So Im guessing it doesnt work with external resources?
|
|||
![]() |
|
madmatt 08 Nov 2005, 08:57
Here's an even simpler example. Run the executable first, and see if this works. Shouldn't try to recompile the code, I modified many things in my include files/macros. Just gave the source so you can have an idea of how to do it.
|
|||
![]() |
|
shism2 08 Nov 2005, 21:06
Messagebox doesn't appear.. I don't understand why this isn't working damnit.
|
|||
![]() |
|
decard 08 Nov 2005, 22:01
well, it appears on my system
|
|||
![]() |
|
shism2 09 Nov 2005, 00:18
What could make this not appear?
|
|||
![]() |
|
BXM 09 Nov 2005, 00:30
Sorry that I followed a certain step by step tutorial to recompile FASMW: it is cool. (By the way the exe is 112Kb, compiled in 0.3 seconds... ;^)
Perhaps you have an older compiler? |
|||
![]() |
|
shism2 09 Nov 2005, 00:42
I have the newest one ... I don't understand why it won't execute ... It's very odd.. Does it work for everyone?
|
|||
![]() |
|
madmatt 09 Nov 2005, 03:22
Sorry your having so much trouble shism2. Try copying the resource info from my hello example into your hello example that came with fasm. Then recompile using your compiler setup. You can also try turning off your anti-virus software temporarly.
|
|||
![]() |
|
shism2 09 Nov 2005, 03:44
ya I did try that but the same thing happens. Anyone have any ideas why this is happening?
FIXED : On sp2 it seems invoke InitCommonControls is not needed I run sp1 and a call to invoke InitCommonControls is needed before any xp styles can be displayed ( the messagebox) |
|||
![]() |
|
vbVeryBeginner 09 Nov 2005, 04:22
Quote: I run sp1 and a call to invoke InitCommonControls is needed before any xp styles can be displayed ( the messagebox) then they are wrong http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/common/functions/initcommoncontrolsex.asp msdn wrote:
|
|||
![]() |
|
shism2 09 Nov 2005, 04:39
That is a different api
![]() on sp1 if I don't use initcommoncontrols the messagebox doesn't even pop up. While sp2 I don't have to use the api |
|||
![]() |
|
madmatt 09 Nov 2005, 22:57
Glad you got it working
![]() |
|||
![]() |
|
shism2 09 Nov 2005, 23:53
You are using sp2?
It was really just luck I figured it out.. I remember someone before told me to use that api and I tried it and WELL it worked ! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.