0

I'm having an interesting problem regarding a machine vision camera, a dll, a host application, and CodeBlocks.

I have a dll that enumerates Matrix Vision cameras, and directs calls from a host application to whichever camera the host application is addressing.

I have a bluefox-IGC camera that I'll refer to as the SD camera and a BlueFox3-1100C camera that I'll refer to as the HD camera.

In the dll, the first thing to be done is to create a new DeviceManager (a Matrix-Vision class) and ask it how many devices are connected:

FDeviceManager =new DeviceManager;

// Check to see if any devices are currently connected.
Count =FDeviceManager->deviceCount();
if ( Count == 0)
{
    OutputDebugStr("WARNING: No cameras found by camera driver.");
    return CAM_FAILURE;
}

When I run the host application from Windows File Manager, both the SD and HD camera will be found. If only 1 SD camera is present, Count = 1. If only 1 HD camera is present, Count = 1. If one of each is present, Count = 2. No problems.

However, if I run the host application from the CodeBlocks IDE, no HD cameras are ever found. So, 1 SD Camera -> Count = 1. 1 HD Camera -> Count = 0. 1 SD + 1 HD -> Count = 1.

I'm not even sure what direction to look in here.

Since the IDE clearly runs the host application in the IDE's memory space, I could see this being a problem with CodeBlocks.

Has anyone seen any disparate behavior like this before?

Here are some quick stats:

  • OS is Windows 7 Pro 64-bit SP1
  • Host application is 32-bit, compiled with TDM-GCC-32
  • dll is 32-bit, compiled with TDM-GCC-32

If any more information is needed, just ask.

Mike Gibson
  • 342
  • 1
  • 3
  • 14
  • Quick secondary question: Does anyone think there is even a remote chance that the issue could somehow be caused by memory corruption in the host application? I don't believe there is any memory corruption in the host application, and I'm not sure it would even be possible for memory corruption in the host application to affect the memory for the dll (or at least it would seem the chances would be fairly astronomical) – Mike Gibson Aug 09 '17 at 22:28
  • Can it be that you have two .dll files, similar but not the same, in different dirs? – Ripi2 Aug 09 '17 at 22:41
  • It is not the case. But even if it were, I wouldn't expect the host application to choose one location when ran from Windows File Manager, and then the host application to choose a different location when ran from the IDE... right? – Mike Gibson Aug 09 '17 at 22:46
  • Well, it can be if the .dll lives in the same directory as the .exe and C::B has another dir (perhaps due to a different project in the same workspace). – Ripi2 Aug 09 '17 at 22:48
  • Not at issue here, but noted for the future. – Mike Gibson Aug 09 '17 at 22:55
  • What about using the debugger to see how the dll is called and used? – Ripi2 Aug 09 '17 at 22:59

0 Answers0