News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

MASM example code needed

Started by jayanthd, March 15, 2013, 08:13:46 PM

Previous topic - Next topic

dedndave

so - you have a main window - then a dialog box ?
or do you just want the dialog box ?

qWord

I'm allowed to ask for what the resulting application is used?
MREAL macros - when you need floating point arithmetic while assembling!

jayanthd

Quote from: dedndave on March 16, 2013, 02:12:02 AM
so - you have a main window - then a dialog box ?
or do you just want the dialog box ?


@dedndave


I don't need the main windows. I need just the Dialog window.


Here is my new WinASM project. I have used the Dialog>Base for the GUI. Please provide me the code.




jayanthd

Quote from: qWord on March 16, 2013, 02:22:37 AM
I'm allowed to ask for what the resulting application is used?


@qWord


I am actually doing some project where user inputs a numerical value and depending upon that some calulation is done and numerical result is converted to string and displayed in the Edit box. So, I want to know how to do it. What I have mentioned here is not the actual project. I have done such projects in VB, VB.Net, VC#.net, Delphi but I want to try it in ASM.

qWord

Quote from: jayanthd on March 16, 2013, 03:13:40 AMI am actually doing some project where user inputs a numerical value and depending upon that some calulation is done and numerical result is converted to string and displayed in the Edit box.
AFAICS we have a 'Generate'-Button and a output string of the form '1-234-567-890' (from your source) - I would call this a Key generator   ::)
MREAL macros - when you need floating point arithmetic while assembling!

jayanthd

#20
Quote from: qWord on March 16, 2013, 04:00:47 AM
Quote from: jayanthd on March 16, 2013, 03:13:40 AMI am actually doing some project where user inputs a numerical value and depending upon that some calulation is done and numerical result is converted to string and displayed in the Edit box.
AFAICS we have a 'Generate'-Button and a output string of the form '1-234-567-890' (from your source) - I would call this a Key generator   ::)


No. It is not a keygen. I just was trying to assign some initial value to Edit box. Actually it will be in the form "1234567890". There won't be hypens. See add.zip in reply 17.

qWord

Well, I can't help you with WinASM, but the attached example (MASM32 SDK 11) shows an advanced solution that validates the input while the user types the number in.
This is done using the CRT function sprintf() and sscanf(). Also remarks the fn- and rv-macros, which are described in the help file \masm32\help\hlhelp.chm.
MREAL macros - when you need floating point arithmetic while assembling!

jayanthd

Quote from: qWord on March 16, 2013, 05:57:23 AM
Well, I can't help you with WinASM, but the attached example (MASM32 SDK 11) shows an advanced solution that validates the input while the user types the number in.
This is done using the CRT function sprintf() and sscanf(). Also remarks the fn- and rv-macros, which are described in the help file \masm32\help\hlhelp.chm.


It is giving fatal error. http://www.pixhost.org/show/3145/16328592_masm32.jpg


Ok. Give MASM32 code.

dedndave

that error generally occurs when you already have an instance of the program running
terminate it before assembling   :t

jayanthd

Quote from: dedndave on March 16, 2013, 09:13:49 AM
that error generally occurs when you already have an instance of the program running
terminate it before assembling   :t


Yes. It compiled after I followed your method but when I run it, it doesn't appear on the screen. It is shown in Task Manager (RCDlg.exe)
No GUI of the app on screen.

jj2007

It assembles just fine. Check if the right resource file, if any, is being used. The rc file is named after the asm file, i.e. RCDlg.rc. There are some IDEs which understand that, such as RichMasm, but others may look for rsrc.rc and will not find it.

jayanthd

Quote from: jj2007 on March 16, 2013, 06:19:52 PM
It assembles just fine. Check if the right resource file, if any, is being used. The rc file is named after the asm file, i.e. RCDlg.rc. There are some IDEs which understand that, such as RichMasm, but others may look for rsrc.rc and will not find it.


I already said it assembles and links but If I run the RCDlg.exe created it doesn't show any GUI on the screen but I can see it in Task Manager.

jj2007

Yes. That is because it does not link in the resource file, as described above. Read posts carefully before responding.

jayanthd

Quote from: jj2007 on March 16, 2013, 06:52:04 PM
Yes. That is because it does not link in the resource file, as described above. Read posts carefully before responding.


Thanks. It worked after including the RCDlg.rc file in the .asm file. I need a sample code for button click that is if Generate button is clicked then the results should be generated. Now it is generating the result if text changes in 1st edit box.

dedndave

most of us don't use the IDE you are using
some use IDE's, some just use batch files

we can modify the assembly behaviour by choosing different batch files
the ones i use look for "%1.rc", then "rsrc.rc" in the same folder as the asm file
if either is found, it is compiled with the resource compiler, then linked with the rest of the program