Jump to content
The simFlight Network Forums

FSUIPCClient.DLL 2.4.0.0 calls/methods


motion

Recommended Posts

Good day

I just have I question regarding FSUIPCClient.DLL 2.4.0.0 calls.

I am using the module for interfacing a self-made program based on VB.NET.

In previous Versions of FSUIPC (VB6) there was a call like:

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

If FSUIPC_Read(adr, 1, VarPtr(fs_data), dwResult) Then

If FSUIPC_Process(dwResult) Then

...do something

End if

End if

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

Now I Need for VB.NET FSUIPC4 the same read-Call...

I tried it with following code, but it is not what I need for changing variables...

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

Public Sub FSUIPCDATA_get()

FSUIPCConnection.Process()

Dim dataget As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(adrget)

datagetv = dataget.Value

End Sub

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

"dataget" and "adrget" are changing variables.

With Kind regards...

Link to comment
Share on other sites

Hi,

 

The problem is that you are calling Process() before you've created the offset. You need create the offset first so it can be processed.

 

Also, if you declare Offsets for temporary use you must Disconnect() them from the DLL before they go out of scope. If you don't, the DLL will keep hold of them. You will eventually build up a large number of offsets and exceed the memory limits of FSUIPC requests.

Public Sub FSUIPCDATA_get()
   Dim dataget As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(adrget) ' Create offset
   FSUIPCConnection.Process() ' process the offset
   datagetv = dataget.Value ' get value
   dataget.Disconnect() ' disconnect it from the DLL
End Sub

Paul

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.