News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A gui for Vortex' scan.

Started by PauloH, July 16, 2008, 08:54:34 PM

Previous topic - Next topic

PauloH

Hello

I coded a simple GUI for Vortex' scan.exe like a study project. I hope this little toy could be useful for anyone.
Any criticism is welcome.

Thanks KetilO for the about dialog box handling code.

Paulo H.

[attachment deleted by admin]

GregL

Paulo,

Thanks for posting this but I'm unable to build it, it seems there are some files missing. I read the Readme.txt file.

1. There is no .rap file.

2. If I run build.bat I get the following errors:

    Building: ScanGII.res from ScanGII.rc
    ScanGII.rc(1) : fatal error RC1015: cannot open include file 'Res/ScanGIIDlg.rc'.

    Assembling: AboutDialog.asm
    ScanGII.inc(26) : fatal error A1000: cannot open file : inc\macros.inc


PauloH

#2
Hello, Greg.

Sorry for that. I zipped it the wrong way. Now I posted the right one. Try it again, please and thank you.

Don't forget to put the executable file in the same folder that is scan.exe.

Bye.

[attachment deleted by admin]

Vortex

Hi PauloH,

Thanks for your tool and interest shown in my utility scan.exe

Grincheux

Error while building project :

C:\Masm32\Bin\RC.EXE /v "ScanGII.rc"
Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823

Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.


Using codepage 1252 as default
Creating ScanGII.RES

RC: RCPP -CP 1252 -f C:\Documents and Settings\Philippe\Mes documents\# Programmation\ScanGII\RCa05872 -g C:\Documents and Settings\Philippe\Mes documents\# Programmation\ScanGII\RDa05872 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I . -I C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\include\ -I C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\

ScanGII.rc.
Writing DIALOG:DLG_MAIN, lang:0x409, size 782.
Writing VERSION:1, lang:0x409, size 320.
Writing MENU:10000, lang:0x409, size 420.
Writing DIALOG:DLG_ABOUT, lang:0x409, size 204..
Writing ACCELERATOR:2000, lang:0x409, size 48
Writing STRING:1, lang:0x409, size 340
Writing STRING:2, lang:0x409, size 830
Writing STRING:3, lang:0x409, size 352

Make finished.
Total compile time 235 ms
C:\Masm32\Bin\ML.EXE /c /coff /Cp /I"C:\Masm32\Include" "ScanGII.asm"
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: ScanGII.asm
C:\Masm32\Bin\LINK.EXE /SUBSYSTEM:WINDOWS /VERSION:4.0 /RELEASE /ENTRY:start /OPT:REF /LIBPATH:"C:\Masm32\Lib" /OUT:"ScanGII.exe" *.OBJ "ScanGII.res"
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

ScanGII.obj : error LNK2001: unresolved external symbol _lpstrFile
ScanGII.obj : error LNK2001: unresolved external symbol _bOptions
ScanGII.obj : error LNK2001: unresolved external symbol _lpstrFilePath
ScanGII.obj : error LNK2001: unresolved external symbol _lpstrScanCmdLine
ScanGII.obj : error LNK2001: unresolved external symbol _DLG_ABOUT
ScanGII.obj : error LNK2001: unresolved external symbol _DlgProc@16
ScanGII.obj : error LNK2001: unresolved external symbol _ChooseFile@4
ScanGII.obj : error LNK2001: unresolved external symbol _Executa@8
ScanGII.obj : error LNK2001: unresolved external symbol _StartCombo@4
ScanGII.obj : error LNK2001: unresolved external symbol _Clean@4
ScanGII.obj : error LNK2001: unresolved external symbol _MontaLinha@4
ScanGII.obj : error LNK2001: unresolved external symbol _Verify@4
ScanGII.obj : error LNK2001: unresolved external symbol _MessagierProc@12
ScanGII.exe : fatal error LNK1120: 13 unresolved externals

Make error(s) occured.
Total compile time 1328 ms
ERROR On Build: Version Number Was Not Increased.
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

GregL

Paulo,

Build.bat works fine now. I copied ScanGII.exe to the same directory as Scan.exe. When I run the program, I get a MessageBox saying "The file was generated successfully.", but there is no file. Since I'm running Vista, I ran it as administrator, same results. It's no big deal, I just thought I would try out your program.


PauloH

Hello Grincheux,

This is a multi-module project. To build it in RadAsm you should assemble modules first. Do the following:
1 - In the make menu click on assemble modules;
2 - In the make menu click on compile rc;
3 - Then, in the make menu, click on build.

After this the program is OK.

Thank you and try again this way. I sent the executable with this zip, if you want.

Paulo H.

PauloH

Greg,


I can't say about Vista, unfortunately.  :(
I tested the program in 3 xp machines and it did well. Sorry for the inconvenience.

Thank you anyway.

Bye,
Paulo

GregL

Paulo,

If I figure it out, I'll let you know. I can't say whether I'll spend much time on it. 


PauloH

Hi Greg.

I figured out what happened.  The program uses SECURITY_ATTRIBUTES structure and it was misfilled. :red
Well, this time I corrected this and tested in a Vista machine so, you will find that error messages will appear in warnings panel. If it says something like:
' Unable to open somefile.inc'  - this means the problem is in the scanned source code.

For instance, I have a fasm source code with the line:
include 'imports.inc'

scan.exe can't open this file! So what we can do? It's simple, just write a ;* at the end of line like this:
include 'imports.inc' ;*

Well, this is the new attach with the correct version. Thanks for your patience.

Bye,

Paulo H.



[attachment deleted by admin]

GregL

Paulo,

Very good. It works fine now. Thanks.  :U 


kero

Dear PauloH, some words about your gui.

Do you want to know why your ES_MULTILINE Edit "Warnings" hasn't WS_TABSTOP ?
I guess you noted that this control+WS_TABSTOP stops TAB-navigation :-),  -  but why ?

Because your dialog "A gui for Vortex' scan!" - isn't really dialog.
Correction: just replace DefWindowProc with DefDlgProc.

jdoe


PauloH,

I've just take a look at your source code.   :U

But there is one thing that jumps to my face is the use of TCHAR. I've search where you've been define it and realized that it was defined in MASM32 as BYTE and it's not so true. TCHAR is a data type that is WORD or BYTE if UNICODE is defined or not.

I work a lot with TCHAR with my string macro, so this is why my eyes focused on that immediatly.

http://msdn.microsoft.com/en-us/library/ms527395(EXCHG.10).aspx


PauloH

#13
Hello people,

Thank you, friends. Your comments can help me a lot!!! Windows programming has its "tricks" and I appreciate your teaching to improve my program and my code practices. I'll will do what you say  and study more.
About TCHAR I have to admit that windows types are still some confusing to me, but I think this is a matter of time to learn and to use them correctly.

Thanks again.
Paulo H.

PauloH

I made some changes to this project:

- The .obj files are available for linking;
- The executable is shipped within the zipped file;
- Now one can select the path for scan.exe and the program saves it to disk (file = Settings.ini);
- Implemented custom message boxes;
- Removed make file for mingw32-make;
- Use string safe functions ( see: this thread.

I hope you find it useful. Any comments are welcome.

Kind regards,
PauloH.

[attachment deleted by admin]