PDA

Click to See Complete Forum and Search --> : What kind of variable should i use


Jan 10th, 2001, 01:46 AM
This is my code...


.386
.model flat, stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

MainDialogProc proto :HWND, :UINT, :WPARAM, :LPARAM

.data
Msg1Cap db "MainDialogX =", 0
Msg2Cap db "MainDialogY =", 0
Position db "Position", 0
iniString db "Fonts.ini", 0
X db "X", 0
Y db "Y", 0

.data?
MainDialogX dd ?
MainDialogY dd ?

.const

.code
start:
invoke GetPrivateProfileInt, addr Position, addr X, 200, addr iniString
mov MainDialogX, eax

invoke GetPrivateProfileInt, addr Position, addr Y, 200, addr iniString
mov MainDialogY, eax

invoke MessageBox, NULL, addr MainDialogX, addr Msg1Cap, MB_OK


invoke ExitProcess, 0

end start


The variable 'MainDialogX' for some reason will not hold the value that is returned by 'GetPrivateProfileInt', what kind of variable shold it be?

Sophtware
Jan 16th, 2001, 02:08 PM
Not to sound stupid but..

did you try changing the "Msg1Cap" to "MainDialogX"?

Like so...


invoke MessageBox, NULL, addr MainDialogY, addr MainDialogX, MB_OK





I got the value to appear in the Caption of the msgbox..but i havent been able to add the " MainDialogX = " part to it yet.


Does this help at all?