2010-11-30 57 views
1

我有我寫的自定義驅動程序。我需要幫助轉換我的驅動程序用戶界面代碼

這裏是C源代碼傳達給駕駛員:

#include <windows.h> 
#include <stdio.h> 

/********************************************************* 
* Main Function Entry 
* 
*********************************************************/ 
int _cdecl main(void) 
{ 
HANDLE hFile; 
DWORD dwReturn; 

hFile = CreateFile("\\\\.\\Example", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); 

if(hFile) 
{ 
WriteFile(hFile, "Hello from user mode!", sizeof("Hello from user mode!"), &dwReturn, NULL); 
CloseHandle(hFile); 
} 

return 0; 
} 

我希望能夠在VB.NET爲此在.NET preferaly。

有誰知道如何做轉換?

回答

1

您可能會發現在.net框架中使用SerialPort類更容易。查看對this question的回覆。

+0

這真的與問題無關。 – 2010-12-03 20:05:01