Click here to Skip to main content
15,887,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert TCHAR to CString Pin
Cedric Moonen25-May-09 23:50
Cedric Moonen25-May-09 23:50 
GeneralRe: convert TCHAR to CString Pin
CPallini25-May-09 23:50
mveCPallini25-May-09 23:50 
QuestionRe: convert TCHAR to CString Pin
Rajesh R Subramanian25-May-09 23:55
professionalRajesh R Subramanian25-May-09 23:55 
AnswerRe: convert TCHAR to CString Pin
CPallini26-May-09 0:03
mveCPallini26-May-09 0:03 
GeneralRe: convert TCHAR to CString Pin
ThatsAlok26-May-09 22:19
ThatsAlok26-May-09 22:19 
GeneralRe: convert TCHAR to CString Pin
CPallini26-May-09 22:31
mveCPallini26-May-09 22:31 
GeneralRe: convert TCHAR to CString Pin
ThatsAlok28-May-09 6:01
ThatsAlok28-May-09 6:01 
GeneralRe: convert TCHAR to CString Pin
CPallini28-May-09 9:20
mveCPallini28-May-09 9:20 
GeneralRe: convert TCHAR to CString Pin
aravind.sn19-Jun-09 1:23
aravind.sn19-Jun-09 1:23 
QuestionPlease help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron25-May-09 23:21
ptr_Electron25-May-09 23:21 
AnswerRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson25-May-09 23:42
professionalStuart Dootson25-May-09 23:42 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 0:00
ptr_Electron26-May-09 0:00 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 0:17
ptr_Electron26-May-09 0:17 
GeneralRe: Some onePlease help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 0:51
ptr_Electron26-May-09 0:51 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 0:51
professionalStuart Dootson26-May-09 0:51 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 1:09
ptr_Electron26-May-09 1:09 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 2:24
professionalStuart Dootson26-May-09 2:24 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 2:26
ptr_Electron26-May-09 2:26 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
ptr_Electron26-May-09 21:46
ptr_Electron26-May-09 21:46 
GeneralRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
Stuart Dootson26-May-09 21:49
professionalStuart Dootson26-May-09 21:49 
QuestionRe: Please help me regarding :LoadCursorFromFile with .ani file Pin
David Crow26-May-09 3:09
David Crow26-May-09 3:09 
QuestionOperator [] Overloading Pin
Mikey_H25-May-09 22:19
Mikey_H25-May-09 22:19 
I have made a few wrapper classes for arrays to include dynamic resizing, string indexing etc.
The classes worked fine when used on their own in an app. Now i have attempted to make a Hashtable class which uses an Array object of AssocArray objects.

When I attempt to access data by using code like ' array[x][str] = y; ' I get the following error...
error C2679: binary '[' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

#include <string>
using std::string;

int x = 0;
int y = 1;

string = "Foo";

array = new Array<AssocArray<int>>();

// Error C2679
array[x][str] = y;


Function for overloaded operators is very similar for both Array, and AssocArray. I have removed all code inside function as it produced the same error when commented out.

template <class TType>
TType& AssocArray<TType>::operator [](string s)
{
	return new TType;
}


It is my understanding that the line ' array[x][str] = y; ' would be computed like this...
AssocArray<int> ax = array[x];
ax[str] = y;

Am I correct about this?

I'm not sure what is going on here, and assume this is all the relevant code, If you would like to see any more just ask.
AnswerRe: Operator [] Overloading Pin
CPallini25-May-09 22:43
mveCPallini25-May-09 22:43 
GeneralRe: Operator [] Overloading Pin
Mikey_H25-May-09 23:19
Mikey_H25-May-09 23:19 
AnswerRe: Operator [] Overloading Pin
Stuart Dootson25-May-09 22:49
professionalStuart Dootson25-May-09 22:49 

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.