G
gxz000
Unregistered / Unconfirmed
GUEST, unregistred user!
本人有一个问题就是用DELPHI调用一个C写的一个DLL.可是按文档上写的声明好方法后总出现,没有定义函数入口这个错.
我是这样声明的
function SGIP_Connect(ipchar;port:short;usernamechar;passwordchar):integer;cdecl external 'dll/sgipapi.dll';
声明不出错.只是在调用这个方法时就出错.
请问这位问题出在什么时候地方如何来解决
那个C的源码如下:本人对C不了解.不知道下面的源码是否能生成这个sgipapi.dll
/*
*Header File of the TSSX SGIP API
*
*Created By DingLi 2001-07-01
*
*/
#ifndef TSSX_SGIP_H
#define TSSX_SGIP_H
#define ERROR_OK 0
#define ERROR_SOCKET_CREATE -100
#define ERROR_CONNECT -101
#define ERROR_SOCKET_WRITE -102
#define ERROR_SOCKET_READ -103
#define ERROR_ICP_ID -104
#define ERROR_AUTH -105
#define ERROR_MSG_LEN -106
#define ERROR_FEE_CODE -107
#define ERROR_SERVICE_ID -108
#define ERROR_FLOW_CONTROL -109
#define ERROR_SOCKET_CLOSE -110
#define ERROR_CMD -111
#define ERROR_INTERNAL -200
#define ERROR_UNKNOWN -201
#define ERROR_ARGUMENT -202
#ifndef SGIPAPI_API
#define SGIPAPI_API
#endif
SGIPAPI_API void set_src_node(int num); //ÉèÖÃÔ´½ÚµãºÅ
SGIPAPI_API int SGIP_Connect(char *gw_ip,short port,char *username,char *passwd);
SGIPAPI_API int SGIP_Submit(int conn_id, //the return value by SGIP_Connect
char *sp_dial_num, //SP½ÓÈëºÅ
char *ICPID, //ÆóÒµ´úÂë
char *service_id, //ÒµÎñ´úÂë
char fee_type, //01=Ãâ·Ñ 02=°´Ìõ 03=°üÔ 04=·â¶¥ 05=SPÊÕ·Ñ
char *fee_value, //×Ê·Ñ´úÂ룬ÒÔ·ÖΪµ¥Î»
char *give_value, //ÔùËÍ·ÑÓôúÂ룬ÒÔ·ÖΪµ¥Î»
char agent_flag, //´úÊշѱêÖ¾£¬0£ºÓ¦ÊÕ£»1£ºÊµÊÕ
char mt_flag, //ÒýÆðMTÏûÏ¢µÄÔ­Òò
// 0-MOµã²¥ÒýÆðµÄµÚÒ»ÌõMTÏûÏ¢£»
// 1-MOµã²¥ÒýÆðµÄ·ÇµÚÒ»ÌõMTÏûÏ¢£»
// 2-·ÇMOµã²¥ÒýÆðµÄMTÏûÏ¢¡£
unsigned char priority, //ÓÅÏȼ¶0-9´ÓµÍµ½¸ß
char *valid_time, //´æ»îʱ¼ä£¬¸ñʽΪYYYYMMDDHHMISS
char *at_time, //´æ»îʱ¼ä£¬¸ñʽΪYYYYMMDDHHMISS
unsigned char report_flag, //״̬±¨¸æ±ê¼Ç
// 0-¸ÃÌõÏûÏ¢Ö»ÓÐ×îºó³ö´íʱҪ·µ»Ø״̬±¨¸æ
// 1-¸ÃÌõÏûÏ¢ÎÞÂÛ×îºóÊÇ·ñ³É¹¦¶¼Òª·µ»Ø״̬±¨¸æ
// 2-¸ÃÌõÏûÏ¢²»ÐèÒª·µ»Ø״̬±¨¸æ
unsigned char tp_pid, //Ò»°ãÌî0 ¾ßÌåÖµ²Î¼ûGSM03.40
unsigned char tp_udhi, //Ò»°ãÌî0 ¾ßÌåÖµ²Î¼ûGSM03.40
unsigned char msg_type, //ÏûÏ¢ÀàÐÍ
unsigned char msg_format, //ÏûÏ¢¸ñʽ 0=ASCII 4=bin 8=UCS2 15=GB
char *charge_mobile, //¸¶·ÑºÅÂ룬Èç¹ûΪ¿Õ£¬Ôò¸ÃÌõ¶ÌÏûÏ¢²úÉúµÄ·ÑÓÃÓÉUserNumber´ú±íµÄÓû§Ö§¸¶
unsigned char user_num, //&frac12;&Oacute;&Ecirc;&Otilde;&Ecirc;&Ouml;&raquo;ú&cedil;&ouml;&Ecirc;&yacute; <100
char *dest_mobiles, //&frac12;&Oacute;&Ecirc;&Otilde;&Ecirc;&Ouml;&raquo;ú&ordm;&Aring;&Acirc;&euml;&pound;&not;&Ograve;&Ocirc;&iquest;&Otilde;&cedil;&ntilde;·&Ouml;&cedil;&ocirc;
char *msg, //&Iuml;&ucirc;&Iuml;&cent;&Auml;&Uacute;&Egrave;&Yacute;
unsigned long msg_len, //&Iuml;&ucirc;&Iuml;&cent;&sup3;¤&para;&Egrave;
unsigned long *p_seq1, //·&micro;&raquo;&Oslash;&Eacute;ú&sup3;&Eacute;&micro;&Auml;&ETH;ò&Aacute;&ETH;&ordm;&Aring;1-3&pound;&not;&iquest;&Eacute;&Ograve;&Ocirc;&acute;&laquo;&micro;&Yacute;NULL
unsigned long *p_seq2,
unsigned long *p_seq3
);
SGIPAPI_API int SGIP_Disconnect(int conn_id);
struct MO_msg{
char sourceUser[21]; //·&cent;&Euml;&Iacute;&Iuml;&ucirc;&Iuml;&cent;&micro;&Auml;&Ecirc;&Ouml;&raquo;ú
char SPNumber[21]; //SP&frac12;&Oacute;&Egrave;&euml;&ordm;&Aring;
unsigned char tp_pid;
unsigned char tp_udhi;
unsigned char msgFormat; //&Iuml;&ucirc;&Iuml;&cent;&cedil;&ntilde;&Ecirc;&frac12;
unsigned long msgLen; //&Iuml;&ucirc;&Iuml;&cent;&sup3;¤&para;&Egrave;
char msg[160]; //&Iuml;&ucirc;&Iuml;&cent;&Auml;&Uacute;&Egrave;&Yacute;
};
struct MO_report{
unsigned long seq1; //&Iuml;à&Oacute;&brvbar;&micro;&Auml;submit&ETH;ò&Aacute;&ETH;&ordm;&Aring;1-3
unsigned long seq2;
unsigned long seq3;
unsigned char report_type;
char mobile[21]; //&Auml;&iquest;&micro;&Auml;&Ecirc;&Ouml;&raquo;ú&ordm;&Aring;
unsigned char state; //×&acute;&Igrave;&not; 0&pound;&ordm;·&cent;&Euml;&Iacute;&sup3;&Eacute;&sup1;&brvbar; 1&pound;&ordm;&micro;&Egrave;&acute;&yacute;·&cent;&Euml;&Iacute; 2&pound;&ordm;·&cent;&Euml;&Iacute;&Ecirc;§°&Uuml;
unsigned char errCode; //&acute;í&Icirc;ó&acute;ú&Acirc;&euml;
};
#define MO_MSG 1
#define MO_REPORT 2
SGIPAPI_API int SGIP_Get_MO(int conn_id,void **pp_MO);
//SGIPAPI_API void Set_Timeout(int timeout);
#endif
我是这样声明的
function SGIP_Connect(ipchar;port:short;usernamechar;passwordchar):integer;cdecl external 'dll/sgipapi.dll';
声明不出错.只是在调用这个方法时就出错.
请问这位问题出在什么时候地方如何来解决
那个C的源码如下:本人对C不了解.不知道下面的源码是否能生成这个sgipapi.dll
/*
*Header File of the TSSX SGIP API
*
*Created By DingLi 2001-07-01
*
*/
#ifndef TSSX_SGIP_H
#define TSSX_SGIP_H
#define ERROR_OK 0
#define ERROR_SOCKET_CREATE -100
#define ERROR_CONNECT -101
#define ERROR_SOCKET_WRITE -102
#define ERROR_SOCKET_READ -103
#define ERROR_ICP_ID -104
#define ERROR_AUTH -105
#define ERROR_MSG_LEN -106
#define ERROR_FEE_CODE -107
#define ERROR_SERVICE_ID -108
#define ERROR_FLOW_CONTROL -109
#define ERROR_SOCKET_CLOSE -110
#define ERROR_CMD -111
#define ERROR_INTERNAL -200
#define ERROR_UNKNOWN -201
#define ERROR_ARGUMENT -202
#ifndef SGIPAPI_API
#define SGIPAPI_API
#endif
SGIPAPI_API void set_src_node(int num); //&Eacute;è&Ouml;&Atilde;&Ocirc;&acute;&frac12;&Uacute;&micro;&atilde;&ordm;&Aring;
SGIPAPI_API int SGIP_Connect(char *gw_ip,short port,char *username,char *passwd);
SGIPAPI_API int SGIP_Submit(int conn_id, //the return value by SGIP_Connect
char *sp_dial_num, //SP&frac12;&Oacute;&Egrave;&euml;&ordm;&Aring;
char *ICPID, //&AElig;ó&Ograve;&micro;&acute;ú&Acirc;&euml;
char *service_id, //&Ograve;&micro;&Icirc;&ntilde;&acute;ú&Acirc;&euml;
char fee_type, //01=&Atilde;&acirc;·&Ntilde; 02=°&acute;&Igrave;&otilde; 03=°ü&Ocirc;&Acirc; 04=·&acirc;&para;&yen; 05=SP&Ecirc;&Otilde;·&Ntilde;
char *fee_value, //×&Ecirc;·&Ntilde;&acute;ú&Acirc;&euml;&pound;&not;&Ograve;&Ocirc;·&Ouml;&Icirc;&ordf;&micro;&yen;&Icirc;&raquo;
char *give_value, //&Ocirc;ù&Euml;&Iacute;·&Ntilde;&Oacute;&Atilde;&acute;ú&Acirc;&euml;&pound;&not;&Ograve;&Ocirc;·&Ouml;&Icirc;&ordf;&micro;&yen;&Icirc;&raquo;
char agent_flag, //&acute;ú&Ecirc;&Otilde;·&Ntilde;±ê&Ouml;&frac34;&pound;&not;0&pound;&ordm;&Oacute;&brvbar;&Ecirc;&Otilde;&pound;&raquo;1&pound;&ordm;&Ecirc;&micro;&Ecirc;&Otilde;
char mt_flag, //&Ograve;&yacute;&AElig;&eth;MT&Iuml;&ucirc;&Iuml;&cent;&micro;&Auml;&Ocirc;&shy;&Ograve;ò
// 0-MO&micro;&atilde;&sup2;&yen;&Ograve;&yacute;&AElig;&eth;&micro;&Auml;&micro;&Uacute;&Ograve;&raquo;&Igrave;&otilde;MT&Iuml;&ucirc;&Iuml;&cent;&pound;&raquo;
// 1-MO&micro;&atilde;&sup2;&yen;&Ograve;&yacute;&AElig;&eth;&micro;&Auml;·&Ccedil;&micro;&Uacute;&Ograve;&raquo;&Igrave;&otilde;MT&Iuml;&ucirc;&Iuml;&cent;&pound;&raquo;
// 2-·&Ccedil;MO&micro;&atilde;&sup2;&yen;&Ograve;&yacute;&AElig;&eth;&micro;&Auml;MT&Iuml;&ucirc;&Iuml;&cent;&iexcl;&pound;
unsigned char priority, //&Oacute;&Aring;&Iuml;&Egrave;&frac14;&para;0-9&acute;&Oacute;&micro;&Iacute;&micro;&frac12;&cedil;&szlig;
char *valid_time, //&acute;&aelig;&raquo;&icirc;&Ecirc;±&frac14;&auml;&pound;&not;&cedil;&ntilde;&Ecirc;&frac12;&Icirc;&ordf;YYYYMMDDHHMISS
char *at_time, //&acute;&aelig;&raquo;&icirc;&Ecirc;±&frac14;&auml;&pound;&not;&cedil;&ntilde;&Ecirc;&frac12;&Icirc;&ordf;YYYYMMDDHHMISS
unsigned char report_flag, //×&acute;&Igrave;&not;±¨&cedil;&aelig;±ê&frac14;&Ccedil;
// 0-&cedil;&Atilde;&Igrave;&otilde;&Iuml;&ucirc;&Iuml;&cent;&Ouml;&raquo;&Oacute;&ETH;×&icirc;&ordm;ó&sup3;&ouml;&acute;í&Ecirc;±&Ograve;&ordf;·&micro;&raquo;&Oslash;×&acute;&Igrave;&not;±¨&cedil;&aelig;
// 1-&cedil;&Atilde;&Igrave;&otilde;&Iuml;&ucirc;&Iuml;&cent;&Icirc;&THORN;&Acirc;&Ucirc;×&icirc;&ordm;ó&Ecirc;&Ccedil;·&ntilde;&sup3;&Eacute;&sup1;&brvbar;&para;&frac14;&Ograve;&ordf;·&micro;&raquo;&Oslash;×&acute;&Igrave;&not;±¨&cedil;&aelig;
// 2-&cedil;&Atilde;&Igrave;&otilde;&Iuml;&ucirc;&Iuml;&cent;&sup2;&raquo;&ETH;è&Ograve;&ordf;·&micro;&raquo;&Oslash;×&acute;&Igrave;&not;±¨&cedil;&aelig;
unsigned char tp_pid, //&Ograve;&raquo;°&atilde;&Igrave;&icirc;0 &frac34;&szlig;&Igrave;&aring;&Ouml;&micro;&sup2;&Icirc;&frac14;&ucirc;GSM03.40
unsigned char tp_udhi, //&Ograve;&raquo;°&atilde;&Igrave;&icirc;0 &frac34;&szlig;&Igrave;&aring;&Ouml;&micro;&sup2;&Icirc;&frac14;&ucirc;GSM03.40
unsigned char msg_type, //&Iuml;&ucirc;&Iuml;&cent;&Agrave;à&ETH;&Iacute;
unsigned char msg_format, //&Iuml;&ucirc;&Iuml;&cent;&cedil;&ntilde;&Ecirc;&frac12; 0=ASCII 4=bin 8=UCS2 15=GB
char *charge_mobile, //&cedil;&para;·&Ntilde;&ordm;&Aring;&Acirc;&euml;&pound;&not;&Egrave;&ccedil;&sup1;&ucirc;&Icirc;&ordf;&iquest;&Otilde;&pound;&not;&Ocirc;ò&cedil;&Atilde;&Igrave;&otilde;&para;&Igrave;&Iuml;&ucirc;&Iuml;&cent;&sup2;ú&Eacute;ú&micro;&Auml;·&Ntilde;&Oacute;&Atilde;&Oacute;&Eacute;UserNumber&acute;ú±í&micro;&Auml;&Oacute;&Atilde;&raquo;§&Ouml;§&cedil;&para;
unsigned char user_num, //&frac12;&Oacute;&Ecirc;&Otilde;&Ecirc;&Ouml;&raquo;ú&cedil;&ouml;&Ecirc;&yacute; <100
char *dest_mobiles, //&frac12;&Oacute;&Ecirc;&Otilde;&Ecirc;&Ouml;&raquo;ú&ordm;&Aring;&Acirc;&euml;&pound;&not;&Ograve;&Ocirc;&iquest;&Otilde;&cedil;&ntilde;·&Ouml;&cedil;&ocirc;
char *msg, //&Iuml;&ucirc;&Iuml;&cent;&Auml;&Uacute;&Egrave;&Yacute;
unsigned long msg_len, //&Iuml;&ucirc;&Iuml;&cent;&sup3;¤&para;&Egrave;
unsigned long *p_seq1, //·&micro;&raquo;&Oslash;&Eacute;ú&sup3;&Eacute;&micro;&Auml;&ETH;ò&Aacute;&ETH;&ordm;&Aring;1-3&pound;&not;&iquest;&Eacute;&Ograve;&Ocirc;&acute;&laquo;&micro;&Yacute;NULL
unsigned long *p_seq2,
unsigned long *p_seq3
);
SGIPAPI_API int SGIP_Disconnect(int conn_id);
struct MO_msg{
char sourceUser[21]; //·&cent;&Euml;&Iacute;&Iuml;&ucirc;&Iuml;&cent;&micro;&Auml;&Ecirc;&Ouml;&raquo;ú
char SPNumber[21]; //SP&frac12;&Oacute;&Egrave;&euml;&ordm;&Aring;
unsigned char tp_pid;
unsigned char tp_udhi;
unsigned char msgFormat; //&Iuml;&ucirc;&Iuml;&cent;&cedil;&ntilde;&Ecirc;&frac12;
unsigned long msgLen; //&Iuml;&ucirc;&Iuml;&cent;&sup3;¤&para;&Egrave;
char msg[160]; //&Iuml;&ucirc;&Iuml;&cent;&Auml;&Uacute;&Egrave;&Yacute;
};
struct MO_report{
unsigned long seq1; //&Iuml;à&Oacute;&brvbar;&micro;&Auml;submit&ETH;ò&Aacute;&ETH;&ordm;&Aring;1-3
unsigned long seq2;
unsigned long seq3;
unsigned char report_type;
char mobile[21]; //&Auml;&iquest;&micro;&Auml;&Ecirc;&Ouml;&raquo;ú&ordm;&Aring;
unsigned char state; //×&acute;&Igrave;&not; 0&pound;&ordm;·&cent;&Euml;&Iacute;&sup3;&Eacute;&sup1;&brvbar; 1&pound;&ordm;&micro;&Egrave;&acute;&yacute;·&cent;&Euml;&Iacute; 2&pound;&ordm;·&cent;&Euml;&Iacute;&Ecirc;§°&Uuml;
unsigned char errCode; //&acute;í&Icirc;ó&acute;ú&Acirc;&euml;
};
#define MO_MSG 1
#define MO_REPORT 2
SGIPAPI_API int SGIP_Get_MO(int conn_id,void **pp_MO);
//SGIPAPI_API void Set_Timeout(int timeout);
#endif