各位大虾我用MFC编写了一个ATL组件。有两个问题。
1。 接口的参数使用的事BSTR请问VB可以使用吗?
2。 如何使用。能详细一点最好。比如需要什么文件。什么语句调用。我不会VB
先行写过,马上结账

解决方案 »

  1.   

    当然可以,BSTR在VB中就是String。我正在写一个同样主题的程序,下面是我写的程序中的片断:
        Dim MrDb
        Set MrDb = CreateObject("MyDBAccess.MrDb") (使用你自己的组件的ProgID)      Dim bOpenMode As Boolean
        bOpenMode = False
        Call MrDb.Open(CStr(dbName), bOpenMode)
       
        Dim varPatients
        varPatients = MrDb.GetChildren(CStr(dbRootLOID))
        If VarType(varPatients) <> vbArray Then
            Form1.Print "    --Fatal Error:VarType(varPatients) = " & VarType(varPatients)
        Else
            Form1.Print "    --varPatients is an array"
        End If
        Form1.Print "    --LBound = " & LBound(varPatients)
        Form1.Print "    --UBound = " & UBound(varPatients)
    你要先用regsvr32注册你的COM组件。
      

  2.   

    解决的最后用LPSTR VB可以接收