|
-
November 27th, 1999, 12:20 AM
#1
How to raise events defined in the Implements Class
I am defining a common interface for various classes (polymorphism) using Implements clause. I have written a class to declare the interface (IClass). In all the other classes I put in an Implements clause to Implement the interface defined by IClass. I want to raise events defined in IClass, but the RaiseEvent function does not list or accept the events of IClass as parameters.
How can I raise the events defined by IClass.
-
November 28th, 1999, 05:36 PM
#2
Re: How to raise events defined in the Implements Class
I could be wrong on this, but I beleive that VB does not consider events as part of an interface. I'm currently doing the same thing and I'm having to redeclare the events in each control that is Implmenting my common Interface. It sux, but I'm pretty sure that's the way COM defines it. Interfaces have properties and methods. Events are part of an interface.
-----
Lee Perkins
TigerBase Technologies
-
April 26th, 2001, 12:42 PM
#3
Re: How to raise events defined in the Implements Class
I found this to be true as well, I thought that I could overcome the problem by creating an interface that has functions to replace the events. The program that would normally respond to the events would create a class that implements the interface. I thought that I could create an instance of the class and pass it to the class that was raising the events using a formal parameter or a property. That way the class or process that was raising events would call functions in the passed object to replace the functionality of the events.
My problem is that my activeX exe that was responding to events raised in another activex dll will not allow the external interface to be implelmented. The interface does not show up in the class.
What I mean is that you normally see three items in the left-hand drop down box of a class that implements an interface.
option Explicit
Implements MTInterface.cMTExtIfc
'Some functions
I would normally see the following items in the drop down list.
(General)
Class
cMTExtIfc
VB is not adding item three and I do not understand why. MTInterface is an external activex dll that contains my exposed interfaces
Please provide any insight.
This is the contents of the interface
option Explicit
public Sub ResultsKey(psResultID, psResultFileName, psFullPath)
End Sub
public Sub NoResults()
End Sub
public Sub ResultIDnotFound()
End Sub
public Sub ResultFileEOF()
End Sub
public Sub SetAssayVisible(pVisible as Boolean)
End Sub
public Sub SetWellVisible(pVisible as Boolean)
End Sub
public Sub SetAbsorbVisible(pVisible as Boolean)
End Sub
public Sub SetVesselVisible(pVisible as Boolean)
End Sub
public Sub UpdateResultsProgress(pValue as Integer)
End Sub
public Sub ResultsProcessed(psExitCode as MTenums.ExtractRetCodes, psKeys as string)
End Sub
public Sub CurrentField(ObjCode as MTenums.ExtractObjCodes, psFieldName as string)
End Sub
public Sub ItemComplete(ObjCode as MTenums.ExtractObjCodes)
End Sub
public Sub Processing(ObjCode as MTenums.ExtractObjCodes, psType as string)
End Sub
public Sub BatchInfoTestName(psTestName as string)
End Sub
public Sub SectorInfoAssayUpdate(piUpdate as Integer, piNumAssays as Integer)
End Sub
public Sub SectorInfoVesselUpdate(piUpdate as Integer, piNumVessels as Integer)
End Sub
public Sub SectorInfoWellUpdate(piUpdate as Integer, piNumWells as Integer)
End Sub
public Sub SectorInfoAbsorbUpdate(piUpdate as Integer)
End Sub
public Sub AssayUpdate(byval piUpdate as Integer, byval piNumAssays as Integer)
End Sub
public Sub BytesProcessed(byval ByteCount as Long)
End Sub
public Sub TotalBytes(byval ByteCount as Long)
End Sub
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|