Quickly put: I need to use the VarDecFromStr function in oleaut32.dll (Actually I need to use all of the VarDec* functions) and Delphi
doesn't know about it.
Now the long version:
I'm having a few problems using Decimals in Delphi 4 (SP 3). I've got a COM
object written in C++ (MS) that passes a decimal inside a variant.
I eventually figured out how to get the decimal out on the Delphi side but
now I'm trying to create a decimal myself. I'm trying to use VarDecFromStr,
but Delphi 4 (and 5) does not have a header for this function. It's got headers for just about every other variant function in the OLE API but just about nothing related to decimals and variants.
So I went through the source files and found the declaration for VarBstrFromDec (the exact opposite of what I want, although I do use this
one also). So I copied that and changed it to VarDecFromStr (I made the right changes). Amazingly this actually worked.. well sort of. I've debuged
my code (at ASM level) and I definately know that VarDecFromStr is being
called. But as soon as my function (the one that makes the call to VarDecFromStr) exits I get an access violation. I've debugged this also and
it seems that when my function exists it pops the registers off the stack
(as one would expect), but something seems to go a bit wrong and the
execution point ends up at 0x00000000.. obviously a really bad thing.
So... has anyone ever used this before?? Or does anyone know of a header
file that has a delphi conversion of this routine?? Or has anyone got any