Sorry forgot the link: http://www.codeproject.com/tools/HeaderDocumentor.asp[^] GSte
G Steudtel
Posts
-
Documentation in VC++ -
Documentation in VC++Hi, probably you might try this one? GSte
-
OnRButtonUpHi, The problem is, prior of catching the button up message the button DOWN message must be handled!. What you do, is catching all down messages, because when the mouse button is released your button provides the only handler for UP messages. I know it's weird. But best is to react on the down message, setting a flag and in the UP handler do any action only if the flag is set. And always rest the flag. GSte
-
CDC::BitBlt(...) - strange speed variationshi again, Looks like we found the nasty guy. Page misses. Everytime you make the picture larger a new block of memory must be allocated. If the RAM is low, than a part of the memory must be swapped to the memory file on disk (aka swap file). And that's what takes so long. Only solution so far ( And I mean this serene) lots of RAM, RAM, RAM. How can I tell? You see, the first allocation gets swift. When you increase the picture size, the system will allocate a block of memory a liitle bit larger than needed. That makes the second enlargement pretty fast. The third enlargement must be reallocated again (slow). And so forth. Probably (I don't know for sure) you can preallocate a reasonable (lets say 1600*1200) amount of memory prior BitBlitting the immage the first time. That way by enlargening a smaller picture needn't to be reallocated until it exceeds the size of 1600*1200. But I don't know how this could be done. Maybe a code like this will work. Avoid flickering -- Disable Output BitBlitt(1600*1200) Enable Output BitBlitt(1280*600) BitBlitt(1280*610) and so on. How to en/disable painting the image depends. There are several functions for this purpose. Regards. Please referr to you most likely base class reference. Regards GSte GSte
-
CDC::BitBlt(...) - strange speed variationsHi, Sorry that I didn't make it clear. Those were not questions but hints, what you should ask. Like, are there page misses, so the system as to relad memory from the swapfile. Is any process eating up CPU-time by atomic instructions (anti virus software/ multimedia player). If your using W2000 try to shut down most processes you can, to get the time measurement more reliable. See if there is a pattern in the time frame, like every third or fourth call is aout of order. I can't give you a solution, but just a few hints how to track the problem. And if anything fails, use your imagination. I once had a similiar problem and a wrongly installed outlook proofed to be the trouble maker. Regards GSte -- Even dwarves were born small --
-
can we create a rich colored icon for VC?hi, you can, but not with resource editor supplied with VC. GSte
-
CDC::BitBlt(...) - strange speed variationsHi, OS? probably not really multitasking and hanging in another process. Sytem clean up? Kind of magic numbers? Swapfile operations? GSte
-
Funny picture needs a title (3)Sticking the head down under GSte Even dwarves were born small
-
does OnCtlColor work for buttons?Hi, I can vaguely remember, that I also tried to use OnCtlColor a century ago. As far as I can remember, the only colour I cold change was the text colour of that button. Regards GSte
-
THREAD PROBLEM- PLEASE HELPHi as I don't know the context and what you try to do, I just may guess. I see two problems. The minor one being the HANDLE to an event of beimg volatile. That means everytime your loop is executing the Handle will be retrieved anew. To my opinion it should not change throughout the lifetime of the thread. The real big problem is Sleep(1). You have an infinite loop, that means that the programlines are executed over and over again, with just a millisecond sleep at the end. Try switching the number to 500 or so, to give the CPU more time to execute other threads/programs. Or try to avoid the loop. Regards GSte
-
Database Application PerformanceHi, probably instead of using mysql_store_result you should using mysql_use_result. It will give you a boost, but also a lot of drawbacks. See the C-API documentation for that. GSte
-
RegQueryValueEx + DWORD problemHi, The problem is in typcasting. It is right to cast the type into a pointer to byte (LPBYTE) but then you have to provide the adress of your DWORD variable too. Also keyValue must be of type DWORD. Like:
DWORD dwType,dwLength,keyValue; ... RegResult=::RegQueryValueEx(SrcKey,strKeyName,NULL,&dwType,(LPBYTE)&(keyValue),&dwLength);
You may not use a TCHAR buffer array for this purpose. I couldn't find a way to cast this in a DWORD.;) Regards G. Steudtel -
Use of the Keyboard's eventsHi, for this edit box you have to catch the WM_GETDLGCODE message, telling it that you want DLGC_WANTALLKEYS. In your WM_KEYUP handler you must look if the user pressed the enter key and than act accordingly. In any other case you should do the default action. Regards G. Steudtel
-
How do you remove focus from a listbox manually?Hi, I once had a similiar problem within a tree control. My solution was to make a boolean variable (bDoubleClicked) which was initially set to false. When the user double clicked an item I just set this variable to true and remembered what he/she choosed. My actual action was taken on the mouse button up message. By looking if the user had double clicked I performed the task. In any case bDoubleClicked was set to false again. The problem was that the mouse action was bound to the tree control and not released until the button up message arrived to that control. I think you should use this method for your problem too. Hope this helps. Regards G. Steudtel
-
Accessing Protected Functionswell, look for the header file and move the method to the public part. Probably you have to go up the whole 'pedigree'. Derive a class from that class you want the function and in that class you have access to the protected function. First method is to handle with care, second method sometimes is just kind of overkill. Regards G.Steudtel
-
Help in Generating ReportsHi, well, never mind in the last century I was in the same situation. But to tell in detail what you should do and not would be a lengthy excursion by space and by time. I have written an article "Documenting header files" and posted it here at codeproject [^]in the source code you will find a method to put some datas into strings and display and print them. The same method is also used to store the datas. If you download the source files have a look at the BeginPrinting OnPrint functions in the ViewHeaderDocumentor.cpp file. The other parts of interest are in DocHeaderDocumenter the OnSave... routines and the MakeOutput... routines. Those routines call other (helper)routines until a CStringArray is filled. I guess it will take a couple of hours until you get an idea of how it's working, but i will. Regards G. Steudtel
-
how to set the height of a truetype font ?Hi, Sorry that I made it too short. Off course if you take a smaller value you get a smaller font. The fault is by me for not thinking any further. Two approaches: 1) In a loop increase the height of the font until tmAscent becomes 10. 2) HcarFormFont = INeededHeight*Metrics.tmHeight/Metrics.tmAscent; with iNeededHeight being a constant of 10 ( or what ever height you need). I'm not so sure about the calculation but the ratio of height to ascent should be the factor to increase the height of the font. Also you should do some casting to double and back to integer to minimize rounding errors. But basically the second method seems reasonable. Regards G. Steudtel
-
Help in Generating ReportsHi, probaly the easiest approach is before saving your data, you transform the data into a CStringArray. That is for every data you need report you transform this data into a textual representation (CString) and add it to the array. Then you may store the array into a file. If you take care that a line is not too long, then you may also print that array line by line. Do a heighth calualtion and divide the paper length by this height to get the number of pages to print. Your application framework should alredy have the appropriate Print(Preview) functions installed. If you do NOT want to select File New, rename it. Regards G. Steudtel
-
how to set the height of a truetype font ?Hi, I far as I can remember there is something like a negative height. When the height in the logfont structure is positive it is the height with the leading, when the height is negative it the cell height. But I do not know if it's just the ascending or the ascending+descending. I vaguely remember that the TEXTMETRICS structure has members for ascent descent and so on. So for your code the line HcarFromFont = Metrics.tmAscent should do what you need; Regards G. Steudtel
-
XML Beautifier.Hi, I don't know about a beautifier, but have a look at www.firstobject.com, there will be an inexpensive (no cost) xml editor. Regards G. Steudtel