Archived

This topic is now archived and is closed to further replies.

disjunction

MIDL string

Recommended Posts

im makin an ALT COM app in C++, and i want a method to accept a vb compatible string. i do this: add method-> HRESULT load([in, string] char* fname); however, when i compile, i get all sorts of errors... how do u declare a string argument?

Share this post


Link to post
Share on other sites
First of all, it''s ATL, not ALT. (ALT sounds like a sandwich!)

Strings in COM are of type BSTR. A BSTR is a unicode string. You can use the ATL class CComBSTR to make life a bit easier (it''s similar to the MFC CString class)


codeka.com - Just click it.

Share this post


Link to post
Share on other sites