Hello everyone, I'm building a simple RPG type game and have run into a snag with my inventory. The program is a Dialog based application, the problem I've run into is I've created a seperate class to contain all my item handling code and a listbox on the main dialog to display the names of the items. I'm trying to set the items in the listbox by using:
Code:
m_lbInventory.AddString(CItems::PopulateShop(*holder));
and the function code is:
Code:
void CItems::PopulateShop(CString* holder)
{
*holder = ShopList.m_sName;
}
The error I receive is:
error C2664: 'PopulateShop' : cannot convert parameter 1 from 'const char' to 'class CString *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
In that particular case I tried to use pointers in order to get the data, I am not very good with pointers yet and likely did not use them properly. Am I heading in the right direction with the pointers? Or should I be attempting to do this in a completely different way?