用VC++编译成.dll文件,然后用VB调用。

解决方案 »

  1.   

    hillmanweb(山人)这个我知道!
    但我现在是想问:如何才能在vb的代码框中直接引用vc++的代码,进行编译!
    vb的工程->引用对话框中的:Visual c++ Text Editor,Visual c++ Shared Objects,Visual c++ Project system,Visual c++ Debugger,有什么用?
      

  2.   

    试试这个控件Script Control 
    ================================================================
    [email protected]
      

  3.   

    Private Sub Form_Load()Dim scr As New ScriptControl
    Dim mycode As Stringscr.Language = "vbscript"
    mycode = "public function Test()" + vbCrLf
    mycode = mycode + "MsgBox ""Hello VB""" + vbCrLf
    mycode = mycode + "End function"scr.AddCode (mycode)
    scr.Eval ("Test()")End Sub
    我只是试过vbscript,没试过vc你可以试试!好了,别忘了,通知一下
    ================================================================
    [email protected]
      

  4.   

    Private Sub Form_Load()
    Dim scr As New ScriptControl
    Dim mycode As String
    scr.Language = "vbscript"
    mycode = "public function Test()" + vbCrLf
    mycode = mycode + "MsgBox ""Hello VB""" + vbCrLf
    mycode = mycode + "End function"
    scr.AddCode (mycode)
    scr.Eval ("Test()")
    End Sub
    我只是试过vbscript,没试过vc你可以试试!好了,别忘了,通知一下
    ================================================================
    [email protected]