Dec 3rd, 2024, 5:34pm
Welcome, Guest. Please Login or Register.
Pages: 1  Reply Reply  Notify of replies Notify of replies  Print Print
   Author  Topic: InvalidCastException in ftvspcnet.dll  (Read 3518 times)
InvalidCastException in ftvspcnet.dll
on: May 6th, 2022, 11:57am
Quote Quote  Modify Modify

I am trying to build an app that opens a COM-port in .NET (C# VS2022, Win 11, x64).
 
The demo project provided by FabulaTech named VSPCDemo.sln is working flawless in VS2022.
I have ported relevant parts of this code into my project (same .NET runtime version) and I am also able to open and close ports. I can send bytes without a problem and I have registered to OnRxChar event and this event is triggered once bytes are received.
BUT in my application any incoming byte raises an exception in the underlying library ftvspcnet.dll.
Output Log from VS:
 
Exception thrown: 'System.InvalidCastException' in ftvspcnet.dll
 
This happens for every incoming byte which causes the communication to slow down severely rendering it impossible for my use case. This happens also, if I do not register the OnRxChar event but poll for InQueueBytes > 0. The exception is fired immediately after a byte is received and processed by ftvspcnet.dll. I have no option to trace this issue myself.
 
Project settings are identical as in the sample. Everything is the same but I keep getting this exception.
Last Edit: May 6th, 2022, 12:56pm by Ben IP Logged
Pages: 1  Reply Reply  Notify of replies Notify of replies  Print Print

Previous topic | Next topic
Online Talk to our
support team or
sales department.