ok here is part of c++ code:
//execInMirc stuff
#define WM_MCOMMAND (WM_USER + 200)
HWND *mHwnd;
LPSTR mData = NULL;
HANDLE hMap = NULL;
//execInMirc stuff end
void execInMircInit(HWND *mh)
{
mHwnd = mh;
hMap = CreateFileMapping(INVALID_HANDLE_VALUE,0,PAGE_READWRITE,0,1024,"mIRC");
mData = (LPSTR)MapViewOfFile(hMap,FILE_MAP_ALL_ACCESS,0,0,0);
}
void execInMirc(const std::string &s)
{
#ifdef COMP_EXE
std::cout << "EIM: " << s << std::endl;
return;
#endif
wsprintf(mData, s.c_str());
SendMessage(*mHwnd, WM_MCOMMAND, 0, 0);
}
void execInMirc(const char *s)
{
std::string mmsg = s;
execInMirc(mmsg);
}
void execInMircShutdown()
{
UnmapViewOfFile(mData);
CloseHandle(hMap);
}
now if I send any string to execInMirc that contains % symbol, it causes mirc to crash.
for instance: execInMirc("/echo -s Hello % World!"); will cuase crash.
So is there any other way to send command to the mirc that contains % sign without using standart returns from dll with data parameter?