Dear Schmidt,

Many many thanks for your help. I've tried your code and it works! Thanks a lot!

Of course, I have adapted it for my purposes and I've still a small problem. In your sample code you use function SysAllocString to allocate a constant string. For instance, using your notation we can do:

Code:
bstrArr[i] = SysAllocString(L"hello world!");
Now, suppose that I have not a constant string but something like the following:

Code:
string mystr = "hello world!";
bstrArr[i] = SysAllocString(mystr.c_strt());
Unfortunately, the above code does not work and I do not understand why. casting to (const unsigned short *) it compiles but it does not assign the correct string. Could you help me to solve this last issue?

Thanks a lot in advance and best regards,

Cristina