|
Eastdragon wrote:
How does it work?
By the simple and yet magical principle of snake oil.
Translation: It does not work.
|
|
|
|
|
But I used Windows Task Manager, I found the available Physical Memory really increased after Hare's defrag.
Why?
Let's roll!
|
|
|
|
|
what I know, some of these software tries to allocate a big blob of memory forcing windows manager to swap unused or less used memory pages to the swap file, which should teoretically make more physical space for the more active applications.
|
|
|
|
|
I have overriden the OnPaint function and I am using InvalidateRect to do some custom work in a section of the dialog. Is there any way to create the dialog so I have control over OnEraseBackground (there is none in the Class Construction - as far as I can tell) and can prevent the flicker. I know about double-buffering and I am basicly doing that but I am still getting a noticable flicker - I think because I cannot control the erase procedure. Thanks for any information.
|
|
|
|
|
|
Thanks for trying - but there is no WM_ERASEBKGND handler listed in the Class Editor - So I am guessing it will not operate properly without some extra work. OnEraseBkgnd is present in CWnd, CDialog base class, so it is a possibility.
|
|
|
|
|
You can add it yourself. In the class editor change the filter to Window and WM_ERASEBKGND will be in the list. I just tryied it with a blank dialog app, set a breakpoint in the OnEraseBkgnd() handler and it got there with no problem.
John
|
|
|
|
|
Hi i have a dialog box where i have enabled the scroll bars by using the horizontal and vertical scroll bar check boxes in the dialog properties box
my question is how do actualy get the scroll bars so i can control them etc
thanks
|
|
|
|
|
Hi,
I have enabled editing of the labels on the tree control and I want to see what user has edited in the label in the
OnEndlabeleditTree () function, so that I can either commit the change or, reject the change.
what should I use the check the user input in the label?
code:
void CGeneratorView::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
HTREEITEM hItem = pTVDispInfo->item.hItem;
if () //check edited text ?????????????????????????????
{
*pResult = TRUE;
}
else
{
*pResult = FALSE;
}
}
|
|
|
|
|
pTVDispInfo->item.pszText has the text, but if the user canceled the editing then it will be NULL. So you might do something like:
<br />
LPCTSTR lpszText = pTVDispInfo->item.pszText;<br />
if (lpszText != NULL && IsValidText(lpszText))<br />
{<br />
*pResult = TRUE;<br />
}<br />
else<br />
{<br />
*pResult = FALSE;<br />
}<br />
where IsValidText is some function you write to check the edited text.
|
|
|
|
|
from the code from MSDN i was able to open Excel and write to it. I would like a few more changes which I am not very sure as to how to implement .
1. How do i provide a fileName at the beginning instead of creating a new one and add data to a file . As of now I am creating a new WorkBook like
Workbooks books = app.GetWorkbooks();<br />
_Workbook book = books.Add(covOptional);
I want to be able to open an xls file as the current workbook and make changes to it !
2. I have a scenario where I have a lot of dynamic data in a tabular format(in a Grid control) in my Vc++ dialog application .I realise that I need to have a safearray , poplulate it with the data I need and then tie it to the range .
Do I have to precalculate the range that I am gonna be writing ? If yes then do I always need to Get a range using excel notation like
A-F ,AA-Af , BA-Bf and so on . That means that i might have to have some kind of mapping between my tables column number to the excel notation . Any efficient ways of doing this in case there is no other way out ?
if not i assume i can specify the range as absolute column numbers starting from 0 till the count of columns in the table i wish to export .
please advise .
|
|
|
|
|
1. The workbooks collection has an 'Open' method, as well as 'Add', which takes a number of arguments, many of which are optional.
Something like
_Workbook book = books.Open(COleVariant("file.xls"),covOptional,COleVariant(0));
should do the trick to open a given file. The second arg is whether to update links, the third is the readonly argument. You need to look at the VB help for the Excel object model.
2. To an extent, you'll need to calculate anyway to make your safearray the right size. You can specify the range as absolute column numbers anyway, but something like this will convert to AZ notation...(make sure result points to a big enough buffer)
<br />
TCHAR* RCtoString(long row, long col, TCHAR* result)<br />
{<br />
if (!result) return result;<br />
if (col > 26)<br />
{<br />
_tsprintf(result, _T("%c%c%d"),<br />
_T('A')+(col-1)/26-1,<br />
_T('A')+(col-1)%26,<br />
row);<br />
}<br />
else<br />
{<br />
_tsprintf(result, _T("%c%d"),<br />
_T('A')+(col-1)%26,<br />
row);<br />
}<br />
return result;<br />
}<br />
Hope this helps...
Steve S
|
|
|
|
|
Thanks for all ur answers.
I ve already tried to use another PC heaps of times, (and send everything to the hyperterminal). The communication between the hyperterm and the PC definitively works, I can receive/send data from/to the hyperterm.I ve also tried to use a sniffer when the hyperterm is connected to the external device and then compare with what my prog sends to this external device. And ..I send exactly the same apart from setmask and waitonevent. But I do not think it makes any difference since the hyperterm uses an overlapped communication .
I ve tried, as well, to use the acivex control provided by Visualc++ (MSCOMM32.ocx) and a couple of other activex controls found on the web.
Can it be something at a lower level ?Like something wrong in window for instance?
Thanks
sysy
|
|
|
|
|
I have been painfully supporting NT 4.0 using VC6 in many of my in-house projects. We are upgrading so that everyone will have at least Win2k. I know I can define _WIN32_WINNT 0x0500. My question is will this cause me incompatibilities with MFC or other libs? I know there is an article on this site here[^]that talks about a problem with MFC and CFileDialog but it is 3 years old and I am not sure that it is accurate.
John
|
|
|
|
|
Microsoft has not made any significant change to MFC. Other libraries really depends on what you actually are using.
|
|
|
|
|
There have been significant changes to some parts of MFC in VC7, CString for instance used to be reference counted in VC6, but is now an extension of basic_string in VC7. I think the upgrade to VC7 is much more frightening than the OS upgrade because a lot of compiler changes have been incorporated. Everything is manual, even memory leak detection has to be implemented manually, by dumping the leaks at the appropriate times for each project. Other than that you should have now problem specifying 0x0500 flag because 99% of all compiler version checking uses if(_WINNT >= blah) so if it compiles on NT 4.0 using a lower bit flag it'll compile on the Win2k .
|
|
|
|
|
*now problem*, bah, meant NO problem.
|
|
|
|
|
In my MDI MFC app, I have a status bar pane that shows the current line number and column number. I know that to get the current line number, I simply do: int lineNumber = LineFromChar( -1 ). But I am having trouble getting the current column, anyone know how to do this? It shouldn't be too bad.
|
|
|
|
|
I believe something like this would work. If ctrl is your control and lineNumber is the current line number:
<br />
int GetColumn(int lineNumber)<br />
{<br />
long start, end;<br />
ctrl.GetSel(start, end);<br />
<br />
return (start - ctrl.LineIndex(lineNumber));<br />
}<br />
|
|
|
|
|
Which is the most efficient way to restart my dialog box application, I mean to close the application and to start it again immediately after that.
|
|
|
|
|
Hmm if design allows, I would hide all dialogs visible, spawn a new instance of the application and then finish the original instance. For user it will look the same, only problem can be in accessing shared resources (disk file or whatever) but you can take a care about that.
|
|
|
|
|
Is it possible to run a CGI program in a web server from a C++ client application?
TIA
Carlos
|
|
|
|
|
That depends... is IE or Netscape written in C++?
|
|
|
|
|
Anonymous wrote:
That depends... is IE or Netscape written in C++?
What???
Do you think that will help to answer my question?
Carlos
p.s. both IE/Netscape are written in C/C++
|
|
|
|
|
you asked ... "Is it possible to run a CGI program in a web server from a C++ client application?"
IE/Netscape are client applications that send request to web servers. Sometimes these request result in the web server executing a CGI. So I guess maybe that the answer to your question is YES.
|
|
|
|