Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

C++ DLLs in VB.NET

Avatar of matthewrhoades
matthewrhoades asked on
.NET ProgrammingVisual Basic.NETVisual C++.NET
8 Comments1 Solution646 ViewsLast Modified:
I am trying to write an application that has a viewfinder from a digital camera.  The manufacturer (Canon) has an SDK in C++, but my application is written in VB.NET.

I have managed to use DLLImport to utilize a few of the functions (I guess they work, they are returning TRUE as boolean values).  I have an issue though, with buffers.  

The documentation says that the last part of the PR_RC_StartViewFinder function points to a callback function.  The callback function is user defined, but is supposed to be structured as seen below.

pVFData is supposed to be a buffer.  I have all these functions and not being experienced deeply in C++, I just don't know how to pull them together.  I can start the viewfinder and trigger the callback function:

If PR_RC_StartViewFinder(myCamera.deviceId, 1, myViewFinderFunction(mycamera.deviceId, 0,1024,???) = true then
messagebox.show("Halleleujah")
end if

Any help would be appreciated.
//PR_RC_STartViewfinder:
 
prCAPI PR_RC_StartViewFinder(
prHandle CameraHandle,
prContext Context,
prViewFinderCB* pViewFInderCB)
 
//prResponse prSTDCall myViewFinderFunction(
prHandle CameraHandle,
prContext Context,
prUInt32 Size,
prVoid *pVFData)
ASKER CERTIFIED SOLUTION
Avatar of LordOfPorts
LordOfPortsFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers