Qbasicnews.com
November 13, 2019, 02:25:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Using Interfaces?  (Read 947 times)
lkd85
Member
*
Posts: 63


« on: March 02, 2005, 12:57:35 AM »

Hey, I'm thinking on porting the Audiere library (unless someone else has) which has nothing but classes with virtual functions and was wondering if I can just use a UDT with function pointers within another UDT that contains it's pointer (Vtable ?)

Example (based off PureBasic port which implements interfaces):

Code:

Type RefCounted_VTBL
   ref As Function() As Long                ' Long
   unref As Function() As Long             ' Long
End Type

Type RefCounted
     vtable As RefCounted_VTBL Ptr
End Type

Type AudFile_VTBL
  ref As [RefCounted_VTBL or RefCounted?] ' All audiere classes extend RefCounted
  File_Read As Function (pbuffer As Long,size As Long)      ' long
  File_seek As Function(position As Long, SeekMode As Long)As Long  ' bool
  tell As Function() As Long                       ' long
End Type



I was following the DirectDraw port for reference. Any help would be greatful.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!