VCµ÷ÓÃVBµÄdll
Óо²Ì¬ºÍ¶¯Ì¬Á½ÖÖ£¬¾²Ì¬µÄÐèÒªlib¶ø¶¯Ì¬µÄÖ»ÐèÒªÒ»¸ödll¾Í¿ÉÒÔÁË£¨µ«ÊÇÒªÖªµÀº¯ÊýµÄ¶¨ÒåÒ»°ãÊÇÍ·ÎÄ
¼þ£©¶¯Ì¬Ïà¶Ô¸´ÔÓÒ»µã£¡µ«ÊÇÕÆÎÕÁËÒ²²»ÊǺÜÄÑ
//µÚÒ»²½ ¶¨Ò庯ÊýÖ¸Õë¾ÍÊÇÄãÒªµ÷Óõĺ¯Êý£¬²ÎÊý±ØÐëÒ»Ö£¬²»È»¾ÍÄÚ´æй¶
typedef HANDLE (PASCAL * OPEN)(char *,int);
//µÚ¶þ²½ ¶¨Òå±¾µØº¯Êý
//Ò»°ãÇ°Á½²½¶¼ÔÚÍ·ÎļþÀïÃæÉùÃ÷
OPEN open;
//µÚÈý²½ ¼ÓÔØdll
HMODULE m_hLib;
m_hLib ::LoadLibrary"E:\\yewufuwu\\TERMINALDLL\\Debug\\TerminalDLL.dll");
//ÊäÈëÏàÓ¦µÄ·¾¶
if(m_hLib == NULL )
{
MessageBox("¶¯Ì¬Á¬½Ó¿âûÓÐÕÒµ½!!!","LoadLibrary",MB_OK);
return ;
}
//µÚËIJ½
else
{
MessageBox("¶¯Ì¬Á¬½Ó¿â³É¹¦´ò¿ª...","LoadLibrary",MB_OK);
open=(OPEN)GetProcAddress(m_hLib, "OpenDevice");
}
//µÚÎå²½
long handle = open("EF",1)£»
¶¯Ì¬¿âϵĺ¯ÊýÈçÏÂ
//*************´ò¿ªÖÕ¶Ë*****************************************
HANDLE __declspec(dllexport) WINAPI
OpenDevice(char * szType,int nType)
{
hReader&
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://www.52arm.com/Article_Show.asp?ArticleID=186
×÷Õߣºweidian ---±¾Õ¾Ô´´ µã»÷Êý£º4721 ·¢±íʱ¼ä£º2008-5-7 ±à¼£ºsanzang
Winsock¿Ø¼þ½¨Á¢ÔÚTCP¡¢UDPÐÒéµÄ»ù´¡ÉÏ£¬Íê³ÉÓëÔ¶³Ì¼ÆËã»úµÄ ......
¿ªÊ¼Ê¹ÓÃvbµÄʱºòϲ»¶ÓÃÊÖ»³öÄǸö¿Ø¼þµÄλÖÃ.È»ºóÒ»¸öÒ»¸öµÄÍ϶¯,Ò»µãÒ»µãµÄÒƶ¯.Ö±µ½¸Ð¾õÂúÒâÁËΪֹ.Èç¹ûÊǿؼþ¶àÁËÕâ¸ö¾ÍºÜÂé·³ÁË
Ò»²»Ð¡ÐÄ¿ÉÄܻὫı¸ö¿Ø¼þÍϵ½Ò»±ßÈ¥
ËùÒÔ,ÎÒÃÇÔÚÒÔºóµÄ×÷Æ·ÖÐ
¾¡Á¿Ê¹ÓôúÂëÀ´¶¨Òå¿Ø¼þλÖÃ,,ÒªÁé»îµÄÕÆÎÕ×ø±êλÖÃ.,¿ÉÒÔʹÓÃ×Ô¶¨Òå×ø±ê.ʹÓÃÏñËØÀ´¸üºÃµÄÀ´·ÖÇøÏÔʾ¿Ø¼þ.
& ......
ѧÉúʱ´úרҵÊÇ»úе£¬µ«ÊDzμӹ¤×÷ºó£¬»úÔµÇɺϴÓÊÂÁËÓëÈí¼þÏà¹ØµÄ¹¤×÷£¬¾ÍÊǶԴóÐ͹¤³ÌÈí¼þÈí¼þ×öһЩ¶þ´Î¿ª·¢£¬ÊÕ»ñ¹ý¿ìÀÖ£¬ÊÕ»ñ¹ýÐÁËᣬÔÚÒ»´ÎÓÖÒ»´ÎµÄµÃÓëʧÖУ¬ÏëÕÒÒ»¸öµØ·½£¬ÕÒһЩÈË¿ÉÒÔÂýÂýÓëÖ®·ÖÏí£¬ÓëÖ®½»Á÷£¬²¢Æڵõ½°ïÖú»òÌṩ°ïÖú£¡Ò²ÐíÄãÊÇÎÞÒâ¼û·¹ý£¬Éõ»òƯ¹ý£¬µ«ÄãµÄעĿÊÇÎÒÇ°½øµÄ¶¯Á¦£¬ÓÐÐÒפ×ãÒ²»áÈÃÎÒ ......
ÎÄÕÂÀ´Ô´:vb´óÊÀ½ç ×÷ÕߣºÍõ¹úÈÙ
¡¸VB ûÓÐÌṩÕâÑùµÄ¹¦ÄÜ£¬ ±ØÐëºô½Ð Windows API¡¹£¬ µ±±ÊÕßÕâÑù»Ø´ð¶ÁÕßÖ®áᣬÓÐЩ¶ÁÕß»áÒªÇó±ÊÕß½éÉÜ Windows API ·½ÃæµÄÊé¼®£¬ ÓÈÆäÊÇÖÐÎÄÊ飬 µ«Êµ¼ÊÉÏ£¬Ä¿Ç°ÊÐÃæÉÏÖ»¿´µ½Ò»±¾ÔÎÄÊé(ZD Press ³ö°æµÄ Visual Basic 5.0 Programming Guide to Win32 API)£¬ ÖÐÎÄÊéÔòδ¼û¹ý£¬ Ϊʲ÷áÃ»Ó ......
Option Explicit
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias ......