Jump to content
The simFlight Network Forums

Autoregistering Application to FSUIPC


Recommended Posts

Hi Pete,

I have a little problem by writing the reg key values to the &H8001 area. I just wonder if someone else has tried this.

The key entered in the .key file is working so the problem must come from somewhere else. (I also cut&past it to get no writing errors.)

The connection to FSUIPC (3.08) is working, but when I try to write the key FSUIPC refuse to write it. ("Illegal write attempt: offset F8001, size 12")

Regards,

Michael Garbers

Link to comment
Share on other sites

The connection to FSUIPC (3.08) is working, but when I try to write the key FSUIPC refuse to write it. ("Illegal write attempt: offset F8001, size 12")

This is because, as mentioned in the new edition of the Access Registration guide in the new SDK, Visual Basic sign extends your &H8001 and actually sends FFFF8001, not 00008001. Many of those bits are used as flags for special facilities in WideFS, so FSUIPC derives the address 000F8001 from it, which is wrong.

I am not a Visual Basic programmer, and it never ceases to surprise me how so many obscure oddities like this lie in wait to trap relatively new programmers who's first choice is often this (to me) awful language, but I have been reliably informed that using &H8001& instead (note the post-pended &) stops the sign extension.

An alternative is to use decimal instead, i.e 32769.

Pete

Link to comment
Share on other sites

Hi Andragar

Here is the detailed process I use for accessing FSUIPC registration status and register a program if necessary

You must first determine if the FSUIPC owner has a registered version ; in such a case you do not have to worry about sending a "key"

For that you will have to check &H330C location

-------------------------------------------------------------------------------------

Dim AccessByte as byte,

Dim IsRegistered as byte

Dim tb as boolean 'temp variable

If Not FSUIPC_Read(&H330C, 1, VarPtr(AccessByte)) Then GoTo CloseExit 'my new FSUIPC_read routine directly returns TRUE/FALSE for success/failure

If Not FSUIPC_Process() Then GoTo CloseExit 'same for my new FSUIPC_Process routine

IsRegistered = AccessByte AND &H2 'will be 1 if user has a registered FSUIPC version, 0 otherwise

-------------------------------------------------------------------------------------

If (and only if) user do not have a registered FSUIPC version, you will have to send the program key and recheck the &H330C byte

Here is the code assuming you defined the FSUIPCKey variable as a 12 char string (Pete provided it to you for your freeware applications..be sure to remove all spaces)..A typical example is

FSUIPCKey="IZ2QREOXH4G7"

-------------------------------------------------------------------------------------

If IsRegistered=0 then

tb = FSUIPC_WriteS(&H8001&, Len(FSUIPCKey), FSUIPCKey) 'send the key through a [WriteS] and process

tb = FSUIPC_Process

If Not FSUIPC_Read(&H330C, 1, VarPtr(AccessByte)) Then GoTo CloseExit 'reread access byte and process

If Not FSUIPC_Process() Then GoTo CloseExit

If (AccessByte And &H2) = 0 Then GoTo CloseExit 'still 0, registration key failed..ask Pete ;-)

End If

-------------------------------------------------------------------------------------

Hope it will helps

Hervé

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.