| 发表于:2007-12-09 21:02:42 楼主 |
用c++调用的代码是,求高人写出用vb调用的代码 typedef struct { char c[40000]; } mpstr; typedef bool (*initmp3) (mpstr *mp); typedef void (*exitmp3) (mpstr *mp); typedef int (*decodemp3) (mpstr *mp, char *inmemory, int inmemsize, char *outmemory, int outmemsize, int *done); initmp3 initmp3; exitmp3 exitmp3; decodemp3 decodemp3; #define text_initmp3 "_initmp3" #define text_exitmp3 "_exitmp3" #define text_decodemp3 "_decodemp3" bool wmp3::initlibrary() { // get mpglib.dll interface _hmpglibdll = loadlibrary("mpglib.dll"); if (!_hmpglibdll) { error("can't load mpglib.dll"); return false; } initmp3 = (initmp3) getprocaddress(_hmpglibdll, text_initmp3); exitmp3 = (exitmp3) getprocaddress(_hmpglibdll, text_exitmp3); decodemp3 = (decodemp3) getprocaddress(_hmpglibdll, text_decodemp3); return true; } 然后使用其中一个函数 initmp3(&_mp); |
|
|
|
|