News:

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

String to integer conversion question

Started by M4D45M, March 01, 2005, 11:32:11 PM

Previous topic - Next topic

M4D45M

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....

M4D45M

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..

Jibz

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).