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 / December 2004



Tip: Looking for answers? Try searching our database.

Callback from VB6 to C

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MT - 28 Dec 2004 01:49 GMT
aloha,
i have this activex exe that runs without problems
and provides a com interface to a C++ program
i have exposed one function and one event, also no problems
now they want to pass a pointer to a function so i can
callback the C++ program instead of raising the event
assuming this works to get the address of the C++ function

Public Sub SetCallBack(ByVal CallBackAddr As Long)
   CallBackAddress = CallBackAddr
End Sub

how do i actually "call" the C++ function ?
thanks for any help
mike
alpine - 28 Dec 2004 02:21 GMT
>aloha,
>i have this activex exe that runs without problems
[quoted text clipped - 11 lines]
>thanks for any help
>mike

That's the tough part.  You can't call a function pointer in VB
without jumping through some pretty serious hoops.  If you absolutely
must follow this direction, you should pick up a copy of Matt
Curland's Advanced VB6 book.  

If the need for calling the pointer isn't set in stone, you may be
better off going another route.  They could, for instance, provide a
method on a COM interface that is passed into your application that
you could then call.  Or, they could export the function and you could
call it via a declare statement from your VB code.

HTH,
Bryan
____________________________________________________________
New Vision Software                   "When the going gets weird,"
Bryan Stafford                     "the weird turn pro."
alpine_don'tsendspam@mvps.org     Hunter S. Thompson -  
Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas
 
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.