I am working on a VB project where a Server .tlb file written in C++ by somebody else will enable me to determine when something happens on the server. The problem is that the typelib file that I try to use wont allow me to use the keyword withevents. I tried the following :
Private Withevents mDataServer as DataServerLib.DataServer
I get the error message 'Compile Error: Object Library Feature Not Supported'.
I am trying to access an event called Notify on the server dll.
How can I do this?
I think the answer involves creating a Lib file and implementing the ISetCallBackEvent function but my knowledge of VB and Google goes a bit hazy at this point.
So far I have:
DataServer.tlb (the thing I'm trying to access)
DataServerLib (a VBP ActiveX DLL I've built) with the following class in:
DataServerInterface (an interface I've typed in of all the dummy properties, methods and events provided in the tlb)
ICallbackEvents (2 subs in it)
(Which lead me onto another issue :
In the ObjectBrowser for the typelib file there is a read only property 'Data' with the following definition :
Property Data(nRow As Long, nColumn As Long) As String
How do I declare the property for this in VB?
I tried the following:
Public Property Get Data() As String
End Property
Public Property Let Data(ByVal nRow As Long, ByVal nColumn As Long)
End Property
But it wont compile.
Am I on the right track with all this or am I barking up the wrong tree.
Is it possible to get an event notification without using the WithEvents keyword?
Private Withevents mDataServer as DataServerLib.DataServer
I get the error message 'Compile Error: Object Library Feature Not Supported'.
I am trying to access an event called Notify on the server dll.
How can I do this?
I think the answer involves creating a Lib file and implementing the ISetCallBackEvent function but my knowledge of VB and Google goes a bit hazy at this point.
So far I have:
DataServer.tlb (the thing I'm trying to access)
DataServerLib (a VBP ActiveX DLL I've built) with the following class in:
DataServerInterface (an interface I've typed in of all the dummy properties, methods and events provided in the tlb)
ICallbackEvents (2 subs in it)
(Which lead me onto another issue :
In the ObjectBrowser for the typelib file there is a read only property 'Data' with the following definition :
Property Data(nRow As Long, nColumn As Long) As String
How do I declare the property for this in VB?
I tried the following:
Public Property Get Data() As String
End Property
Public Property Let Data(ByVal nRow As Long, ByVal nColumn As Long)
End Property
But it wont compile.
Am I on the right track with all this or am I barking up the wrong tree.
Is it possible to get an event notification without using the WithEvents keyword?