在c語言中每一個變量都有兩個屬性一個是值,一個是址。比如inta=2;變量a的值是2,變量a的地址,可以用取地址
成都創(chuàng)新互聯-云計算及IDC服務提供商,涵蓋公有云、IDC機房租用、內蒙古服務器托管、等保安全、私有云建設等企業(yè)級互聯網基礎服務,服務電話:18982081108
操作符
獲取,即a。因此以C語言的函數傳遞中具備兩種方式傳遞參數,一種是傳址,一種傳值。比如voidf1(intv){;}//函數f1v
如你所說:
.net中包括 vb.net java.net c#.net等.
.net是一個大的平臺 它集成了很多中語言就如上面所說的.
你可以選擇各種不同的語言來進行開發(fā),個子遵循自己的語言風格.
Asp.net不屬于咱們剛才說的那種語言環(huán)境當中,它不是個語言.而是一種模式.
ASP.net代表的就是 B/S開發(fā),這個你明白吧?B/S就是 瀏覽器/服務器的模式.也就是咱們常說的網站開發(fā).
C語言是一門單純的語言,C語言是一個母語.就像VB的母語是PasCal一樣.
.net中以c語言為母語的語言就是C#.net和Java.net兩種.
.net可以用來開發(fā)網頁和軟件應用程序.
而C語言只能來寫一些操作計算機底層的代碼.
這樣說可以嘛.
如果DLL不是你寫的,且你要調用的函數不是__stdcall聲明,VB直接調用是會報錯的
如果DLL是你寫的,注意調用約定問題,并看以下代碼
***************************************************
以下是DLL代碼
.cpp里這么寫
extern?"C"__declspec(dllexport)?void?__stdcall?HelloWorld()
{
MessageBox(NULL,"HelloWorld","HelloWorld",NULL);
}
.def里這么寫
LIBRARY????? "XXXX"
EXPORTS
;?此處以下添加
HelloWorld@1
*************************************************
vb里這么寫
Public?Declare?Sub?HelloWorld?Lib?"XXXX.dll"?()
然后調用就可以了,上面是VB的代碼,或許VB.net的也差不多
加以一個panel用來顯示應用程序的,就是放你那個easycap的,代碼如下
Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Int32, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Int32) As Int32
Private Const WM_SYSCOMMAND As Int32 = H112
Private Const SC_MAXIMIZE As Int32 = HF030
Private Const SC_MINIMIZE As Int32 = HF020
Private Const SC_RESTORE As Int32 = HF120
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Int32, ByVal nCmdShow As Int32) As Int32
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ShellExecute(Me.Panel1.Handle, "open", "c:\windows\system32\cmd.exe", Nothing, ".", SW_HIDE)
System.Threading.Thread.Sleep(50)
Dim h As IntPtr = FindWindow(Nothing, "c:\windows\system32\cmd.exe")
ShowWindow(h, SW_HIDE)
SetParent(h, Me.Panel1.Handle) '嵌到panel1內
SendMessage(h, WM_SYSCOMMAND, SC_MAXIMIZE, 0)
End Sub
把其中的c:\windows\system32\cmd.exe換成你要嵌入的應用程序