VCµÄDLLÈç¹ûͨ¹ý²ÎÊýÏòVB´«Êý¾Ý£¿ - VB / »ù´¡Àà
ÎÒÕâÑùдµÄ.
VC DLL²¿·Ö
size_t *Ep2ReadLen;
extern "C" int _stdcall TestDLL(size_t* iPort2ReadLen)
{
Ep2ReadLen = iPort2ReadLen;
*Ep2ReadLen = 5; //͉˕
if (Ep2ReadLen)
{
free(Ep2ReadLen);
//Ep2ReadLen=NULL;
}
return 0;
}
VB²¿·Ö
Declare Function TestDLL Lib "XXX.dll" (ByRef iPort2ReadLen As Integer) As Integer
Dim iPort2ReadLen As Integer
rt = TestDLL(iPort2ReadLen)
±àÒëͨ¹ý£¬ÔËÐÐVB³ÌÐò£¬µ÷Óã¬ÄÜÕýÈ··µ»Ø5¡£µ«ÊÇÔڹرÕVB³ÌÐòʱ,±¨´í¡£
µ«ÔÚÉÏÃæµÄ *Ep2ReadLen = 5; ×¢Ê͵ôºó£¬¾Í²»±¨´íÁË¡£ËµÃ÷ÊÇÕâÐе¼Öµġ£
ÎÒÔø¿¼ÂÇÊDz»ÊÇVCÖ¸ÕëûÓÐÊÍ·Å£¬ËùÒÔ¼ÓÉÏ free(Ep2ReadLen);
µ«½á¹ûÈÔȻһÑù¡£
Çë½Ì¸÷룬´íÔÚÄÄÀ
¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢
free(Ep2ReadLen);µÄÌí¼Ó²»ÊÇÎҵı¾Ò⣬×îÏÈÊÇûÓмÓÕâÐе쬵«×îÖչرÕVB³ÌÐò±¨´íºó£¬ÎÒÔö¼ÓÁËÕâÐУ¬½á¹ûÏàͬ¡£
ÎÒÔÒÔΪÊÇûÓÐÊÍ·ÅÖ¸Õ룬µ¼Öµı¨´í£¬µ«ÏÖÔÚ¿´ºÃÏñÓÖ²»ÊÇ :(
VBºÃÏñûÓÐÖ¸Õ룿
¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢¡¢
VBÖÐ
ÎÒÓÖÊÔÁËÒ»ÏÂ
²âÊÔÒ»£º
Dim iPort2ReadLen As Integer
Private Sub Command1_Click()
iPort2ReadLen = 34
rt = TestDLL(iPort2ReadLen)
MsgBox iPort2ReadLen
End Sub
iPort2ReadLen ×÷Ϊȫ¾Ö±äÁ¿£¬¹Ø±ÕVB´°Ìåʱ¡°±¨´í¡±¡£
²âÊÔ¶þ£º
Private Sub Command1_Click()
Dim iPort2ReadLen As Integer
 
Ïà¹ØÎÊ´ð£º
ÎÒÔÚÀàÖÐÓÐÒ»¸öº¯Êý
Public Function DownloadAdditionalSite(SiteName As siteconfig, Directory As String, ymd As String) As Boolean
siteconfigÊÇÎÒ×Ô¶¨ÒåÀàÐ͵ÄÊý¾Ý£¬ÎªÊ²Ã´»áÌáʾ¡°Ö»ÓÐÔÚ¹«¹²¶ÔÏóÄ£¿éÖж ......
ÏÖÔÚÓиöxmlÎļþÊÇ<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
¸÷λ¸ßÊÖ£¬Ð¡µÜ×î½üÅöµ½Ò»¸öÎÊÌ⣺ÔÏÈдµÄ³ÌÐò´ó¸ÅµÄ˼·ÊÇ£ºÊ×ÏÈwebbrowser´ò¿ªÍøÖ·£¬ÍøÖ·ÏÔʾºó£¬µã»÷ÍøÖ·ÉϵÄijһ¸öÁ¬½Ó£¬µ±webbrowser¼ì²âµ½ÍøÖ·ÒѾÁ¬½Óµ½ÏëÒªµÄµØÖ·Ê±ºò¾Í¿ªÊ¼ÏÂÔØÎļþ£¬µ±ÓÃIE6µÄʱºòÏÂÔ ......
ËÄܰïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
ͦ·±Ëö£¬Ö®Ç°·¢µÄÌû×Ó£¬·Öֵ̫µÍÏÖÔÚÖØ·¢Ò»¸ö¡£»¶Ó¸÷λ´óÏÀ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......