News:

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

Need Help - Easy Code: SetText

Started by Shooter, November 30, 2010, 02:53:00 AM

Previous topic - Next topic

Shooter

I'm trying to do something very simple using Easy Code GoASM: Change the text of a button when it is clicked. (Later I want to try changing the text of other items, but I just want to start small to get used to Easy Code.)

There is something about this code (see snippet below) that allows GoASM to compile without error, but when the program launches, there's a flash on the screen from the dialog box, and then it's gone... without error.

This is a very simple dialog box with only one button. I've scoured over the help file and this forum for any example that does this, but the only times I can find an example of "SetText" deal with a non-predefined string. Can someone give me some pointers?


PS. I've tried returning with 'false' as well.


.Code
String1  DB   "Text Changed",0

Project01aButton1 Frame hWnd, uMsg, wParam, lParam
   Invoke SetText, [hWnd], Addr String1
   Mov Eax, TRUE   ;Return (TRUE)
   Ret
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

Tight_Coder_Ex


Shooter

Thanks, Tight_Coder_Ex, but it does the exact same thing (even if I comment out the SetText command).
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

Shooter

I'm at my wits end trying to figure out:

A) What's wrong with this very simple program (Just has a single button that I want the text to change on it when it is clicked.).

B) How to properly use Easy Code GoASM.

C) How to properly use the debugger, OllyDBG.exe

The program compiles without error, but when I launch it, there's a 'flash' of the dialog window, and it's gone. Running OllyDBG shows that it halts because of a Stack Overflow error, which I can't seem to find except that it happens when I try to use SetText during the Button Click call (I think).

Can anyone help???

Thanks,
-Shooter
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

Tight_Coder_Ex

My system detected a Trojan in the EXE after I extracted the files

Shooter

 :eek Really??? What is your antivirus software? I run scans daily and Avast! hasn't detected anything.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

hutch--

Shooter,

I am sorry, I have had a look at your project but I neither use EasyCode nor GoAsm so I have no way of evaluating it. Ramon Sala has a subforum here for EasyCode and there is a separate subforum for GoAsm but I don't know anyone who uses both.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Yuri

Shooter, how do you create the dialog? I see no code for that and no dialog resource in your project. How/where is the button created?

Tight_Coder_Ex

#8
Quote from: Shooter on December 01, 2010, 06:10:13 AM
:eek Really??? What is your antivirus software? I run scans daily and Avast! hasn't detected anything.

My service provider (Telus) in Canada runs a pretty aggressive scan and has even caught LINK that was infected and infecting executables it was creating.  If no one else is detecting this, possibly (7-Zip) may be causing the problem.  I'll double check my system this morning, just to make sure and then try extracting your files again.

PS: Complete check done on 304884 files and only one trojan caught in Project01.zip

Shooter

Quote from: hutch-- on December 01, 2010, 07:01:05 AM
Shooter,

I am sorry, I have had a look at your project but I neither use EasyCode nor GoAsm so I have no way of evaluating it. Ramon Sala has a subforum here for EasyCode and there is a separate subforum for GoAsm but I don't know anyone who uses both.

Hutch, As far as I can tell, GoASM is the assembler program that Easy Code uses (GoLink is the linker, and I've had to download OllyDBG for the debugger because GoBug seems outdated according to the error message I received while trying to use it).

This is my first go using the GUI combined editor/assembler (which is nice because of the color coding schema). However, I will say that half of the example files have had some sort of failed assembly, and the documentation (help file) seems rather incomplete as to HOW to use Easy Code, or GoASM.



Quote from: Yuri on December 01, 2010, 07:26:29 AM
Shooter, how do you create the dialog? I see no code for that and no dialog resource in your project. How/where is the button created?

Yuri, There is a file created called Project01a.rc that I believe contains the resources for the Dialog Window, but as this is my first attempt using this angle of approach, I honestly couldn't tell you how or where the code is generated for said button. I just recently decided to take another chance at programming with assembly language, and this is the first time I've attempted to make a Windows GUI application (using assembly language). I thought I'd start with something extremely small and what was supposed to be simple. Alas, it is not.



Quote from: Tight_Coder_Ex on December 01, 2010, 11:33:06 AM
My service provider (Telus) in Canada runs a pretty aggressive scan and has even caught LINK that was infected and infecting executables it was creating.  If no one else is detecting this, possibly (7-Zip) may be causing the problem.  I'll double check my system this morning, just to make sure and then try extracting your files again.

PS: Complete check done on 304884 files and only one trojan caught in Project01.zip

I used WinRAR to create the zip file utilizing the 'Best' compression method. Could you reply with the name of the trojan so I can do some research and see if I can find it on my computer using a different AV program?

I'm attaching another Zip file, but this time without the EXE included and with 'Normal' compression method set. Please let me know if it still has a virus in it.
Never use direct references to anything ever. Bury everything in
macros. Bury the macros in include files. Reference those include
files indirectly from other include files. Use macros to reference
those include files.

donkey

Hi Shooter,

A look at the code does little to help as I expect that EasyCode is generating much of it "behind the scenes" you're most likely to get help at the EasyCode forum as this does not appear to be a GoAsm related problem.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Tight_Coder_Ex


xandaz

   I don't understand most of this GoAsm. Should't you be processing BN_CLICKED before changing the text?

xandaz

Instead of SetWindowText,hButton,addr String

try:
push  offset String
push hButton
call SetWindowText
´


jj2007

Quote from: Shooter on December 01, 2010, 02:50:47 PM
Please let me know if it still has a virus in it.

No complaints from Avira. The name Gen.Trojan.Heur.FU says it all... sh*tty heuristic scan.