Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi,

FSUIPC: 3.1.1.0

FS: 2002

OS: Win2000 SP3

I just received my program access key, and want to write it to offset 0x8001. This is the VB code (in which ABCDEFGHIJKL is my key) :

text = "ABCDEFGHIJKL" & Chr$(0)

If FSUIPC_WriteS(&H8001, Len(text), text, dwResult) Then

If FSUIPC_Process(dwResult) Then

If FSUIPC_Write(&H8001, 2, VarPtr(mode), dwResult) Then

FSUIPC_Process (dwResult)

End If

End If

End If

When running my app, I get an error about not being regsitered. When I look at FSUIPC.LOG I read:

99922 Client Application: "BOTA" (Id=1972)

99922 F:\BOTA\BOTA2004\DataProg\BOTA.exe

99922 Product="BOTA"

99922 Company="Battle of the Airlines Trophy"

100047 Illegal write attempt: offset F8001, size 13

100047Program not accredited for use with this unregistered FSUIPC

Looks like I need to register the access key, before I can write it to F8001?? Or is something wrong with my data/key?

I haven't entered my access key manually on purpose to simulate how my program would run on a machine of someone else.

Thanks,

Raymond

Posted

If FSUIPC_Write(&H8001, 2, VarPtr(mode), dwResult) Then

...

100047 Illegal write attempt: offset F8001, size 13

100047Program not accredited for use with this unregistered FSUIPC

Seems that Visual Basic keeps too many odd things it does secret or just undocumented, since many VB programmers seem to have this problem. What the VB compiler seems to do is take your

&H8001

and expands it into &HFFFF8001 -- i.e. it sign extends it.

This is not a valid offset for FSUIPC, though the top 16 bits are used for control flags for special purposes, mostly to do with the Advanced Weather Interface. So FSUIPC masks the flags it currently understands and this gives it the F8001, which is of course illegal too.

I've been told the the (stupid?) VB compiler even does the same if you explicitly give it as:

&H00008001

which I think is really really bad! :?

I've been informed that you can stop the sign extension by post-pending another &, i.e.

&H8001&

Alternatively decimal works too, for some reason (&H8001 = 32769).

I just wish there was some logical consistency in VB and at least that such weird interpretations were well documented in the VB programming books.

:(

Regards,

Pete

Posted

Raymond,

I already posted the process a few weeks ago since a similar question was asked..may be it could help again

Accessing FSUIPC registration status and, if necessary, register a program in VB can be performed with the following code

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 the &H330C location

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

Dim AccessByte as byte

Dim IsRegistered as byte

Dim tb as boolean 'temp boolean variable

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

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) the user doesn't 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)..

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

If IsRegistered=0 then

tb = FSUIPC_WriteS(&H8001&, Len(FSUIPCKey), FSUIPCKey) 'send the key through a [WriteS] and process ; don't forget the double && in H8001 as Pete pointed out and also discard the function result (dwResult or any other..it's meaningless)

tb = FSUIPC_Process ' same here

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

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

Hervé

Posted

Still no luck.... Pete can it be that the access key ain't right?

1) I disabled all registration stuff in my code and checked that the program works correctly with FSUIPC 2.97

2) I put FSUIPC.DLL 3.1.1.0 back, rebooted, loaded FS2002, hit Modules | FSUIPC | "register an application program". I entered "BOTA" (without the double quotes) & the access key, pressed OK, got the message to restart the calling app, pressed Confirm.

3) Started BOTA.EXE and problem remains; see log:

100000 Client Application: "BOTA" (Id=864)

100000 F:\BOTA\BOTA2004\DataProg\BOTA.exe

100000 Product="BOTA"

100000 Company="Battle of the Airlines Trophy"

100125 Illegal read attempt: offset 320C, size 4

100125Program not accredited for use with this unregistered FSUIPC

So even if I enter the 12 digit accesscode manually BOTA won't run... I copy & pasted the key from your email, so there's no typing error.

Or should I download a special version of FSUIPC.DLL? I got version 3.1.1.0 from http://www.schiratti.com/files/dowson/FSUIPC.ZIP.

Thanks, by the way this messageboard is GREAT!

Raymond

Posted
Still no luck.... Pete can it be that the access key ain't right?

100000 F:\BOTA\BOTA2004\DataProg\BOTA.exe

100000 Product="BOTA"

100000 Company="Battle of the Airlines Trophy"

No, the details in your Version Information are wrong. These are the details you sent to me:

> Program name: BOTA.EXE

> Company: The Battle of the Airlines Trophy

> Produkt name: BOTA

You missed a "The " in the Company name!

Computers are stupid. They do exactly what you tell them, not what you really want them to do! :)

Regards,

Pete

Posted

I disabled all registration stuff in my code and checked that the program works correctly with FSUIPC 2.97

By the way, the registration access system is not a problem with older versions of FSUIPC (pre version 3) -- they'll just ignore it (well, they will write to offset 8001 and you can probably read it back too! But the area isn't used for anything else). So you don't need two versions or need to remove code to test.

Regards,

Pete

Posted

I feel like a stupid fart.... but it's working now, thanks Pete!!

I do have one more question: it works ok if I compile my stuff and then run it. But I can't run my program from VB6 in uncompiled mode, because then understandably I get this error:

112078 Client Application: "vb6" (Id=536)

112078 F:\Program Files\Microsoft Visual Studio\VB98\vb6.exe

112078 Product="Visual Basic"

112078 Company="Microsoft Corporation"

112234 Illegal read attempt: offset 320C, size 4

112234Program not accredited for use with this unregistered FSUIPC

Do you also have a VB6 developers accesss key?

Raymond

Posted

Do you also have a VB6 developers accesss key?

No, sorry. I really hoped that developers would be kind enough to purchase a full FSUIPC key. After all I do not make any charges for all the work I do on the SDK nor for the support I offer (though the FSUIPC user documentation does actually imply that support is for registered users only).

If you have a personal FSUIPC key then you do not need keys for anything else. To simply test your own application's access key you can temporarily remove the FSUIPC.KEY file.

Regards,

Pete

Posted

I see what you mean, and can't help but say you're right. I took my part in forfilling your hopes and ordered a full key thru simmarket just now.

Thanks for all, you've been a great help in the past and I'm sure you'll continue to be that in the future!

Raymond

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.