vb winamp header tranlsation

Started by vbdude,

vbdude

Has anyone translated the following structures into visual basic? I could do it, but I don't know how to translate those function pointers over to vb.

typedef struct winampDSPModule {
  char *description;            
  HWND hwndParent;                    
  HINSTANCE hDllInstance;
  void (*Config)(struct winampDSPModule *this_mod);    
  int (*Init)(struct winampDSPModule *this_mod);    
  int (*ModifySamples)(struct winampDSPModule *this_mod, short int *samples, int numsamples, int bps, int nch, int srate);      
  void (*Quit)(struct winampDSPModule *this_mod);    
  void *userData;
} winampDSPModule;

typedef struct {
  int version;        
  char *description;
  winampDSPModule* (*getModule)(int);      
} winampDSPHeader;

(: JOBnik! :)

Hi ;D

Public Type winampDSPModule
    description As Long
    hWndParent As Long
    hDllIstance As Long
   
    config_dalog As Long
    Init As Long
    ModifySamples As Long
    Quit As Long
   
    userdata As Long
End Type

Public Type winampDSPHeader
    version As Long
    description As Long
    winampDSPModule As Long
End Type

Have fun!

8) JOBnik! 8)

vbdude

Thanks man,

I thought that was probably what it would look like, but I just can't understand how I would execute a function from a winamp plugin dll if the return values are all long.

The function winampDSPGetHeader2 actually returns a structure of winampDSPHeader, but it only lets me have the return value of long.

How would I execute the winampDSPGetHeader2 function and have it populate a variable of type winampDSPHeader?

can anyone help?
Thanks,

Public Declare Function winampDSPGetHeader2 Lib "C:\program files\winamp\plugins\dsp_chrono.dll" () As Long

Public Type winampDSPModule
   description As Long
   hWndParent As Long
   hDllIstance As Long
  
   config_dalog As Long
   Init As Long
   ModifySamples As Long
   Quit As Long
  
   userdata As Long
End Type

Public Type winampDSPHeader
   version As Long
   description As Long
   winampDSPModule As Long
End Type




KarLKoX

It is impossible to use winamp plugin only from VB 'coze VB can't handle function pointers in a struct and is not compatible witch _cdecl naming convention. Though, you must code a dll wich will fill the struct to a pointer from a GetProcAddress call. I ve such thing for FMOD (dsp and vis), i am thinking to a bass "port" ::)