Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dealing with Unknown Data Types
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00438106
Message ID:
00438116
Views:
12
>I just tested my previous solution and it doesn't work, try this one instead:
>
>Function SmallIntToNum
>LPARAMETER tcSmallInt
>
>DECLARE RtlMoveMemory IN WIN32API ;
>INTEGER @DestNumeric, ;
>STRING @pVoidSource, ;
>INTEGER nLength
>LOCAL lnNum
>
>lnNum = 0
>=RtlMoveMemory(@lnNum, tcSmallInt, 1)
>
>RETURN lnNum
>
>
>AND To move it back to a small Int Use this one
>
>Function NumToSmallInt
>LPARAMETER lnInt
>
>DECLARE RtlMoveMemory IN WIN32API ;
>STRING@DestChar, ;
>INTEGER @pVoidSource, ;
>INTEGER nLength
>
>LOCAL lcRet
>lcRet = " "
>=RtlMoveMemory(@lcRet, lnInt, 1)
>
>RETURN lcRet

I don't think this is going to work in a call to a method of an ActiveX control; IAC, you're being much too difficult in your conversion!

FUNCTION SmallIntToNum
LPARAMETER tcSmallInt
RETURN ASC(tcSmallInt)

FUNCTION NumToSmallInt
LPARAMETER tnNumber
RETURN CHR(tnNumber)

IOW, ASC() and CHR() handle the conversion on their own without resorting to an API call...

Again, I don't think this will work, because the COM interface will see any VFP variable as a VARIANT, and will need to have it's diaper changed...
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform