Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Save an image from the clipboard
Message
De
26/09/2008 08:01:10
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01349799
Message ID:
01350900
Vues:
22
Hi Bo,

Apart from the BINTOC()'s, we would have to adapt some more code,

There may be some few ICASE()'s, but the most problematic would be to change the Binary values used, when you used "0h"

Regards


Cesar




>I had some preliminary luck #DEFINEing out the CTOBIN and BINTOC functions when compiled in VFP8 (sample code below). I even posted a message on VFPX about it: http://www.codeplex.com/VFPX/Thread/View.aspx?ThreadId=1854.
>
>However, we never went any farther than this for backwards compatibility. I wanted to guage interest. Any time we spent on this aspect would be time taken away from adding new features or working on other cool projects like Cesar's FoxCharts project or the Reporting APPs.
>
>
>****************************************************
>
>This part would be in VFP9FUNCTIONS.H
>****************************************************
>#IF VERSION(5) < 900 
>#DEFINE BINTOC BINTOC_VFP9
>#ENDIF
>****************************************************
>
>CLEAR
>?BINTOC(65,"4rs")
>?BINTOC(65,4)
>
>
>#UNDEF BINTOC
>****************************************************
>
>This part would be in VFP9FUNCTIONS.PRG
>****************************************************
>FUNCTION BINTOC_VFP9(nValue, eFlags)
>
>IF VARTYPE(eFlags) = "N"
>RETURN BINTOC(nValue, eFlags)
>ENDIF
>
>DO CASE
>CASE UPPER(eFlags)="4RS"
>RETURN CHR(BITAND(nVal,0xFF))+;
>CHR(BITLSHIFT(BITAND(nVal,0x0000FF00),8))+;
>CHR(BITLSHIFT(BITAND(nVal,0x00FF0000),16))+;
>CHR(BITLSHIFT(BITAND(nVal,0xFF000000),24))
>*!ToDo: more code required...
>OTHERWISE
>ENDCASE
>ENDFUNC
>****************************************************
>
>
>
>>Hi Mark,
>>
>>>does GDIPlusX work with VFP8?
>>
>>you probably have to get rid of the TRY CATCH stuff inside the library. For CTOBIN() and BINTOC() you can use the following functions:
>>
>>*====================================================================
>>* Converts a 32-bit integer variable (LONG) into a binary string.
>>*====================================================================
>>Procedure APILongToChar
>>LParameter tnLong
>>
>>	Local lcString
>>	lcString = Space(4)
>>	Declare RtlMoveMemory in Win32API as __LongToChar ;
>>		String@, Long@, Integer
>>	__LongToChar( @lcString, @tnLong, 4 )
>>	
>>Return m.lcString
>>
>>*====================================================================
>>* Converts a binary string into a 32-bit unsigned integer.
>>*====================================================================
>>Procedure APICharToLong
>>LParameter tcString
>>
>>	Local lnLong
>>	lnLong = 0
>>	Declare RtlMoveMemory in Win32API as __CharToLong ;
>>		Long@, String@, Integer
>>	__CharToLong( @lnLong, @tcString, 4 )
>>	If m.lnLong < 0
>>		lnLong = m.lnLong + 2^32
>>	Endif
>>	
>>Return m.lnLong
>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform