Visual Studio C++ >> IDL Help
I guess I finally figured out the answer, if anyone's interested. String
constants declared this way can be used in VB.
[string] BSTR const MyConst = L"My Const";
> Newbie question:
>
> What is the syntax to declare a string constant in an IDL? I'm trying to
> compile a type lib that I can reference and use from VB project.
>
> If I use 'string', I get an error:
> "syntax error : expecting a type specification or a storage specifer or a
> type qualifier near "string"
>
> If I use 'BSTR', I get an error:
> error C2440: 'initializing' : cannot convert from 'char [24]' to 'unsigned
> short *const '
>
> If I use 'wchar_t *' I can compile it, but obviously I cannot use it in VB.
>
> TIA.
>