?
Solved

Manage VB6 callback problem with external C DLL

Posted on 2010-11-20
2
Medium Priority
?
562 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 1500 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Suggested Courses

801 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