SOLVED
After I reinstalled my OS (2008 Server) I then noticed that there’s something odd going on within my program.
Here’s the link to part of the source http://phantomworksstudios.com/cpp/ss/sof-odd.h
Here’s the code first:
custom-data.h
class INI_{
public:
const char* error;
stringstream CharToStr2;
Layout layout;
Settings settings;
string file;
int OpenFile(string open_file){
CharToStr2.str("");
ifstream SSMAIN_FILE_SETTINGS;
CharToStr2<<open_file;
cout<<"CharToStr: "<<CharToStr2<<endl;
cout<<"CharToStr.str(): "<<CharToStr2.str()<<endl;
cout<<"CharToStr.str.c_str(): "<<CharToStr2.str().c_str()<<endl;
SSMAIN_FILE_SETTINGS.open(CharToStr2.str().c_str());
if(!SSMAIN_FILE_SETTINGS){
CharToStr2<<" is currupt or not found!. Loading default configuration!";
cout<<"STRING1:"<<CharToStr2<<endl<<endl;
cout<<"STRING2:"<<CharToStr2.str()<<endl<<endl;
cout<<"STRING3:"<<CharToStr2.str().c_str()<<endl<<endl;
error=CharToStr2.str().c_str();
cout<<"ERROR:"<<error<<endl;
}
cout <<"CLASS INI_: "<<SSMAIN_FILE_SETTINGS<<" : "<<file<<endl<<endl;
}
};
INI_ SourceStudioConfiguration;
procedures.h
case WM_CREATE:
SSMAIN_EXPLORERWINDOW_MENU=LoadMenu(SSMAIN_HINSTANCE,MAKEINTRESOURCE(ID_EXPLORER_MENU));
SourceStudioConfiguration.layout.cx=0;
User_Buffer=32767;
OpenProcessToken(GetCurrentProcess(),TOKEN_QUERY,&hToken);
GetUserProfileDirectory(hToken,InfoBuf,&User_Buffer);
User_Path=InfoBuf;
// cout<<InfoBuf<<endl<<endl;
CharToStr<<InfoBuf<<"\\Source Studio\\preference.ini";
preference=CharToStr.str();
cout<<User_Path<<" : "<<preference<<endl<<endl;
// SourceStudioConfiguration.file=preference;
SourceStudioConfiguration.OpenFile(preference);
cout<<"CREATE:"<<SourceStudioConfiguration.error<<endl<<endl;
cout<<"Class File"<<SourceStudioConfiguration.file<<endl<<endl;
hbmPWSBUTTON = (HBITMAP)LoadBitmap(hInst_PWSBUTTON, MAKEINTRESOURCE(IMG_PWS_BUTTON));
cout<<"Load PWS Bitmap: "<<hbmPWSBUTTON<<endl;
hbmPWSCommandOVERVIEW=(HBITMAP)LoadBitmap(hInst_PWSCOMMANDTB, MAKENTRESOURCE(IMG_PWS_COMMAND_OVERVIEW));
hbmPWSCommandDOCUMENT=(HBITMAP)LoadBitmap(hInst_PWSCOMMANDTB, MAKEINTRESOURCE(IMG_PWS_COMMAND_DOCUMENT));
hbmPWSCommandNEWFILE=(HBITMAP)LoadBitmap(hInst_PWSCOMMANDTB, MAKEINTRESOURCE(IMG_PWS_COMMAND_NEWFILE));
hbmPWSCommandCLOSE=(HBITMAP)LoadBitmap(hInst_PWSCOMMANDTB, MAKEINTRESOURCE(IMG_PWS_COMMAND_CLOSE));
cout<<"CREATE:"<<SourceStudioConfiguration.error<<endl<<endl;
cout<<"Load PWS Command Toolbar Bitmap: "<<hbmPWSCommandOVERVIEW<<endl;
cout<<"CREATE 277:"<<SourceStudioConfiguration.error<<endl<<endl;
SSMAIN_REBARWINDOW = CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT, REBARCLASSNAME,NULL, WS_CHILD|WS_BORDER|RBS_VARHEIGHT|TBS_HORZ|RBS_BANDBORDERS|CCS_NODIVIDER|CCS_NOPARENTALIGN,0,0,0,0,hwnd, NULL, 0, 0);
SSMAIN_EXPLORERWINDOW=CreateWindowEx(WS_EX_TRANSPARENT,"button",NULL, BS_GROUPBOX|WS_CHILD,0,79,150,SSMAIN_HEIGHT-157,hwnd, (HMENU)SSMAIN_EXPLORERWINDOW_MENU, SSMAIN_EXPLORERBAR_HINSTANCE, 0);
//SSMAIN_EXPLORERWINDOW_REBAR=CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT, REBARCLASSNAME, NULL, WS_CHILD|WS_BORDER|RBS_VARHEIGHT|TBS_HORZ|RBS_BANDBORDERS|CCS_NODIVIDER|CCS_NOPARENTALIGN, 0,0,0,0,SSMAIN_EXPLORERWINDOW,NULL,0,0);
SSMAIN_NAVIGATIONTOOLBAR=CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT, "TOOLBARWINDOW32", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT|TBSTYLE_ALTDRAG|TBSTYLE_LIST|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_ADJUSTABLE|CCS_NORESIZE, 0, 0, 0, 0,SSMAIN_REBARWINDOW, (HMENU)IDC_NAVIGATIONTOOLBAR, GetModuleHandle(NULL), NULL);
SSMAIN_EXPLORERWINDOW_OVERVIEW=CreateWindowEx(0,"button", NULL,BS_BITMAP|BS_USERBUTTON|BS_TEXT|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, 4, 12, 18, 18,SSMAIN_EXPLORERWINDOW, (HMENU)IDC_EXPLORERWINDOW_REBAR_COMMANDBAR, GetModuleHandle(NULL), NULL);
SSMAIN_EXPLORERWINDOW_DOCUMENT=CreateWindowEx(0, "button",NULL,BS_BITMAP|BS_USERBUTTON|BS_TEXT|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, 24, 12, 18, 18,SSMAIN_EXPLORERWINDOW, (HMENU)IDC_EXPLORERWINDOW_REBAR_COMMANDBAR, GetModuleHandle(NULL), NULL);
SSMAIN_EXPLORERWINDOW_NEWFILE=CreateWindowEx(0,"button",NULL, BS_BITMAP|BS_USERBUTTON|BS_TEXT|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, 44, 12, 18, 18,SSMAIN_EXPLORERWINDOW, (HMENU)IDC_EXPLORERWINDOW_REBAR_COMMANDBAR, GetModuleHandle(NULL), NULL);
SSMAIN_EXPLORERWINDOW_CLOSE=CreateWindowEx(0,"button",NULL, BS_BITMAP|BS_USERBUTTON|BS_TEXT|WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS, 62, 12, 18, 18,SSMAIN_EXPLORERWINDOW, (HMENU)IDC_EXPLORERWINDOW_REBAR_COMMANDBAR, GetModuleHandle(NULL), NULL);
//SSMAIN_PARENTCONTAINER=CreateWindow("SYSTABCONTROL32","", WS_EX_COMPOSITED|WS_CHILD|WS_VISIBLE,100,100,0,0,hwnd,(HMENU)ID_PARENTCONTAINER,SSMAIN_PARENTCONTAINER_HINSTANCE, NULL);
SSMAIN_STATIC_RTF_CONTAINER=CreateWindowEx(WS_EX_TRANSPARENT|WS_EX_CLIENTEDGE, "static","",WS_CHILD,0,0,0,0,hwnd,(HMENU)IDC_STATIC_RTF_CONTAINER,0,0);
SSMAIN_STATIC_RTFCONTROL_PARENT_HSCROLL=CreateWindow("SCROLLBAR","", WS_EX_COMPOSITED|WS_CHILD|WS_VISIBLE|SBS_BOTTOMALIGN,100,100,20,20,SSMAIN_STATIC_RTF_CONTAINER,(HMENU)IDC_STATIC_RTFCONTROL_PARENT_HSCROLL,SSMAIN_PARENTCONTAINER_HINSTANCE,NULL);
SSMAIN_LISTBOXRTFCOUNT= CreateWindowEx(0,"LISTBOX",NULL, WS_CHILD|WS_CLIPSIBLINGS|ECO_AUTOVSCROLL|LBS_NOINTEGRALHEIGHT|LBS_NOTIFY|WS_VISIBLE|WS_GROUP, 0,0,0,0,SSMAIN_STATIC_RTF_CONTAINER,(HMENU)IDC_LISTBOXRTFCOUNT,NULL,NULL);
SSMAIN_RTFCONTROL=CreateWindow("RICHEDIT","text", WS_CHILD|WS_VISIBLE|ES_MULTILINE|ES_AUTOHSCROLL|WS_VSCROLL|WS_HSCROLL|WS_GROUP, 0,0,0,0,SSMAIN_STATIC_RTF_CONTAINER,(HMENU)IDC_RTFCONTROL,SSMAIN_RTFCONTROL_HINSTANCE,0);
SSMAIN_TOOLBAR=CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT, "TOOLBARWINDOW32", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT|TBSTYLE_ALTDRAG|TBSTYLE_LIST|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_ADJUSTABLE|CCS_NORESIZE, 0, 0, 0, 0,hwnd, (HMENU)IDC_TOOLBAR, GetModuleHandle(NULL), NULL);
SSMAIN_STATUSBAR = CreateWindow("MSCTLS_STATUSBAR32", "", WS_EX_COMPOSITED|WS_CHILD|WS_VISIBLE, 100, 100, 0, 0, hwnd, NULL, 0, NULL);
cout<<"CREATE 300:"<<SourceStudioConfiguration.error<<endl<<endl; SendMessage(SSMAIN_STATUSBAR,SB_SETPARTS,(WPARAM)3,(LPARAM)&panes);
SSMAIN_TOOLBARSYNTAX = CreateWindowEx(WS_EX_TOOLWINDOW|WS_EX_TRANSPARENT, "TOOLBARWINDOW32", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|TBSTYLE_TOOLTIPS|TBSTYLE_FLAT|TBSTYLE_ALTDRAG|TBSTYLE_LIST|CCS_NODIVIDER|CCS_NOPARENTALIGN|CCS_ADJUSTABLE|CCS_NORESIZE, 0, 0, 0, 0,SSMAIN_REBARWINDOW, (HMENU)IDC_TOOLBARSYNTAX, GetModuleHandle(NULL), NULL);
SSMAIN_PWSBUTTON = CreateWindowEx(WS_EX_TRANSPARENT, "static", NULL, SS_BITMAP|TBSTYLE_TOOLTIPS|SS_NOTIFY|WS_CHILD|WS_VISIBLE, 50, 50, 32, 32, hwnd, (HMENU)IDC_PWSBUTTON, 0, 0);
SSMAIN_TOOLTIP = CreateWindowEx(0, TOOLTIPS_CLASS, 0, WS_POPUP|TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, 0, SSMAIN_HINSTANCE, 0);
Now for some reason after SSMAIN_RTFCONTROL=CreateWindow("RICHEDIT","... when I display cout<<"CREATE 300:"<<SourceStudioConfiguration.error<<endl<<endl; the text is all random text. Now if I used the same thing before SSMAIN_RTFCONTROL=CreateWindow("RICHEDIT","... it will display correctly like it should.
My question is why is it doing that?
Also if I ignore SSMAIN_RTFCONTROL=CreateWindow("RICHEDIT","... as comment it will work like it should but then after some more lines on the cmd window it will display as random text again.
Is there something going on that I don’t see? Like too much info going on where it start to mess with the error space and maybe setting something within it and it shouldn’t?
Also as far as I can remember I didn’t have this problem before I reinstalled my os.
Thanks and I’m really confused about this and if you need anymore info let me know and I’ll post them
Also guys I tried to format the code by applying spaces like it said, but at times it doesn’t allow any spaces in front of the line and other times it does so I don’t know what’s up with that.
ok guys here’s the solution even though I don’t know why if that makes any sense…
Noticed that I added a variable string errordesc and assigned the source stream to that, then assigned errordesc to error