msvcr70d is obviously a debug library. I wonder if he tried to build a release. ;) Sincerely yours, Ilya Kalujny.
Ilushka
Posts
-
DLL Hell Going From Win2000 to XP -
Problems with WM_VSCROLL PostMessageDo exactly as you`ve been told, and mind that the SB_PAGEDOWN could be used too. Sincerely yours, Ilya Kalujny.
-
Why use Multi-thread Servers?forget window-message notification for a number of users up 100. It`s going to kill you machine ;) Sincerely yours, Ilya Kalujny.
-
run an executable located in a memory bufferrough :) Sincerely yours, Ilya Kalujny.
-
Help on List ViewYou can set a column name via numerous different ways - starting from filling LVITEM structure and sending a message to control. Anyway: all those ways use something like "iSubItem" - and thats the number of column to accomodate the text. Dont have MSDN by my hands - take a look there. Sincerely yours, Ilya Kalujny.
-
TCP/IP QuestionThats simple. :) Send expects a [long constant pointer to TCHAR] variable, so just putting somthing of type byte isn`t right. still, the second parameter of .Send is a length of data to be sent, thats it in TCHARs. So make it that way: Suppose you have a BYTE g_aBytes[1024]; filled with some interesting bytes and you want to send 651 of them. just make a call like that: iSent = m_sConnectSocket.Send((LPCTSTR) g_aBytes, 651); here you do s old-style C cast from array of bytes to LPCTSTR. Also you expicitly tell the socket how much data you`d like to send. That`ll do the trick, unless you dont use UNICODE. :) In general , from your post i see you`re not much expirienced in C++ programming. I recommend some serious reading - for example Bjane Stroustroup C++ programming language third edition. Be good, Sincerely yours, Ilya Kalujny.
-
C++ Function objects - how to use them?Hi All! Here goes the question: Mr. C++ has cleary descibed how to use function objects in Parhagraph 18.4 of his Book. The Sample code works OK, and if i use them with STL, everything`s OK Here is a simple sample: void Add7(int& out_Int) { out_Int += 7; } class AddNumber { public: int m_iToAdd; AddNumber(int in_iToAdd = 0) { m_iToAdd = in_iToAdd; } void operator()(int& out_Int) { out_Int += m_iToAdd; } }; class A { public: std::vector < int > m_vData; }; void main() { A tmp_a; tmp_a.m_vData.push_back(7); tmp_a.m_vData.push_back(5); tmp_a.m_vData.push_back(6); std::for_each(tmp_a.m_vData.begin(),tmp_a.m_vData.end(),Add7); std::for_each(tmp_a.m_vData.begin(),tmp_a.m_vData.end(),AddNumber(13)); } --- But when i try to use them some other way than in combination with STL, I get that: typedef void (*TraveseFuncPtr) (int&); void Add7(int& out_Int) { out_Int += 7; } class AddNumber { public: int m_iToAdd; AddNumber(int in_iToAdd = 0) { m_iToAdd = in_iToAdd; } void operator()(int& out_Int) { out_Int += m_iToAdd; } }; class A { public: std::vector < int > m_vData; void TraverseVector(TraveseFuncPtr in_func) { for (int i = 0; i < m_vData.size(); i++) { (*in_func)(m_vData[i]); } } }; void main() { A tmp_a; tmp_a.m_vData.push_back(7); tmp_a.m_vData.push_back(5); tmp_a.m_vData.push_back(6); tmp_a.TraverseVector(Add7); // All ok. tmp_a.TraverseVector(AddNumber(13)); //C2664 } --- And thats it. error C2664: 'TraverseVector' : cannot convert parameter 1 from 'class AddNumber' to 'void (__cdecl *)(int &)' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called I tried to dig up STL source but hell the same for_each takes a CLASS (!) as a template parameter. No functions there. Who can say anything to this? Sincerely yours, Ilya Kalujny.
-
Need a hint on implementing path picker WTL control.Yeah, but isnt it modal? When i try to use it like this: BROWSEINFO bi = { 0 }; bi.lpszTitle = _T("Pick a Directory"); bi.hwndOwner = m_hWnd; LPITEMIDLIST pidl = SHBrowseForFolder ( &bi ); if ( pidl != 0 ) { // get the name of the folder TCHAR path[MAX_PATH]; if ( SHGetPathFromIDList ( pidl, path ) ) { } // free memory used IMalloc * imalloc = 0; if ( SUCCEEDED( SHGetMalloc ( &imalloc )) ) { imalloc->Free ( pidl ); imalloc->Release ( ); } } I Get a modal dialog that is definitely not what i want :( Well, if only i had a possibility to modify that dialog somehow (ie. insert my onw controls and write according handlers) that would be nice, but how?? More hints pleaaaase :) Sincerely yours, Ilya Kalujny.
-
Need a hint on implementing path picker WTL control.Subject. :) I just cant think of where to start from. I guess i should inherit WTL CTreeViewCtrl, and add functionality for parsing computers directory tree. So would you be so kind to give me links to samples of doing that? Any help would be appreciated, thanks. Sincerely yours, Ilya Kalujny.