469,631 Members | 1,116 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

error 2664 Conversion error

Hello

I am trying to convert the following???

The Code

std::string* ChkName;

GlobalInterfacePtr->MethodA(position, bstr, ChkName);

error C2664: 'MethodA' : cannot convert parameter 3 from 'class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > ** ' to 'unsigned short ** '

Could anyone give me suggestions?

Thanks!

Karthik

Nov 17 '05 #1
6 1346
>I am trying to convert the following???

The Code

std::string* ChkName;

GlobalInterfacePtr->MethodA(position, bstr, ChkName);

error C2664: 'MethodA' : cannot convert parameter 3 from 'class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > ** ' to 'unsigned short ** '


Karthik,

MethodA probably requires a BSTR * parameter for ChkName. Try using
CComBSTR or _bstr_t instead:

CComBSTR ChkName;
GlobalInterfacePtr->MethodA(position, bstr, &ChkName);

Dave
Nov 17 '05 #2
>I am trying to convert the following???

The Code

std::string* ChkName;

GlobalInterfacePtr->MethodA(position, bstr, ChkName);

error C2664: 'MethodA' : cannot convert parameter 3 from 'class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > ** ' to 'unsigned short ** '


Karthik,

MethodA probably requires a BSTR * parameter for ChkName. Try using
CComBSTR or _bstr_t instead:

CComBSTR ChkName;
GlobalInterfacePtr->MethodA(position, bstr, &ChkName);

Dave
Nov 17 '05 #3
Hey Dave!

Yeah U R correct.. I made the change and it did work! :-)

Nov 17 '05 #4
Hey Dave!

Yeah U R correct.. I made the change and it did work! :-)

Nov 17 '05 #5
Hey Dave!

Yeah U R correct.. I made the change and it did work! :-)

Nov 17 '05 #6
Hey Dave!

Yeah U R correct.. I made the change and it did work! :-)

Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by c++newbie | last post: by
7 posts views Thread by Karthik | last post: by
4 posts views Thread by yanyo | last post: by
1 post views Thread by Mike Smith | last post: by
2 posts views Thread by linq936 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.