本帖最后由 lys0053 于 2009-07-20 14:56:03 编辑

解决方案 »

  1.   

    这只是部分代码,VC代码用不访问数据库的VB dll测试是没问题的,而调用访问数据的VB dll编译时就出错这是生成的.tlh代码#pragma once
    #pragma pack(push, 8)#include <comdef.h>//
    // Forward references and typedefs
    //struct __declspec(uuid("7c3d4c9d-ad5c-4db5-9df4-e593e5279e16"))
    /* dual interface */ _Class1;
    struct /* coclass */ Class1;//
    // Smart pointer typedef declarations
    //_COM_SMARTPTR_TYPEDEF(_Class1, __uuidof(_Class1));//
    // Type library items
    //struct __declspec(uuid("7c3d4c9d-ad5c-4db5-9df4-e593e5279e16"))
    _Class1 : IDispatch
    {
        //
        // Property data
        //    __declspec(property(get=GetCn,put=PutRefCn))
        _ConnectionPtr Cn;//这里我在msado15.tlh和msado26.tlh里都没找到
        //
        // Wrapper methods for error-handling
        //    _ConnectionPtr GetCn ( );  //这里报错     
        void PutRefCn (
            struct _Connection * Cn );
        HRESULT OpenConnection ( );
        _variant_t DT_start (
            short devType,
            _bstr_t uid,
            _bstr_t fw,
            _bstr_t chip,
            short tune,
            _bstr_t kmtINI,
            long L );    //
        // Raw methods provided by interface
        //    virtual HRESULT __stdcall get_Cn (
            struct _Connection * * Cn ) = 0;
        virtual HRESULT _VtblGapPlaceholder1( ) { return E_NOTIMPL; }
        virtual HRESULT __stdcall putref_Cn (
            struct _Connection * Cn ) = 0;
        virtual HRESULT __stdcall raw_OpenConnection ( ) = 0;
        virtual HRESULT __stdcall raw_DT_start (
            short devType,
            BSTR uid,
            BSTR fw,
            BSTR chip,
            short tune,
            BSTR kmtINI,
            long L,
            VARIANT * _arg8 ) = 0;
    };struct __declspec(uuid("dc0c4ffb-89ed-44a6-8f25-801a2cb7eb36"))
    Class1;
        // [ default ] interface _Class1//
    // Wrapper method implementations
    //#include "e:\program files\microsoft visual studio\myprojects\callvb\debug\RS21.tli"#pragma pack(pop)