Click here to Skip to main content
12,952,277 members (66,181 online)
Rate this:
 
Please Sign up or sign in to vote.
I have a MyDLL.dll which has followings
unsigned long  StartCapture (int nFGHandle, unsigned int nChannel, enum eCaptureModeIDs eCaptureMode, CBOnImage_VC *fpOnImage, void *pClientData) //  : Starts asynchronous capturing of images 
typedef void  CBOnImage_VC (int nFGHandle, unsigned int nChannel, DRM_VC_BYTE *pImage, void *pClientData)//Callback Function: Occurs if new an image is captured.  
/*!	\enum eCaptureModeIDs
		\brief Capture modes that support by video capture
*/
typedef enum eCaptureModeIDs
{
	 LIVE_IMAGE					//! < Live image capturing
	,PLAIN_FINGER				//! < Plain finger detection
	
} eCaptureModeIDs;


I am calling StartCapture method in c#
  namespace FingerPrintProject
{ 
       
class CIVC3Imp
    {
public enum eCaptureModeIDs
        {
            LIVE_IMAGE,					//! < Live image capturing
            PLAIN_FINGER				//! < Plain finger 
        };
 public delegate ulong StartCapture_Delegate(int nFGHandle, uint nChannel, eCaptureModeIDs eCaptureMode,CBOnImage_VC fpOnImage, IntPtr pClientData);
        public delegate void CBOnImage_VC_Delegate(int nFGHandle, uint nChannel, ref byte pImage, IntPtr pClientData);//Callback Function: Occurs if new an image is captured.
 
        [DllImport("DermalogVC3.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "CBOnImage_VC")]
        public static extern void CBOnImage_VC(int nFGHandle, uint nChannelNo, ref byte pImage, IntPtr pClientData);
        [DllImport("DermalogVC3.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "StartCapture")]
        public static extern ulong StartCapture(int nFGHandle, uint nChannel, eCaptureModeIDs eCaptureMode, CBOnImage_VC_Delegate fpOnImage IntPtr pClientData);//Starts asynchronous capturing of images  
 
}
  class VC3Interface
    {
IntPtr pClientData;
uint nChannelNo = 1;
 int nHandle = 0, nType;
CIVC3Imp.CBOnImage_VC_Delegate imagedelegate = new CIVC3Imp.CBOnImage_VC_Delegate(CIVC3Imp.CBOnImage_VC);
  CIVC3Imp.StartCapture_Delegate startcap = new CIVC3Imp.StartCapture_Delegate(CIVC3Imp.StartCapture);
ulong   nErrNo = startcap(nHandle, nChannelNo, CIVC3Imp.eCaptureModeIDs.PLAIN_FINGER, imagedelegate(nHandle, nChannelNo, ref pImage, pClientData), cbondetectdelegate(nHandle, nChannelNo, nType, ref pImage, pClientData), cbonerrordelegate(nHandle, nChannelNo, ref szErrMsg, pClientData), cbonwarnningdelegate(nHandle, nChannelNo, ref szWarningMsg, pClientData), pClientData);
}
}

When I run the program it gives following error
Delegate CIVC3Imp.StartCapture_Delegate' has some invalid arguments
Argument '4': cannot convert from 'void' to 'CIVC3Imp.CBOnImage_VC_Delegate'
how to solve it?
Posted 27-Aug-12 20:44pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,239
CHill60 3,490
Maciej Los 3,083
Jochen Arndt 1,975
ppolymorphe 1,880


Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 28 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100