Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I extract a value from a Word?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00065848
Message ID:
00066182
Vues:
47
>>>From the DPI.H: DPIGetComptaVersion( WORD* wHigh, WORD* Low )
>>>
>>>DECLARE INTEGER DPIGetComptaVersion ;
>>> IN DPID32 ;
>>> SHORT @nHigh, ;
>>> SHORT @nLow
>>>
>>>nhigh = 0
>>>nLow = 0
>>>nWord = DPIGetComptaVersion(@nHigh, @nLow )
>>>? nWord
>>>
>>>this returns 10683142. How should I process that?
>>>
>>>If this might be of some help, this DLL has been written in Borland C.
>>>
>>>José
>>
>>WORD = unsigned integer on 2 bytes
>>SHORT = signed integer on 2 bytes
>>
>>General rules for DECLARE with WORD or SHORT:
>>
>>WORD or SHORT parameters:
>>Declare them as INTEGER. No conversions are needed. VFP does all the conversiond for you. Please notice that there is no SHORT for param declarations.
>>
>>WORD or SHORT as the returned value:
>>Declare the returned value as SHORT. This is very important. If you declare it as INTEGER, the returned value will not be correct.
>>
>>If the return value is WORD: VFP doesn't know how to handle this and some transformation may be needed: Since the returned value sould not be negative, you must test the returned value. If it's negative you must:
>>
>>lnReturnedValue = lnReturnedValue + 65536
>>
>>and this will give you the correct value.
>>
>>If the returned value is SHORT, no correction is necessary.
>>
>>For your specific case:
>>I have no idea how you can interpret the returned value. First, you must verify if you declared correctly the type of the returned value. Anyway, only the doc for this function can tell how you must interpret the value. Do you have any other doc?
>>
>>Seeing that the params are pointers to word, I would say that both of them are output params. So, maybe the function returns the version in these 2 params. For example:
>>
>>nHigh = 2, nLow = 78 might mean version = 2.78
>>
>>But this is just a guess. Once again, only the documentation can say this.
>>
>>Vlad
>
>I'll go back to the Docs, but I'm afraid there is not much more information to find. Anyway, the final result should read something like 2.07 or 2.06...
>
>José

Try to see if you have this info in nHigh and nLow as I said. This is a usual way to return the version of a product.

If it doesn't work, can you send me the C sources you have? There may be there some more info that can be extracted.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform