0

vc.net (VS2010) で呼び出すことができる ac# dll があります。VC6 で同じソース コードを実行しようとすると、エラーが発生します。

 IMyTestDLLPtr pIMYTESTDLL(__uuidof(CMYTestDLL)); 

以下は、この小さなユーティリティのコード全体です

#include "stdafx.h"
#include <iostream>

// Import the type library in DLL
#import  "MY.TestDLL.tlb" raw_interfaces_only

using namespace My_TestDLL;
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
   // Initialize the COM interface
   HRESULT hr = CoInitialize(NULL);
   // Make a smart pointer to the EPASS interface in DLL
   IMyTestDLLPtr pIMYTESTDLL(__uuidof(CMYTestDLL));  



   // Pass Params to API  
   BSTR result = 0;
   hr = pIMYTESTDLL->DLLFunction(1, _bstr_t("11111111111"),  &result);


   CoUninitialize();
   // Display the results
   cout << result << '\n';  
   return 0;
}

誰もがvc6でそれを利用する方法を助けてください

4

0 に答える 0