The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ragdog on September 20, 2009, 12:44:01 PM

Title: GetProfilestring
Post by: ragdog on September 20, 2009, 12:44:01 PM
Hi

I Have a question to GetPrivateProfileString
this ini file store a Number example 123

[xyz]
Number=123

This number need i for store to a Struct
struct   Test

   dwNumber   dd 0;   
ENDS
mov    [esi].dwNumber, 123  << this works fine now get i this number from ini


must i convert this number in hex or dword?


greets

Ist solved atodw   ::)
Title: Re: GetProfilestring
Post by: MichaelW on September 20, 2009, 01:44:37 PM
Or you could use  GetPrivateProfileInt (http://msdn.microsoft.com/en-us/library/ms724345(VS.85).aspx).
Title: Re: GetProfilestring
Post by: BlackVortex on September 20, 2009, 01:45:25 PM
 :toothy :green :toothy :green :toothy :green :toothy :green
Title: Re: GetProfilestring
Post by: ragdog on September 20, 2009, 01:48:48 PM
 :green Ohh lol

Thanks this is simply :bg

Greets
ragdog
Title: Re: GetProfilestring
Post by: ragdog on September 20, 2009, 05:38:47 PM
Hi


I have a question to this GetPrivateProfileInt

I use for my code in the ini a value from 0-9 ,If the entry empty what is with a error check

example ini file
[Option]
Value=0

I have a check for if eax ==0

if this value empty
[Option]
Value=

works this also hmm :'(

Gives a other solution?

Greets
Title: Re: GetProfilestring
Post by: MichaelW on September 20, 2009, 05:57:40 PM
For "Value=", or if the section or key is not found, the return value will be whatever was specified in the nDefault parameter. If 0 is a valid value, then perhaps you could set nDefault to -1 and check for that.