ÔÚVCÖлص÷º¯ÊýΪ£º
C/C++ code:
typedef VOID (__stdcall *DL_AUTOCALLBACK )( DWORD dw1, DWORD dw2, LPVOID lpContext );
int Set( IN HANDLE hCamera, IN BOOL bAE,
IN BYTE btTarget, IN DL_AUTOCALLBACK pfCallback, IN LPVOID lpContext );
VbÖÐÎÒÉùÃ÷Ϊ£º
VB code:
Public Declare Function Set _'ÉùÃ÷
Lib "XX.dll" (ByVal hCamera As Long, ByVal bAE As Boolean, ByVal btTarget As Byte, _
ByVal pfCallback As Long, ByVal lpContext As Long) As Integer
Public Function AECallback(ByVal dw1 As Long,ByVal dw2 As Long, ByRef lpContext As Long)'Ò»µ½Õâ¾Í»á³ö´í
Dim val As Integer
¡¡¡¡
AECallback = 0
End Function
Set m_hDevice, True, 180, AddressOf XX.AECallback, MainForm.hWnd'ÕâÊÇÎҵĵ÷ÓÃ
ÏÔʾÄÚ´æ²»ÄÜΪ¶Á£¡
²»ÖªµÀÕâÊǸöʲôÎÊÌ⣬ÊDzÎÊý¶ÔÓ¦µÄÎÊÌâÂð£¿
DWORD Ϊunsigned longÀàÐÍ
LPVOID Ϊvoid*
Ôõô»ØÊÂÄØ£¿ÓÐ˸ø¸ö´ð°¸£¡
×îºóÒ»¾ä¸ÄΪ£ºSet m_hDevice, True, 180, byval AddressOf XX.AECallback, MainForm.hWnd
ÊÔÒ»ÊÔ
ÄãÒª¸ø³öC++µÄÔÐÍ¡£
»¹ÓУ¬±ØÐëÔÚ±ê׼ģ¿éÀïÃæÐ´»Øµ÷µÄ´úÂë¡£
set Êǹؼü×Ö£¬»»Ò»¸öÃû×Ö¡£Ê¹Óà alieas ¹Ø¼ü×Ö¡£
Public Function AECallback(ByVal dw1 As Long,ByVal dw2 As Long, ByRef lpContext As Long) <
TF1.text = " <_2_ZCHGZBH> " & MSFlexGrid1.TextMatrix(k, 1) & " </_2_ZCHGZBH> "
´ó¼ÒºÃ£¬ÎÒÓÃÉÏÃæÒ»¸ö¶«Î÷¸³Öµ TF1.text = & ......
VBżѧµÃ²»´í£¬ÏÖÔÚ´óÒ»£¬¸ßÈýµÄʱºò¾ÍѧVBÁË£¬ÏÖÔÚѧУÀï¶¼ÊÇѧC#ºÍVB.NETµÄÐֵܶࡣ¡£¡£
żҪתÐÐVB.NETÁË~µ±ÄêѧVBѧÁË2Ä꣬¶ÔVBÀïÃæµÄ³£Óú¯Êý¶¼Ê®·ÖÁ˽⡣
Select¡¢If½á¹¹¡¢For NextÑ»·¡¢µÈ¶¼Á˽⡣¡£¡£ ......
±ÈÈç˵ҪÔÚ1±íÖеĵÚÈýÁеڶþÐе¥ÔªÖÐÊäÈë¡°Ò»¶þÈý¡±Ò»Òª´ÖÌåËÎÌå12ºÅ×Ö£¬¶þ ²»Òª´ÖÌå 15ºÅ×Ö ÈýбÌå5ºÅ×Ö
´úÂëÓ¦¸ÃÔõô´ò£¿
LZÖ¸µÄÊǸöʲô±í¸ñ¿Ø¼þÄØ£¬Ã²ËÆÖ»ÄÜÉèÖÃÕû¸ö±íµÄ×ÖÌ壬»òÕßij¼¸Ðлò¼¸ÁУ¬Ã»Óе¥¶ÀÉèÖ ......