ΪʲôCдDLLÎļþC¡¢PBÄܵ÷ÓÃVB²»Äܵ÷ÓÃ
ΪʲôCдµÄDLLÎļþC¡¢PBÄܵ÷ÓÃVB²»Äܵ÷Óã¿
VBÀïΪʲôÓеÄDLLÖ±½Óͨ¹ýÒýÓÿÉÒÔʹÓã¿ÓеÄÐèҪͨ¹ýdeclareÉêÃ÷Íⲿº¯Êý£¿ÕâЩDLLÓÐʲô²î±ð£¿
1¡¢ÎªÊ²Ã´PBÄÜͨ¹ýDECLAREÉùÃ÷¶øVB²»ÐУ¿
2¡¢Èç¹ûÕâ¸ödllÖеĺ¯ÊýÓÐÒýÓõ½±ðµÄdllÖеĺ¯Êý£¬ÊDz»ÊDZ»ÒýÓõĺ¯ÊýҲҪͨ¹ýdeclareÉùÃ÷ÆäÖб»ÒýÓõĺ¯Êý£¬²ÅÄÜʹÓÃ
¸Ðл2λ»Ø´ð£º»¹ÓÐһЩ¸ÅÄîºÜÄ£ºý
1¡¢Ê¹ÓÃdeclareºÍregsvr32×¢²ádllÓÐûÓÐʲô¹Øϵ£¿
dll²»¾¹ýregsvr32ÃüÁî×¢²áÄÜ·ñͨ¹ýdeclareÉùÃ÷ÆäÖеĺ¯Êý£¿
2¡¢regsvr32×¢²áÃüÁΪʲôע²áºódll\ocx¾ÍÄܱ»Ó¦Óᢸ½¼þ£¬regsvr32×¢²áʱϵͳ·¢ÉúÁËʲô±ä»¯£¿»¹ÓÐ×¢²á±íÀïCLSID¡¢createobjectº¯Êý´´½¨¶ÔÏó¡¢getobject»ñÈ¡¶ÔÏóÓÐʲô¹Øϵ
Ó²µÀÀí
ʧÃßÁË£¬Ã»ÓÐʲôµÀÀí~~~~~~~~~~~``
Á½ÖÖ²»Í¬µÄ dll ÀàÐÍ£º
COM dll µÄ½Ó¿Ú¶¨ÒåÔÚ TypeLib Info ÖУ¬±ØÐëͨ¹ý regsvr32 ½«¸ÃÐÅϢдÔÚ×¢²á±íÖУ¬È»ºó VB ²ÅÄÜͨ¹ýÒýÓþÍÄÜʹÓ᣸à dll µÄ·¾¶¼Ç¼ÔÚ×¢²á±íÖУ¬Ïàͬ dll µÄ¸±±¾Ö»ÒªÒ»¸öÊÇʵ¼Ê¿ÉÓõġ£
±ê×¼ dll µÄº¯ÊýÈë¿ÚÖ±½Ó¶¨ÒåÔÚ dll ÖУ¬±ØÐëÒªÓà Declare ÉùÃ÷¾ßÌåµÄº¯Êý¸ñʽ²ÅÄÜÕýÈ·µ÷Ó᣸à dll µÄλÖÃͨ¹ýËÑË÷·¾¶²éÕÒ£¬Èç¹ûʹÓÃÏà¶ÔĿ¼£¬Ïàͬ dll µÄ¸±±¾¿ÉÒԷֱ𱻲»Í¬µÄ exe ½øÐе÷Óá£
vbÊDz»ÊÇÖ»ÄÜдactivex dll£¨COM DLL£©£¿Äܲ»ÄÜд±ê×¼DLL? Äܲ»ÄÜÐ޸ĵ÷ÓÃÔ¼¶¨£¿ÔõôÐ޸ģ¿
¡°¸Ã dll µÄ·¾¶¼Ç¼ÔÚ×¢²á±íÖУ¬Ïàͬ dll µÄ¸±±¾Ö»ÒªÒ»¸öÊÇʵ¼Ê¿ÉÓõġ£¡±
ÊDz»ÊÇ¡°Ö»ÓÐÒ»¸öÊÇʵ¼Ê¿ÉÓõġ±
ÎÒÊÕ²ØÁËÒ»¸öÀà,¿Éµ÷ÓÃCDeclÓëStdCallµÄº¯Êý.
ÒÔÏ´úÂë´æΪcCallAPI.cls:
VB code
Code highlighting produced by Act
Ïà¹ØÎÊ´ð£º
ÒÔÇ°ÔÚVCÀïÃ潨һ¸ö¹¤³Ì£¬¶¼Ö»ÓÃÒ»¸ö .c Îļþ£¬×òÌìÔÚÒ»¸ö¹¤³ÌÀïÓÃÁËÁ½¸ö .cÎļþÁË£¬Óöµ½ÎÊÌâÁË£¬Çë´ó¼ÒÖ¸µã¡£±ÈÈ磺
File1.c Fil ......
±ÈÈçÊý×éarray[100]="12@good@thanks@men@";
Ôõô×ö²ÅÄܽ«array1[100]="12";array2[100]="good";array3[100]="thanks";array4="men";
ÐèÒªÔõô×öÄØ?CÀ ......
±àдһ¸ö³ÌÐòÓÃÁ´±íʵÏÖ£º½«Ò»¸öÉýÐòÕûÊýÊýÁеÄÖظ´Êý¾ÝÈ¥µô
±àºÃºó£¬½á¹û²»¶Ô°¡£¬ÇóÖúc¸ßÊÖ
#include <stdio.h>
#include <stdlib.h>
struct link
{
int number;
s ......
CÅÌ9G£¬ËãÁËһϸ÷ÖÖÎļþ°üÀ¨ÒþÐÎ×ܹ²²»µ½2G£¬¿ÉÊÇϵͳÏÔʾֻʣÓà1¸ö¶àG£¬ÎÒÒѾ½«¸÷ÖÖÁÙʱÎļþ¶¼É¾³ýÁË£¬°üÀ¨´ÅÅÌÇåÀí£¬Ôõô»ØÊ£¿Ð»Ð»»Ø´ð
ʲôϵͳ£¿
ÐéÄâÄÚ´æÉèÖõ½ÆäËüÅÌ£»
¹Ø±Õϵͳ»¹Ô£»
ɾ³ýÐ ......
int a=2;
int i;
i=(a++)+(++a)+(a++)+(++a)+(a++);
printf("%d",i);
½á¹ûÊÇ20£¬Çë½â¶Á
ÕâÒѾ²»ÊÇÔ¾ÌùÁË£¬Ëͳ¼Æ¹ý½ñÌ ......