[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using AddressOf to call function in VC++ DLL from VB

Posted on 2006-06-21
1
Medium Priority
?
495 Views
Last Modified: 2008-02-26
Been given a third party DLL written in Visual C++
This DLL have a method to enable a client to give the address of a callback method.
A DLL's background thread calls the client's callback when some events occur.

I am given the following details, not sure what to make of it since i do not know VC++ :-
int openDevice(int typ, CALLBACKBCOM cbf, void* param=NULL)
where the parameters
cbf specifies the user callback procedure with definition: typedef void (CALLBACKCOM)(int nStatus, int nTracks)

How can i write a VB program to get data making use of the operator AddressOf? I am not familiar with VB's CallBack although i have gone through some samples on this site.

Some sample code would be appreciated.

Thanks,
Joanne
0
Comment
Question by:BSKhoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
EDDYKT earned 500 total points
ID: 16951190
how about

Public Sub callback_function(ByVal nStatus As Long, ByVal nTracks As Long)
     ' Do your stuff
End Sub

dim Ret as long

Ret = openDevice(1, AddressOf (callback_function))
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question