I'm trying to create a window using OpenCV with VB6.
The original C++ code is this:
C: IplImage* cvCreateImage(CvSize size, int depth, int channels)
So in VB6 I declare the following function:
Private Declare Function cvCreateImage CDecl Lib "opencv_core220.dll" (ByRef uSize As CvSize, ByVal uDepth As Long, ByVal uChannels As Long) As Long
Private Type CvSize
width As Long
height As Long
End Type
And then I call like this:
Dim nSize As CvSize
nSize.width = 1024
nSize.height = 768
Dim l8 As Long
Dim l3 As Long
l8 = 8
l3 = 3
Dim lDisplayImage As Long
lDisplayImage = cvCreateImage(nSize, l8, l3)
Looks perfectly fine to me, but VB6 tells me:
Wrong DLL calling convention.
What am I doing wrong here?
Thank you!