The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: M4D45M on March 01, 2005, 11:32:11 PM

Title: String to integer conversion question
Post by: M4D45M on March 01, 2005, 11:32:11 PM
Hello there,

is it a good idea to use "UFromSz" (MAPI32.DLL) to convert a string to an integer ??,
or is there any other api-function to do the job ?

I get the BaseAddress of the MAP32.DLL but I had a problem with getting the address of UFromSz via GetProcAddr !?!?!?,
what could be the problem. ?

thanx in advance....
Title: String to Integer Conversion 2
Post by: M4D45M on March 02, 2005, 01:29:51 AM
I looked up the function's name in the file mapi32.dll: it is "UFromSz@4". (It failed previously cuz I used "UFromSz")

with this, GetProcAddress didn't fail but when I called the function
I retrieved an error (GetLastError) saying that the procedure could not have been found.  WTF?  :(

I wondered what the "@4" means.  - there are also some functions with "@8" or "@12" added.

anybody into this ?
how can I make the function work ?!?

Help is very appreciated, I'm totally stuck with this..
Title: Re: String to integer conversion question
Post by: Jibz on March 02, 2005, 09:28:00 AM
I merged your two topics, since the second was a continuation of the first.

You might want to look into the a2dw and atodw functions in the m32lib folder of the MASM32 installation, they both convert an ascii string to a DWORD :U.

The @4 at the end of the function is because the function uses the stdcall calling convention. It tells you that the function parameters are 4 bytes big, which means 1 DWORD (probably a string pointer in this case).