I tried that but no change. In fact, the toolbar gets wrapped when the size is too small, but it wraps to maximally 2 rows for me, although I call SetRows() with higher argument. Thus I think I'll have to get rid of it by writing my own code for wrapping the toolbar, since I haven't found any example on the web which uses toolbar wrapping for docked toolbar :sigh:
s_k
Posts
-
Wrap toolbar to keep all buttons visible -
Wrap toolbar to keep all buttons visibleHi all, I'm really tired of looking for the solution of this annoying problem: I have MFC application with CToolBar. In fact, I have CReBar and two CToolBars in it. I display few buttons with text in these toolbars (in single line). When user changes the size of main window and the width is not enough, I want toolbar to automatically wrap to more rows so that all buttons stay visible. I don't want to use chevrons or floating toolbars. I create my toolbars with TBSTYLE_WRAPABLE and I tried to call SetRows(...), but it had no effect. Yes, it created as many rows as requested, but all buttons stayed in the first row even though if the size was too small to show them all. Thank you all for any suggestion.
-
Is there any difference between transmitting plain text/binary data?Thank you RadioShark, that's very useful for me. Anyway I have couple of questions: 1) In source code of some network applications I've seen that before sending the data over socket, "\r\n" and '\0' was added to the data. Why? It is not neccessary, is it? 2) I have read someting about special characters, that could confuse modem when they are about to be transmitted. In other words, modem would probably consider them to be some special commands or what...Is it true? Thank you.
-
Is there any difference between transmitting plain text/binary data?Hi all, it makes me wonder if there is any difference between transmitting plain text/binary data over a socket. The main reason I think about it is that binary data can contain the whole range of ASCII characters, including some special characters (eg. 0x00 - NULL character). And I'm curious, whether any of these characters can cause any confusion when they're being transmitted. For example, when I'm developing some network application, can I ignore the character of the data which I want to transmit and can I use the same code for sending both types of data (plain text / binary data) ? Could somebody clarify this to me? Thanks.
-
Problem with reading from Socket using CArchive::Read()Hi all, I have client application and server application (FTP server / client). On client side, due to certain reasons, I use CArchive to write / read data to / from socket. On the server side I use CSockets to send / receive data. It worked fine for me, but now I implemented encrypted communication (Twofish cipher) and want to exchange the data safely. When I send encrypted data from client to server (ie. CArchive::Write()), it is ok. But when I use CSocket::Send() to send encrypted data from server to client, on client side the call of CArchive::Read() doesn't return and after a while it throws CFileException (OS Error it says). My method for sending encrypted data from server to client is the following: [CODE] DWORD dwToAllocate = CTwofishCipher::getPaddedSize(strlen(s) + 3) + TC_BLOCK_HEADER_SIZE; BYTE* encryptedData = new BYTE[dwToAllocate]; memset(encryptedData, 0x00, dwToAllocate); encryptAnswer(stringToSend, encryptedData); pControlSocket->sendEncryptedString(encryptedData, dwToAllocate); void CMyControlSocket::sendEncryptedString(BYTE* encryptedData, INT dataLen) { CSocket::Send(encryptedData, dataLen, 0); } [/CODE] And the code of client for receive encrypted data is here: [CODE] BYTE* receivedData = NULL; UINT nBytesRead = 0; TRY { receivedData = (BYTE *) m_retmsg.GetBuffer(32000); nBytesRead = m_pCtrlRxarch->Read((TCHAR*) receivedData, 32000); m_retmsg.ReleaseBuffer(); } CATCH(CFileException ,e) { ErrorCode = e->m_lOsError; return FALSE; } END_CATCH [/CODE] The interesting is that when I check received data on client side (after it throws the exception after a while), the bytes received exactly match the bytes which had been sent. Anyway, the function CArchive::Read() has apparently some difficulty receiving the buffer. Thanks for any suggestion!
-
Problem with ListView in LVS_ICON and LVS_SMALLICON modeHi, I have ListView that shows files on local drives and want to let user select view mode. So application starts defaultly with ListView set to LVS_REPORT and when user selects another style of view, the proper style is set using following code: ModifyStyle(LVS_TYPEMASK,(LVS_ICON & LVS_TYPEMASK)); Or with LVS_SMALLICON instead of LVS_ICON when user wants to show large icons, of course. In report style everything is ok. But when I switch to LVS_ICON mode, it looks like on this picture (I took a screenshot of my ListView): ListView in LVS_ICON mode And, when I switch to LVS_SMALLICON mode, it looks like this: ListView in LVS_SMALLICON mode As you can see, first row is missing (but when I for example double click on that empty space, my program handles it correctly as the items would be there. I must also mention that the ListView I use has Custom Draw feature (so I handle OnCustomDraw()) and it is Virtual ListView (so I handle OnGetDispInfo()). I'm really out of my knowledge... Thank you for any suggestion!
-
How to make ListView's scroll absolutely without flickering - example includedHi, maybe I post my question in a wrong way - I AM able to scroll the content of my ListView, I have vertical scrollbar there and pressing Key Down/Up keys also scroll the ListView. But in case when I have for example 10.000 files in ListView and I'm holding Page Key/Up or moving fastly with scroll bar, ListView "flashes", or how to say that...So I'm looking for some method with help of which I would make my ListView scroll without flashing/flickering...And in post there is link to one piece of software that does it greatly. Best regards, Standa.
-
How to make ListView's scroll absolutely without flickering - example includedThanks Ryan! Now list of files is drawn, but for example column headers are not visible till I click on them. I'm using Custom Draw feature, maybe it has something to do with it...
-
How to make ListView's scroll absolutely without flickering - example includedThank you Ryan, it works. But, in fact, I don't know what to wirte into OnPaint() handler routine. I have just CListView that displays list of files on local drives and the only thing I wanted to achieve is to get rid of flickering while scrolling the content of ListView....
-
How to make ListView's scroll absolutely without flickering - example includedBut how can I then use CMemDC class, when it needs CDC pointer to be passed to constructor?
-
How to make ListView's scroll absolutely without flickering - example includedThanks for your suggestion Colin. Unfortunately, CMemDC doesn't work for my CListView-derived class. CMyView::OnDraw() is never executed and returning FALSE in OnEraseBackground() casues my ListView not being updated and look ugly...Don't you know why? Best regards, Standa.
-
How to make ListView's scroll absolutely without flickering - example includedHi all, I am trying to make my ListView (displaying files) scroll without any flickering. But I cannot get it work. I tried for example putting GetListCtrl().SetRedraw(FALSE) and GetListCtrl().SetRedraw(TRUE) around CListView::OnKeyDown() call if key pressed was PAGE DOWN or PAGE UP, but it made things even worse. For example this program does absolutely no flickers! http://www.altap.cz/ftp/salamand/salen200.exe Try scrolling eg. WINNT\System32 directory of any other directory with thousand of files with Page Down key held and you will see that. How is this possible??? I am using virtual ListView. Thank you for any suggestion!
-
Problem with ShowWindow() and losing focusHi, I have MFC application with splitter window that divides client area to two views, both are CListView-derived classes. Because I want to keep columns to have stable proportions all the time, I'm catching CMyListView::OnSize() and executing this code: void CMyFileView::OnSize(UINT nType, int cx, int cy) { int my_cx = cx; INT iWidth = 0; RECT viewRect; ::ZeroMemory(&viewRect, sizeof(RECT)); GetClientRect(&viewRect); INT iViewLen = viewRect.right - viewRect.left; CMultiColumnSortListView::OnSize(nType, cx, cy); // disable horizontal scroll bar GetListCtrl().ShowScrollBar(SB_HORZ, FALSE); INT iColWidth = 0; if (cx != old_cx) { GetListCtrl().ShowWindow(SW_HIDE); for (INT i = 0; i < (COLUMN_NUM - 1); i++) { iColWidth = viewRect.right * COLUMN_WIDTHS[i]; iWidth += iColWidth; GetListCtrl().SetColumnWidth(i, (viewRect.right * COLUMN_WIDTHS[i])); } GetListCtrl().SetColumnWidth((COLUMN_NUM - 1), (iViewLen - iWidth)); GetListCtrl().ShowWindow(SW_SHOW); } } old_cx = cx; } I call ShowWindow() in order to stop flickering, it helped. The problem is, calling ShowWindow() deselectes selected item (selected before with SetItemState()). I tried to call SetItemState() again after ShowWindow(SW_SHOW), but it doesn't work as expected, it highlights item, but it doesn't select and focus it 100% (it just draw grey rectangle aroung the item, but doesn't display dark blue rectangle which appears in normal case). Does somebody know what to do to select and focus the item again successfully? Thanks for any suggestion.
-
How to disable displaying "..." in column header when text is wider?Hi, I would like to disable displaying "..." suffix when text in ListView column header is longer that header's current width. For example Total Commander does it. Is there any way? Thanks in advance.
-
ExtractIcon() takes long time for some filesHi all, I've simple file manager, in which I display icons for EXE files using ExtractIconEx() this way: ExtractIconEx (pathToEXEFile, 0, &bigIcon, &smallIcon, 1); It works fine. But I also found EXE files, for which this function takes much more time than normally. One example of such file is RLUninstall.exe, located in WINNT directory. Doesn't some know how is this possible or how to bypass it? Thank you for any suggestion.
-
How to display "Properties" system dialog for multiple files?Now I trid to put NULL char between file paths and double NULL at the end of list, but it also doesn't work...
-
Access violation only in release build with debug infoYes, I understand now, that's what I thought could really cause problems...
-
Access violation only in release build with debug infoI don't understand. dwSize is just local variable. Its address (as passed to SomeFunction()) will be always valid, won't be? Of course SomeFunction() mustn't do something like this: TCHAR* s = new TCHAR[dwSize]; because dwSize was not initialized, but the code you posted itself is valid as long as I don't know SomeFunction() code...
-
Access violation only in release build with debug infoThanks Neville! Fortunately, AlexO has already found the cause of the problem - I have to call ::ZeroMemory to zero REBARBANDINFO structure. Never thought this may be reason for CWnd::FromHandlePermanent() to return NULL...
-
Access violation only in release build with debug infoIT WORKS!! I thank you so much! Anyway, if you answered me this question, I would be even more happy: How is it possible that neither in debug version nor in release version without debug info no access violation appeared? Maybe I would understand difference between debug and clean release version, but what the heck is difference between, we can say, two DEBUG versions? Thank you again, AlexO, I really appreciate your help!