Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VS2008 C# WPF VC++
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
0 Sergey Alexandrovich Kryukov 231
1 OriginalGriff 223
2 nv3 50
3 VJ Reddy 45
4 Mehdi Gholam 45
0 Sergey Alexandrovich Kryukov 6,696
1 OriginalGriff 6,149
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 28 Aug 2012
Copyright © CodeProject, 1999-2014
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