Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / April 2005



Tip: Looking for answers? Try searching our database.

ocx callback function convert VC++ to VB6

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
juky - 15 Apr 2005 12:47 GMT
Hi all,
I'm using a 3rd part component (ocx) in vb6 and I have an example (see
below) in VC++ how to use a callback function.
I need to convert that example in VB6, any help would be appreciate.

Thanks,
Juky

.......
// define callback function.
int GetBuffer(int s, int w, int h, LPBYTE p)
{
   ... // any code
   return 0;
}

......

myOCX.SetCallBack((long)GetBuffer);
Jonathan Wood - 15 Apr 2005 21:28 GMT
You'll need to define the function in a BAS module and it would look
something like this.

Function GetBuffer(ByVal s As Long, ByVal w As Long, ByVal h As Long, ByVal
p As Long) As Long

Signature

Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm

> Hi all,
> I'm using a 3rd part component (ocx) in vb6 and I have an example (see
[quoted text clipped - 15 lines]
>
> myOCX.SetCallBack((long)GetBuffer);
juky - 16 Apr 2005 17:02 GMT
Hi convert the code in this way:

Function GetBuffer(ByVal s As Long, ByVal w As Long, ByVal h As Long,
ByValp As Long) As Long
   .......
End Function

myOCX.SetCallBack (GetBuffer) ' define callback function.

but I have compile error in the last espression, due to missing
parameters in GetBuffer !!!!!

Juky

> You'll need to define the function in a BAS module and it would look
> something like this.
[quoted text clipped - 27 lines]
> >
> > myOCX.SetCallBack((long)GetBuffer);
Jim Mack - 16 Apr 2005 19:28 GMT
> Hi convert the code in this way:
>
[quoted text clipped - 9 lines]
>
> Juky

Try:

myOCX.SetCallBack AddressOf GetBuffer

Signature

       Jim

juky - 20 Apr 2005 11:29 GMT
Hi Jim,

I tried your solution but still compile error.
Still no idea how to convert that code frm VC++ to VB6!

Juky

> > Hi convert the code in this way:
> >
[quoted text clipped - 13 lines]
>
> myOCX.SetCallBack AddressOf GetBuffer
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.