Unmanaged DLL Does not load with OpenCV and C#
I am getting this strange problem: 

"...(): Exception: Unable to load DLL 'SLTLIB.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

My DLL touble causing function in DLL:

extern "C" SLTLIB_API enum SLT_RETURN_CODES  __cdecl foo_cv ( 
	int ImageWidth, 
	int ImageHeight, 
	int ImageDepth, 
	unsigned char *p_frame,
	int *camera_decision_score_100)
{
	SLT_RETURN_CODES RetCode;

	RetCode = RC_OK;

	int CameraNum = 1;

	cv::Mat A;
	const char* imagename = "LenaRGB_640x480.jpg";

	// The following line causes the unmanaged DLL to not be loaded by C# program.
	//  Also, this functi"on is not even called!  The error message says other functions
	//  cannot be located!  When the following line is commented out, the DLL loads
	//  fine.  How is the call to OpenCV causing the trouble??  This is the only call
	//  to OpenCV in the DLL.

	A = cv::imread(imagename);

	return (RC_OK);
};

If I comment out "A = cv::imread(imagename);", the DLL loads and executed OK!!
I am not calling this function either - I am, however, calling many other functions.
The error message says some of these functions are missing.  I moved foo() (trouble maker)
to the bottom of the DLL source - no improvement.

I am stuck trying to get OpenCV running in my DLL - I would appreciate any help.

Thanks,
Art



Unmanaged DLL Does not load with OpenCV and C#
===

I am getting this strange problem: 

"...(): Exception: Unable to load DLL 'SLTLIB.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

My DLL touble causing function in DLL:

extern "C" SLTLIB_API enum SLT_RETURN_CODES  __cdecl foo_cv ( 
	int ImageWidth, 
	int ImageHeight, 
	int ImageDepth, 
	unsigned char *p_frame,
	int *camera_decision_score_100)
{
	SLT_RETURN_CODES RetCode;

	RetCode = RC_OK;

	int CameraNum = 1;

	cv::Mat A;
	const char* imagename = "LenaRGB_640x480.jpg";

	// The following line causes the unmanaged DLL to not be loaded by C# program.
	//  Also, this functi"on is not even called!  The error message says other functions
	//  cannot be located!  When the following line is commented out, the DLL loads
	//  fine.  How is the call to OpenCV causing the trouble??  This is the only call
	//  to OpenCV in the DLL.

	A = cv::imread(imagename);

	return (RC_OK);
};

If I comment out "A = cv::imread(imagename);", the DLL loads and executed OK!!
I am not calling this function either - I am, however, calling many other functions.
The error message says some of these functions are missing.  I moved foo() (trouble maker)
to the bottom of the DLL source - no improvement.

I am stuck trying to get OpenCV running in my DLL - I would appreciate any help.

Thanks,
Art


