Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling Decimal Type? 1

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,311
US
I've been working with an ActiveX interface which has a type of "Decimal" in the original function prototype.

The type library converter helpfully called it "OleVariant", but I'm not having any luck getting any data out of it..

Any help would be appreciated.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
care to say which interface?

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
care to say which interface?

IUpdate.MinDownloadSize for one example. I have it returning other "familiar" data types out of that interface, so I'm not having a problem there. It's just that "OleVariant" seems to not be doing the job (in some way) to return what I need. Like was said, the variable that this returns is called "Decimal" in the original interface headers.

This is the thing that comes up that seems closest to what it's looking for, but I'm still not sure that's correct.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Perhaps try type casting to a double or use VarAsString and then cast it to a double.
 
Got it figured out (somewhat by chance, but figured out just the same). Turns out, the redefinition of values really wasn't warranted as it actually was returning a static Delphi TDecimal.

I ended up doing:

Code:
var
  test: OleVariant;
  test_out: Double;

test := MyUpdate1.MaxDownloadSize;
VarR8FromDec(@test, test_out);

I'll probably write a function to do this since I have many values like this I will want to access as I get further along in the project I'm working with.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top