extern "C" long __stdcall GetList(BSTR *ListHolder)
{
String MYSTRING = "one,two,three,four,five";
ListHolder = SysAllocString(MYSTRING.c_str());
return true;
}
In order to use SysAllocString, I have to include the standard header
file oleauto.h, which I did. However, when trying to build the DLL, I get
two errors from the same line in the header file:
Line:
EXTERN_C const IID IID_StdOle;
Errors:
error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
fatal error C1004: unexpected end of file found
What is wrong? Why am I getting errors in a standard include file? Is
there any other file I should have included? I installed Service Pack 4
thinking there might be a bug, but its not that. I'm no C++ expert, but as
far as I know, its not my code, is it?
Any help very much appreciated,
Roberto Icaza
#include <string>
#include <wtypes.h>
#include <oleauto.h>
extern "C" long __stdcall GetList(BSTR *ListHolder)
{
std::wstring MYSTRING = L"one,two,three,four,five";
*ListHolder = ::SysAllocString(MYSTRING.c_str());
return true;
}
--
Randy Charles Morin
http://www.kbcafe.com/randycharlesmorin
"Roberto Icaza" <ric...@ans.edu.ni> wrote in message
news:uOnVCyC1AHA.1540@tkmsftngp03...