LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 October 11 2004

KingRhye
Member

Programming problem

I've been working with a voicetronix card for a while now, it's a voice processing board, sort of like an enhanced voice modem, check out the site www.voicetronix.com, the card I'm using is OpenLine4 on a WinXP platform. Now the problem is this: its library (vpbapi) is all coded in C and I need to translate the functions to VB6. Now I did translate all of them and I had no problem with pointers and UDT's and data type translation, except for one function, the callback. If you're a C programmer then you know what a callback function is, so what I need is to translate it to a VB6 declaration, but the thing is that this callback function also requires parameters sent as pointers:

#define	WINAPI	__stdcall
typedef struct {
	int	type;		// event type
	int	handle;		// channel that generated event
	int	data;		// optional data
	unsigned long data1;
} VPB_EVENT;
int WINAPI vpb_set_event_callback(
		  int handle, 
		  void (WINAPI *event_callback)(VPB_EVENT *e, void *context),
		  void *context);

Gotta turn that into a Declare Function vpb_set_event_callback Lib "libvpb.dll" (......) as Long
Any idea how to declare the parameters using AddressOf and VarPtr ?

Offline

#2 October 13 2004

KingRhye
Member

Re: Programming problem

Waiting for the sun.. waiting for the sun..

Offline

#3 October 14 2004

waleed
Member

Re: Programming problem

Goddot might arrive anytime now :rolleyes:
keep the "faith" :lol:

Offline

#4 October 15 2004

albeeert
Member

Re: Programming problem

I've been working with a voicetronix card for a while now, it's a voice processing board, sort of like an enhanced voice modem, check out the site www.voicetronix.com, the card I'm using is OpenLine4 on a WinXP platform. Now the problem is this: its library (vpbapi) is all coded in C and I need to translate the functions to VB6. Now I did translate all of them and I had no problem with pointers and UDT's and data type translation, except for one function, the callback. If you're a C programmer then you know what a callback function is, so what I need is to translate it to a VB6 declaration, but the thing is that this callback function also requires parameters sent as pointers:

#define	WINAPI	__stdcall
typedef struct {
	int	type;		// event type
	int	handle;		// channel that generated event
	int	data;		// optional data
	unsigned long data1;
} VPB_EVENT;
int WINAPI vpb_set_event_callback(
		  int handle, 
		  void (WINAPI *event_callback)(VPB_EVENT *e, void *context),
		  void *context);

Gotta turn that into a Declare Function vpb_set_event_callback Lib "libvpb.dll" (......) as Long
Any idea how to declare the parameters using AddressOf and VarPtr ?

i'm still beginner in c programming, i'm gonna ask my teacher... wait for next week :oops:

Offline

#5 October 16 2004

KingRhye
Member

Re: Programming problem

Thanx Albert.. as for the rest of the "so-called programmers" in here, hehehehe ddabdabo.

Offline

#6 October 16 2004

samer
Admin

Re: Programming problem

bleh  .. didn't study C yet .. so i can't help :?

Offline

#7 October 19 2004

cyber_lady
Member

Re: Programming problem

i did take c at uni and never cared much for it...

Offline

#8 October 29 2004

joey
Member

Re: Programming problem

Thanx Albert.. as for the rest of the "so-called programmers" in here, hehehehe ddabdabo

don't think that saying that to us "so-called programmers" is not a nice thing to do, i mean even if we're not as good as you are in programming, c'mon, give us some credit, and be nice.

Offline

#9 October 29 2004

samer
Admin

Re: Programming problem

you'll have to get used to sam :)

Offline

#10 October 29 2004

KingRhye
Member

Re: Programming problem

Earn the credit. I was referring to the people who bragged about their programming skills in another topic, like if they were programming gods or something, then ma tole3 7esson bel VB6 topics I made.. tsk tsk..

Offline

#11 October 30 2004

joey
Member

Re: Programming problem

umm wasn't it you who was bragging about being a programming god?!
yeah that's right, i think it was YOU who was saying "yalla dabdabo"!!

Offline

#12 October 30 2004

KingRhye
Member

Re: Programming problem

LOL el hay2a fehmak ghaliz ya shreek.. I said "yalla dabdabo" when no one replied to my 2 topics, and I never bragged about anything, I consider myself to be an average programmer, but if I know a glimpse of VB6 or C or whatever, I don't post it and say I know the language, as others did, go check the topic. ;)

Offline

#13 November 28 2004

ccadic
Member

Re: Programming problem

I've been working with a voicetronix card for a while now, it's a voice processing board, sort of like an enhanced voice modem, check out the site www.voicetronix.com, the card I'm using is OpenLine4 on a WinXP platform. Now the problem is this: its library Gotta turn that into a Declare Function vpb_set_event_callback Lib "libvpb.dll" (......) as Long
Any idea how to declare the parameters using AddressOf and VarPtr ?

Did you find a way to solve your problem ?
Maybe we can help. We are presently making a Voicetronix.ocx component to use with VB6/VB.net

Is it possible to see your VB translation code to detect where the problem is, and try to give you a solution ?

YOurs

Philippe.

Offline

#14 January 21 2005

alateos
Member

Re: Programming problem

I've been working with a voicetronix card for a while now, it's a voice processing board, sort of like an enhanced voice modem, check out the site www.voicetronix.com, the card I'm using is OpenLine4 on a WinXP platform. Now the problem is this: its library (vpbapi) is all coded in C and I need to translate the functions to VB6. Now I did translate all of them and I had no problem with pointers and UDT's and data type translation, except for one function, the callback. If you're a C programmer then you know what a callback function is, so what I need is to translate it to a VB6 declaration, but the thing is that this callback function also requires parameters sent as pointers:

#define	WINAPI	__stdcall
typedef struct {
	int	type;		// event type
	int	handle;		// channel that generated event
	int	data;		// optional data
	unsigned long data1;
} VPB_EVENT;
int WINAPI vpb_set_event_callback(
		  int handle, 
		  void (WINAPI *event_callback)(VPB_EVENT *e, void *context),
		  void *context);

Gotta turn that into a Declare Function vpb_set_event_callback Lib "libvpb.dll" (......) as Long
Any idea how to declare the parameters using AddressOf and VarPtr ?

I have one small question... why are you dying to use pointers to variables and functions in vb? It's obvious that vb is not the language of choice for pointers.

I recommend that you use a simple byref for your pointer variables. As for the callbacks, just use events in vb. That's what they're made for.

Offline

#15 May 28 2005

~mephisto~
Member

Re: Programming problem

easy wloo
so easy
just gimmy 5 minutess...(brb)

Offline

#16 May 28 2005

rolf
Member

Re: Programming problem

How come you're still not back after 3 hours?

Offline

#17 May 29 2005

samer
Admin

Re: Programming problem

hehe he was joking.

Offline

Board footer