include QtCore/QCoreApplication
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到寧晉網(wǎng)站設(shè)計(jì)與寧晉網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:網(wǎng)站建設(shè)、網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名與空間、網(wǎng)站空間、企業(yè)郵箱。業(yè)務(wù)覆蓋寧晉地區(qū)。
#include QAxObject
#include Windows.h
int main(int argc, char *argv[])
{
//OleInitialize(0);
//CoInitialize(0);
QCoreApplication a(argc, argv);
QAxObject *asdfg = new QAxObject("Excel.Application");
return a.exec();
}
很簡(jiǎn)單,在end select前再多加一種情況case else return "XXXx",因?yàn)槟阒惶峁┝?-9這10種情況
Public Function Zuhe(ByVal qa As String) As String
Select Case qa
Case "0"
Return "1"
Case "1"
Return "3"
Case "2"
Return "4"
Case "3"
Return "6"
Case "4"
Return "2"
Case "5"
Return "8"
Case "6"
Return "9"
Case "7"
Return "7"
Case "8"
Return "5"
Case "9"
Return "0"
Case else
Return "XXXX"
End Select
End Function
因?yàn)閿?shù)據(jù)類(lèi)型的不同,VB.NET調(diào)用系統(tǒng)API函數(shù)和VB6不太一樣,VB6是這樣:
Public?Declare?Function?SetWindowPos?Lib?"user32"?(ByVal?hwnd?As?Long,?ByVal?hWndInsertAfter?As?Long,?ByVal?X?As?Long,?ByVal?Y?As?Long,?ByVal?cx?As?Long,?ByVal?cy?As?Long,?ByVal?wFlags?As?Long)?As?Long
在VB.NET中是這樣調(diào)用:
DllImport("user32.dll",?SetLastError:=True)?_
Public?Shared?Function?SetWindowPos(ByVal?hWnd?As?IntPtr,?ByVal?hWndInsertAfter?As?IntPtr,?ByVal?X?As?Integer,?ByVal?Y?As?Integer,?ByVal?cx?As?Integer,?ByVal?cy?As?Integer,?ByVal?uFlags?As?SetWindowPosFlags)?As?Boolean
End?Function
參考:
注意:參數(shù)為動(dòng)態(tài)數(shù)組;
Private Function MyF(ByRef d() As Integer)
ReDim d(4, 13) As Integer
Dim i As Integer
Dim j As Integer
Dim n As Integer
Dim MyNum(4) As Integer
For i = 1 To 4
MyNum(i) = 0
Next i
Randomize
For i = 1 To 4
For j = 1 To 13
n = Int(Rnd * 4 + 1)
Do While MyNum(n) = 13
n = Int(Rnd * 4 + 1)
Loop
d(i, j) = n
MyNum(n) = MyNum(n) + 1
Next j
Next i
End Function