manwhile the problem was solved
Thomas Blenkers
Posts
-
German based MFC help on memory leak. -
German based MFC help on memory leak.There are distinct reasons I ask for Germany based help. It's not just the comments but also I assume that there will be the need of some in-lab testing with a real instrument connection. The memory leak is not depending on that and also there in the demo mode. IDE has evolved. The project started with MSVC 6 but the changes introducing the leak came somewhat around the change from MSVC 2005 to MSVC 2010. Don't have the actual project size but will post when I'm back in Office. We know that we will need and have a budget for the advice. Regards Thomas
-
German based MFC help on memory leak.Hi Albert, the code has of course some comments. They are mixed german and english. I'd say that all the key points have comments (but as always :) ) there could be more. Best regards Thomas
-
German based MFC help on memory leak.Hello everybody, in our business we have developed a realtime instrument control application. It was written in MSVC Prof. with C++ as a multithreaded modular MFC Doc/View application. The main program with the intrument interface was changed recently to reflect some changes in the intrument controller which was changed from running as DLL to being a service utilizing memory mapped files. Unfortunatly since this change our application is slowly eating up memory. After some weeks the application will hang or crash. We've already invested much time isolating the error with CRT diagnostic and other techniques but were not able to locate the source of the problem. We are looking for german based help on this issue. Anyone feels tempted or knows where to ask for help? Regards Thomas
-
CEdit SetSel and ScrollingNibu, once again, thanks and great work. This will work as long as indeed I choose to select all of the edit box. In my real application I'm doing some autocompletion so I want a first part of the edit text not selected while my recenty added text is selected. Maybe its my fault that my given lines of code were too much siplified to express this contraint. If you have further ideas, I would be really happy. Regards Thomas
-
CEdit SetSel and ScrollingThanks, Nibu, yes I do read docs before asking ;) The third parameter is called bNoScroll and according to the docs it should scroll or not the caret into view. But this is not the point, since I tried both versions. Both get the same result: the edit box is completely selected with the end portion of the text being shown. My guess is that the problem lies in the line of code before the SetSel: CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1); pEdit->ReplaceSel("This is some long and rather useless test text"); pEdit->SetSel(0, -1); pEdit->SetFocus(); The ReplaceSel will put the caret to the end of the edit windows and scrolls the text to the end. Already I have played around with the edit box scrolling functions to no avail. As I said, its making you gray hairs! Regards Thomas
-
CEdit SetSel and ScrollingHello everyone, this is a sounds-so-simple gray hair maker. Please help out: A single line edit control on my dialog contains So far nothing complicated. Now: On an event I would like to add some long text at the cursor position, give the edit box the focus, select the whole text of the edit control ***AND** I would like to see the beginning of my long selected text ... CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1); pEdit->ReplaceSel("This is some long and rather useless test text"); pEdit->SetSel(0, -1); pEdit->SetFocus(); The problem is that the SetSel scrolls the edit box to the end of the selection. Is there a way to scroll to the beginning without loosing the selection? If you know the length of the selection, you may do both .SetSel(Start, End) or .SetSel(End, Start) but always the caret and the scroll will be at the end of the selection. WM_HELP Thomas
-
Where is VS.NET hex editor?Russell, :wtf: thank you very much. It's pretty good hidden, isn't it? Thomas Blenkers
-
Where is VS.NET hex editor?Hi folks, it finally got me - I've switched to vs.net, although still using the MFC... For the one or the other reason I've opened several different files (*.exe, *.jpeg, *.zip, *.whatever ...) with the Visual Studio 6 IDE hex editor, simply by specifying "open as binary" in the file open dialog. Is this option is gone in VS.net, or have I missed something. If I try to open a file now, VS seems to use ShellExecute, because depending on the file type the default program starts. So opening a *.chm opens the html help viewer, jpg goes to my paint program etc.... How to open these files in VS.net in hex mode??? Thomas
-
VB & International Number FormatHi folks, I'm rather inexperienced with VB, but since this is pretty easy with VC, I hope some of you gurus out there has done it before or has a hint. Think of a calculation, where you have a result of, 3/4 = 0.75 If I simply use the code ResultWindow = 3/4 the VB form will display "0.75" as desired. BUT: some languages, including German, use a different format, the figure above should be written "0,75" Speaking Windows, I'd rather get and put the number format as specified in the control panel. Anyone has an idea to do VB excatly this? Thomas BTW: for VC, this piece of code in OnInitInstance does all the job: setlocale( LC_ALL, "" );
-
Insert property page after pr.-Sheet created?Joaquín, thank you, that was the right trick. Once the property page has been created (OnInitDialog is done) you cannot RemovePage it and reuse the same object instance. Thomas
-
How move a CListCtrl item?!When you are in Report mode, something like this SwapRows function should help: void CMyListCtrl::SwapRows(int row1, int row2) { // rowText will hold all column text for one row CStringArray rowText; LV_ITEM lvitemrow1, lvitemrow2; int nColCount = GetColumnCount(); rowText.SetSize( nColCount ); int i; for( i=0; i < nColCount; i++) rowText[i] = GetItemText(row1, i); lvitemrow1.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_STATE; lvitemrow1.iItem = row1; lvitemrow1.iSubItem = 0; lvitemrow1.stateMask = LVIS_CUT | LVIS_DROPHILITED | LVIS_FOCUSED | LVIS_SELECTED | LVIS_OVERLAYMASK | LVIS_STATEIMAGEMASK; lvitemrow2 = lvitemrow1; lvitemrow2.iItem = row2; GetItem( &lvitemrow1 ); GetItem( &lvitemrow2 ); for( i=0; i< nColCount; i++) SetItemText(row1, i, GetItemText(row2, i) ); lvitemrow2.iItem = row1; SetItem( &lvitemrow2 ); for( i=0; i< nColCount; i++) SetItemText(row2, i, rowText[i]); lvitemrow1.iItem = row2; SetItem( &lvitemrow1 ); } WM_HOPEITHELPED
-
Insert property page after pr.-Sheet created?Joaquin, thank your for your quick suggestion :rose: . The page in question *is* the last one on the sheet, but it won't work: CMyPropertySheet::OnSomeMessage(......) { RemovePage(&m_myPage); AddPage(&m_myPage); } The RemoveMessage function destroys the property page, and AddPage isn't enough to have the page created: I get an empty property sheet, all controls on it are not visible/created :((
-
Insert property page after pr.-Sheet created?Hi folks, my newest, coolest :) app uses a property sheet to expose some settings. Due to an action in one page (or s.th. like apply button in the sheet itself) I'd like to insert/remove an other property page. I'd be good also if there is some way to hide (and display) a property page ... Thanks for your help! Thomas
-
Modeless Dialog / AcceleratorsHello, in my MFC app I'm using a modeless child dialog to display some extra information. When the input focus is on the modeless dlg, the accelerators of the main app are not working. What to I do to make things better? Thomas
-
Printing a long documentHi folks, I've created a cool doc/view app which will print several pages, w. page preview and all that stuff. Problem is, that if I have to print a long document (having more than about 11 to 12 pages) the printing goes nuts: Page 13 overlays page 1, 14 is over 2. When there are more than about 24 pages, I get three pages over each other. This happens under Win ME. Under Win2000 it works fine. I assume that it has s.th. to do with the int's in the windows API and the 32 bit border (hence 11 pages is about 32800 tenth millimeters...). Has anybody run into the same problem? And how did you solve it??? CU Thomas
-
Simple member function questionStephen, you're thinking too plain C... You define a class A having a member function (also called method) member_function. Your calling_function will call a function member_function having on the global namespace, which doesn't exist. This will work: .... A myInstanceOfA; myInstanceOfA.member_function(); .... Or, if you have *very good* reasons to have static functions in your class: class AA { public: static void static_member_function(); }; then this will work also: .... AA::static_member_function(); .... Thomas
-
Feedback form with referenceHi anyone! I would like to create a feedback form which includes the reference of the web page which leaded to the form. The first part could be a scriplet like this <!-- document.write('<a href="feedback.htm?linked='+location.href+'" >Give us you feedback!</a>'); //--> This creates a link on the refering page. What can I do to retrieve the part after the qestion mark? Thx Thomas
-
CListCtrl & LVS_EX_HEADERDRAGDROPHi forum, Questions: Does anyone know how to retrieve the actual column arrangement? Does anyone know how to do the drag/drop-operation programmatically? Underlying concept: I know that with a cole like this you may enable Drag & Drop Column arrangement in a CListCtrl: DWORD dwStyle = List.GetExtendedStyle() | LVS_EX_FULLROWSELECT | | LVS_EX_HEADERDRAGDROP; List.SetExtendedStyle(dwStyle); This is not only cool, it even works fine (if IE4 is installed). Now I would like to save the column arrangment for a give CListCtrl to enhance my user interface.... (see questions) Thanks for any ideas!!! Thomas