I have a program that is using HeapAlloc() to allocate a struct that contains a QString and a few QByteArray structs.
Struct code:
struct Environment {
QString internalLinksDomain;
QByteArray aboutTelegram;
QByteArray aboutContacts;
QByteArray aboutFrequent;
QByteArray aboutSessions;
QByteArray aboutWebSessions;
QByteArray aboutChats;
QByteArray aboutLeftChats;
};
My code:
Environment* e = (Environment*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Environment));
e->internalLinksDomain = "Test data";
I have also tried..
e->internalLinksDomain.append("Test data");
Both send me to the atomic file in Visual Studio. I have attached a screen shot of the error and its position in the function causing the error.