VB 6.0 µ÷ÓÃdllµÄÎÊÌâ - .NET¼¼Êõ / VB.NET
ÎÒÔÚVC 6.0ÖÐдÁËÒ»¸öexample.dll£¬ÀïÃæÒ»¸öº¯Êý
extern "C" __declspec(dllexport)
HRESULT __stdcall Connect(LPCSTR IpAddr)
{
...
}
example.dllÖиú¯ÊýÃû³ÆÎª _Connect@4 £¨ÓÃdepends¹¤¾ß²é¿´£©
ÎÒÔÚVB 6.0Öе÷Óô˺¯Êý
Private Declare Function Connect Lib "example.dll" Alias "_Connect@4" (ByVal IpAddr As String) As Long
Dim result As Long
result = Connect("138.139.0.230")
If result <> 0 Then
MsgBox ("error_connect")
Else
MsgBox ("connect_ok")
End If
½á¹û·µ»Ø¶¼ÊÇ·Ç0£¬Á¬½Óʧ°Ü¡£
µ«ÎÒÓÃVC±àдµÄ´úÂëÒÔ¼°ÓÃVB.NET±àдͬÑù¹¦ÄܵĴúÂë¶¼¿ÉÒÔÁ¬½ÓÉÏ¡£
²»ÖªµÀÕâ¶ÎVB 6.0µÄ´úÂëÓÐʲô²»¶ÔµÄµØ·½¡£
£¨Ö»ÓÐ45·ÖÁË£¬È«É¢ÁË£©
VB.NETºÍVCµ÷ÓÃʱ£¬example.dllûÓмÓ__stdcall¡££¨ÒòΪVB 6.0ÐèÒªÊÇstdcall£©
¼´£º
extern "C" __declspec(dllexport)
HRESULT Connect(LPCSTR IpAddr)
{
...
}
VB.NET´úÂëÈçÏ£º
Imports System.Runtime.InteropServices
<DllImport("./example.dll", CallingConvention:=CallingConvention.Cdecl)> _
Public Function Connect(ByVal IpAddr As String) As Integer
End Function
Dim result As Integer
result = Connect("138.139.0.230") 'Á¬½Óµ¥°å
If result &
Ïà¹ØÎÊ´ð£º
ÎÒÔÚÀàÖÐÓÐÒ»¸öº¯Êý
Public Function DownloadAdditionalSite(SiteName As siteconfig, Directory As String, ymd As String) As Boolean
siteconfigÊÇÎÒ×Ô¶¨ÒåÀàÐ͵ÄÊý¾Ý£¬ÎªÊ²Ã´»áÌáʾ¡°Ö»ÓÐÔÚ¹«¹²¶ÔÏóÄ£¿éÖж ......
ΪʲôÎÒÓÃform.showºÍform.hide¶à´ÎÁ¬½ÓÁËÁ½¸ö´°¿ÚÖ»ÄÜ»¥»»Á´½ÓÁ½´Î°¡£¿
´úÂë¿´¿´
ÕÕµÀÀíform.show û´ÎÊýÏÞ¶¨µÄ°É
ÎÒÒ²¿ì·èÁË¡£
Â¥Ö÷ÖªµÀÔõô·¢Ìùô£¿
ÒýÓÃ
ÎÒÒ²¿ì·èÁË¡£
Â¥Ö÷ÖªµÀÔõô·¢Ìùô£¿
Â¥Ö÷Ò² ......
Êý¾Ý¿âÀïÓÐÒ»¸ö×ֶεÄÄÚÈÝÊǶþ½øÖÆ£¬Ôõô²ÅÄܰÑÕâ¸ö¶þ½øÖƶÁ³öÀ´
ʹÓÃ×Ö½ÚÁ÷¶ÔÏó¿ÉÒÔʵÏÖ
ÀýÈçÏÖÔÚÊý¾Ý¿âÀïÓиö×ֶεÄÄÚÈÝÊÇ0x504B03040A0000000800407F263C3B02465390000000820000000A0000006273CECACCE22E7478 ......
ËÄܰïÎÒ°ÑÏÂÃæÕâЩ´úÂë¸Ä³ÉVBÐÎʽµÄ£¬¶àлÁË£¬¼±ÓÃ~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
ÕÒÁ˺ܾÃÕâ¶«Î÷ÁË,
ÓÃtreeview²»ÄÜÂú×ãÒªÇó
ÏÖÔÚÏë×öµÄÊÇ£º½çÃæÒÔÊ÷ÐÎÕ¹ÏÖ£¬Äܲ»ÄÜÕ¹¿ªÊÕ»ØÎÞËùν
½Úµã¶¼¿ÉÒÔ°´Õչ涨½øÐÐÌíɾ
ÿ¸ö½ÚµãºóÃæ¶¼¿ÉÄÜ»á³öÏÖ Îı¾ ......