Jump to content
The simFlight Network Forums

Problem With FSUIPC And VB6


Recommended Posts

I have just one question for you VB gurus out there.

I have a form with a timer on it.

The timer sub reads info from FSUIPC when enabled.

Simple enough right.

Well it works great when I run it from inside visual studio. But when I compile and install, once that timer is enabled the whole program dissapears. No errors, no nothing.

Everything else works fine, but once the timer is enabled to read info from FSUIPC it just quits.

It doesnt do it in Visual Studio though, weird. Im confused.

Any Ideas? Need More Info?

Thanks

Michael Smith

Zion Virtual Airlines

Chief Operations Officer

Link to comment
Share on other sites

I had the same problem with an app not long ago. It would run from the IDE but wouldn't run compiled.

Since it doesn't happen from the IDE you can't use the debug either. What I ended u having to do was but a message box in after everything it did so as to see where it was crashing.

Richard

Link to comment
Share on other sites

  • 3 weeks later...
Ive been trying to set the pause function for ages. Could you send me an example?

I don't know VB, but if you can read the Pause indicator at offset 0264 then just preset the variable you are reading into to 1 (pause) or 0 (not pause), change the "Read" to a "Write" and the offset from 0264 to 0262 to address the pause control.

[sorry, in previous edition of this message I had 0262 and 0264 reversed]

There's no magic here, reading and writing numerical values is really identical excepting of course wuth writing you set the value beforehand, with writing you access the value after. The actual read or write takes place on the "Process" call.

Play with FSInterrogate to understand how the offsets work.

Pete

Link to comment
Share on other sites

here are two functions, one to read the pause state, the other to set it

Public Function pause() As Boolean ' 0 if not, 1 if retractable

Dim x As Integer

Dim dwResult As Long

Call FSUIPC_Read(&H264, 2, VarPtr(x), dwResult) 'updated 12/12/2002 per peter dowson

Call FSUIPC_Process(dwResult)

If x = 1 Then

pause = True

Else

pause = False

End If

End Function

Public Function set_pause(pause As Boolean) As Boolean

Dim x As Integer

Dim dwResult As Long

If pause Then

x = 1

Else

x = 0

End If

Call FSUIPC_Write(&H262, 2, VarPtr(x), dwResult)

Call FSUIPC_Process(dwResult)

End Function

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.