Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem in getting child Window handle to another dlu Pin
002comp30-Aug-09 20:57
002comp30-Aug-09 20:57 
GeneralRe: Problem in getting child Window handle to another dlu Pin
«_Superman_»30-Aug-09 21:12
professional«_Superman_»30-Aug-09 21:12 
GeneralRe: Problem in getting child Window handle to another dlu Pin
002comp30-Aug-09 22:19
002comp30-Aug-09 22:19 
GeneralRe: Problem in getting child Window handle to another dlu(Solved) Pin
002comp30-Aug-09 23:09
002comp30-Aug-09 23:09 
AnswerRe: Problem in getting child Window handle to another dlu Pin
Rajesh R Subramanian30-Aug-09 20:19
professionalRajesh R Subramanian30-Aug-09 20:19 
GeneralRe: Problem in getting child Window handle to another dlu Pin
002comp30-Aug-09 21:03
002comp30-Aug-09 21:03 
GeneralRe: Problem in getting child Window handle to another dlu Pin
Rajesh R Subramanian30-Aug-09 21:06
professionalRajesh R Subramanian30-Aug-09 21:06 
QuestionHELP! COM <--> VB string conversion, Can't convert between BSTR and _bstr_t Pin
Vader_Oz30-Aug-09 18:26
Vader_Oz30-Aug-09 18:26 
Hi,

This question has been posted to other forums without success (so far).

I am not a C++ coder. I usually work with VB and occasionally C#.

I have some old cde that has a problem, and can't get a 'simple' string conversion working.

This is a COM DLL used by VB6.

The function is defined as follows:

STDMETHODIMP CParser::GetAttributeValue(BSTR strName, VARIANT strPath, BSTR *pStrVal)


The problem is that strPath is incorrect, and I need to know what it is.

Currently I have the following:

return Error("Error in GetAttributeValue. The node Path specified was not found.");


This works, but I want it to give me the path.

This does not work:
return Error("Error in GetAttributeValue. The node Path specified (" + strPath + ") was not found.");

The error is:
error C2679: binary '+' : no operator defined which takes a right-hand operand of type 'struct tagVARIANT' (or there is no acceptable conversion)

I understand it is a type conversion problem, but can't seem to get the syntax correct.

Trying something as simple as this does not work:
return Error("Error in GetAttributeValue. The node Path specified (" + _bstr_t(strPath) + ") was not found.");

error C2668: 'Error' : ambiguous call to overloaded function

Trying this also does not work:
return Error("Error in GetAttributeValue. The node Path specified (" + _bstr_t(strPath.bstrVal) + ") was not found.");

error C2668: 'Error' : ambiguous call to overloaded function

Other failures:
return Error("Error in GetAttributeValue. The node Path specified (" + BSTR(strPath.bstrVal) + ") was not found.");

error C2110: cannot add two pointers

Please help. I don't know what I have to do to fix this.

Error() is defined in COMDEF.h:
static HRESULT WINAPI Error(LPCSTR lpszDesc,
const IID& iid = GUID_NULL, HRESULT hRes = 0)
{
return AtlReportError(GetObjectCLSID(), lpszDesc, iid, hRes);
}


Apparently CstringT can be used as it allows conversion between VARIANT and other TYPEs. But how do I use it? This is Visual Studio 6. CStringT isn't included with this old compiler.

Dave
AnswerRe: HELP! COM <--> VB string conversion, Can't convert between BSTR and _bstr_t Pin
Vader_Oz30-Aug-09 19:09
Vader_Oz30-Aug-09 19:09 
GeneralRe: HELP! COM <--> VB string conversion, Can't convert between BSTR and _bstr_t Pin
Vader_Oz30-Aug-09 19:38
Vader_Oz30-Aug-09 19:38 
Questionproblem with gsm modem sim300 Pin
hamedkapak30-Aug-09 14:02
hamedkapak30-Aug-09 14:02 
AnswerRe: problem with gsm modem sim300 Pin
Richard MacCutchan31-Aug-09 3:44
mveRichard MacCutchan31-Aug-09 3:44 
QuestionProject Pin
MrMcIntyre30-Aug-09 10:00
MrMcIntyre30-Aug-09 10:00 
AnswerRe: Project Pin
msn9230-Aug-09 11:53
msn9230-Aug-09 11:53 
AnswerRe: Project Pin
Richard MacCutchan31-Aug-09 3:59
mveRichard MacCutchan31-Aug-09 3:59 
GeneralInclude headers Pin
gordon305630-Aug-09 9:53
gordon305630-Aug-09 9:53 
GeneralRe: Include headers Pin
Adam Roderick J30-Aug-09 18:19
Adam Roderick J30-Aug-09 18:19 
GeneralRe: Include headers Pin
Hamid_RT30-Aug-09 22:53
Hamid_RT30-Aug-09 22:53 
QuestionOvercoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 9:02
Sternocera30-Aug-09 9:02 
AnswerRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Richard Andrew x6430-Aug-09 11:34
professionalRichard Andrew x6430-Aug-09 11:34 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 11:43
Sternocera30-Aug-09 11:43 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Sternocera30-Aug-09 12:50
Sternocera30-Aug-09 12:50 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Richard Andrew x6430-Aug-09 13:08
professionalRichard Andrew x6430-Aug-09 13:08 
AnswerRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Stuart Dootson30-Aug-09 13:21
professionalStuart Dootson30-Aug-09 13:21 
GeneralRe: Overcoming problem with std::min, std::max, #define NOMINMAX Pin
Member 1235294525-Oct-20 4:58
Member 1235294525-Oct-20 4:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.