我看到了这个函数,想知道如何调用它。我可能想编写一个组件并将这个函数导出到 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";
}