I have a structure defined in my header file:
struct video
{
wchar_t* videoName;
std::vector<wchar_t*> audio;
std::vector<wchar_t*> subs;
};
struct ret
{
std::vector<video*> videos;
wchar_t* errMessage;
};
struct params{
HWND form;
wchar_t* cwd;
wchar_t* disk;
ret* returnData;
};
When I try to add my video structure to a vector of video* I get access violation reading 0xcdcdcdc1 (videoName is @ 0xcdcdcdcd, before I allocate it)
//extract of code where problem is
video v;
v.videoName = (wchar_t*)malloc((wcslen(line)+1)*sizeof(wchar_t));
wcscpy(v.videoName,line);
p->returnData->videos.push_back(&v); //error here