Solved

Manage VB6 callback problem with external C DLL

Posted on 2010-11-20
2
558 Views
Last Modified: 2012-05-10
 Hi experts!

I have a Vb6 application which call C DLL via _stdcall. I manage to rule this external hardware no matter of some limits of VB6, with exception of callback.  Callback function do not works and I need to find a solution. Problem with callback function is that in Vb6 IDE it works fine, but in .exe file don’t work and make great crash (somethink even with blue screen  :-) )

 If I understand correct, problem is because the DLL calls these callback functions from other thread (for safety reason) and in this case VB6 can manage. More clear, I get callback function OK even in exe file, but if I try to read a parameters of this callback it crash. I need these parameters!


 I can’t change my Vb6 because I already have many code ready.
 I can’t change C DLL .because it is from external manufacturer.

Possible workaround is to create ActiveX OCX with C++ which manage this external DLL and to use this OCX in my VB6 application. Will this work ? I really need advice – MS VC 6.0 with sure will be able to work with these callback, but OCX is in same thread of VB6 application, then will or will not work?

Or what type of MS VC6 project I need which I can reference to Vb6 and to work ? I’m 10+ years professional programmer, but new to C and will be very bad to write this OCX a week or more just to find that I’m in the same situation.

Please help.
0
Comment
Question by:dvplayltd
[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
2 Comments
 
LVL 13

Accepted Solution

by:
gbanik earned 500 total points
ID: 34183841
Have you considered writing a simple C wrapper around the C DLL? There may be now various ways to communicate with your VB6 code.
0
 

Author Closing Comment

by:dvplayltd
ID: 34192625
thanks.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

742 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