Print Page | Close Window

Unable to cast object

Printed From: Way2call Communications
Category: Hi-Phone Software Development Kit (SDK)
Forum Name: Hi-Phone and .NET
Forum Description: Discussion on the Hi-Phone product family, its .NET interface, samples and development tools
URL: http://www.way2call.com/forum/forum_posts.asp?TID=68
Printed Date: Nov 09 2024 at 1:43pm


Topic: Unable to cast object
Posted By: mattj
Subject: Unable to cast object
Date Posted: Apr 21 2010 at 11:10am
I'm trying to create a set of generic classes from the SDK .net example. Everything compiles fine but I get the error:

"Unable to cast object of type 'XXX.cls_way2call' to type 'System.ComponentModel.ISynchronizeInvoke'."


It chokes up at:

cls_call.Driver.Device(INT_PROP_DEVICE).Open(0)


I'm not sure exactly what's going on here. Any help would be much appreciated. I've attached a link to the classes below.

http://mattjan.us/cls_call.zip - http://mattjan.us/cls_call.zip



Replies:
Posted By: mattj
Date Posted: Apr 21 2010 at 11:12am
Sorry, it choes up at

Driver.Device(INT_PROP_DEVICE).Open(0)

in cls_call.CallNumber.


(editing/deleting posts would be a useful feature)


Posted By: mattj
Date Posted: Apr 21 2010 at 2:54pm
I got my class working by adding

Implements System.ComponentModel.ISynchronizeInvoke

Do i need to add anything to the following functions?:


   Public Function BeginInvoke(ByVal method As System.Delegate, ByVal args() As Object) As System.IAsyncResult Implements System.ComponentModel.ISynchronizeInvoke.BeginInvoke

    End Function

    Public Function EndInvoke(ByVal result As System.IAsyncResult) As Object Implements System.ComponentModel.ISynchronizeInvoke.EndInvoke

    End Function

    Public Function Invoke(ByVal method As System.Delegate, ByVal args() As Object) As Object Implements System.ComponentModel.ISynchronizeInvoke.Invoke

    End Function

    Public ReadOnly Property InvokeRequired() As Boolean Implements System.ComponentModel.ISynchronizeInvoke.InvokeRequired
        Get

        End Get
    End Property



Print Page | Close Window