2

私はこの関数を見て、これを呼び出す方法を考えていました。コンポーネントを作成し、この関数を COM クライアントにエクスポートしたい場合があるため、文字列のセーフ配列を埋めたいと考えています (他の種類のオートメーションも問題ありません)。そこで、ATL スマート クラスを活用したいと考えました。これは、これまでのところ、コンソール アプリケーションです。

#include "pch.h"
#include <iostream>
// in pch.h ...
//#include "windows.h"
//#include "comutil.h"
//#include "atlbase.h"
//#include <comdef.h>
//#include "atlsafe.h"


int main()
{
    LCID germany(7);
    LPOLESTR *rgp;
    HRESULT hr;
    hr=::GetAltMonthNames(germany, &rgp); // can't see results
    if (hr != S_OK) return hr;

    CComSafeArray<BSTR> months;
    hr = ::GetAltMonthNames(germany,(LPOLESTR**) &months); //forced compile but no joy
    if (hr != S_OK) return hr;
    std::cout << "Hello World!\n"; 
}
4

1 に答える 1