|
hi all
with an mfc multi document interface windows application running on xp with many (several
hundred) mostly modeless form views i have encountered unexpected behavior with the
controls on the forms. for example when clicking a button to open a file open dialog, the
dialog gets instantly closed etc. adding more form views can crash the application.
is there a limit to the number of views or controls per application. each view in the application can have 20 controls so the total number of controls can exceed 250 * 20 => 5000
another behavior which may give some clues is that when adding above 5000 controls i.e. typically over 250 views, adding subsequent views becomes increasingly slow (the time taken for the view to be drawn on the screen)
any ideas how i can correct the unexpected behaviour?
thanks for any help
mike
|
|
|
|
|
You are probably hitting an upper resource limit on your PC. What you describe has happened to me in the past when I had very large number of views open. Also once when I had a resource leak (ICON) which was causing problems.
Why do you need so many views open at a time?
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
thanks for your comment. could you suggest how i could investigate a resource leak?
most of the views are hidden as they only very rarely need to be shown in order to change settings and most of the settings are set in advance and not presented to the user. many views belong to similar "building block" modules and are multiple instances of a few modules implemented as dll s.
|
|
|
|
|
mike.dibley wrote:
for example when clicking a button to open a file open dialog, the
dialog gets instantly closed etc. adding more form views can crash the application.
huh ... maybe there's a resource leak or memory leak somewhere that prevent the dialog being created; or ID conflict somewhere.
mike.dibley wrote:
is there a limit to the number of views or controls per application. each view in the application can have 20 controls so the total number of controls can exceed 250 * 20 => 5000
maybe there's a limitt for for controls visible at the same time ( or created at the same time, even if they are not visible )
(off-topic) I always find it strange that people create UI with tons of controls/forms at the same time, it must really be confusing for the users.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
thanks for your comments
most of the view are "hidden" ie visible set as false.
have you come across any tools for detecting memory leaks?
please see previous reply for the comment about the number of views presented to the user
|
|
|
|
|
How can the Thumbnail view be set for the Common dialog control either before or when the Common Dialog File view is loaded ? I would like users to see their image files as thumbnails instead of names only.
|
|
|
|
|
One direction seems to be to use the
Ifolderview::SetCurrentViewMode()
Has anyone used this and could they post some code ?
Regards
|
|
|
|
|
I have a peice of code here:
CFont* pFont = NULL;<br />
LOGFONT lfNav;<br />
<br />
pFont = m_cNextPg.GetFont();<br />
pFont->GetLogFont(&lfNav);<br />
lfNav.lfHeight = 30;<br />
_tcscpy(lfNav.lfFaceName, _T("Webdings"));
m_cBtn.SetFont(CFont::FromHandle(CreateFontIndirect(&lfNav)),TRUE);
You can try it out on this piece of code by paste this code in OnInitDialog(), and be sure you have a button..
My question is: Can I change the font type to "webdings"... How to do that?
THank YOu @!
|
|
|
|
|
hi guys, i hv a application which written in VC++. and it need to use a .sys file and 2 dll file.
is there any article related to how to make a setup which can automatically place these files in the system directory. ie: WINDOWS\SYSTEM32\Drivers
thank you in advance!!
|
|
|
|
|
To do it properally you need something like InstallShield/NSIS/MSI etc etc etc.
Personally, Id go for NSIS - free, poweful, and open source.
http://nsis.sourceforge.net/home/
If its just a simple app you could write one - but why bother when someone has done it for you.
|
|
|
|
|
Hi,
I am using multithreading.
Three threads call the same function say xxx(),these three threads will be doing some processing on the items in the listcontrol,all these three threads are running.
I need to delete a particular row from the list control,when specific requirement is met.
The listcotrol is feeded by the main thread.
Can u please suggest me the way to delete the items,as the deletion is not happening the expected way.i.e,some other row is getting deleted.
|
|
|
|
|
To handle this case, you should only have one thread that ever adds/deletes/modifies items in the list control. Normally this should be the UI thread. You r worker threads should post messages to the worker thread with information that identifies the item it needs to be actioned on. This way the UI thread can look it up correctly (even if its moved) and take the right action.
Roger Allen - Sonork 100.10016
Strong Sad: I am sad I am flying
Who is your favorite Strong?
|
|
|
|
|
check out www.infogist.com,download it and run.
You see that he is able to delete and add to the list simultaneously.
|
|
|
|
|
Anonymous wrote:
You see that he is able to delete and add to the list simultaneously.
Ok, but what does that have to do with other threads updating the UI? The only thread that should be accessing the list control is its owner. All other threads, whether they are adding or deleting, should be posting a message.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Each thread should post a message, indicating what item to delete, back to the primary thread that owns the list control. Any other way is not guaranteed to work.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have previously installed the platform sdk to a pretty dumb path.
I have cancelled the action.. but there were still some files in the directories. Tried to deinstall the platform sdk -> and then make a clean install:
pretty dumb, because it doesn't let you choose the path when installing the 2nd time.
So i tried to delete all the registry keys -> but it doesn't let you choose the path when installing the 3rd time.
Any ideas ?
"Just looking for loopholes." W. C. Fields American actor, 1880-1946, explaining why he was reading the Bible on his deathbed.
|
|
|
|
|
If you didn't successfully uninstall the platform SDK then I suggest this.
1) Install the SDK fully over the top to the directory it insists to install to.
2) Uninstall the SDK, this should now succeed.
3) Install the SDK to the directory that you want.
Hope this helps
Ant.
|
|
|
|
|
If I try to use pipe to run coomands through command.com, the program does not return even after the command.com has finished writing to the pipe. The ReadFile() function simply waits there for input on windows 98. This code is running fine on windows 2000. Does Anybody have any solution?
The part of code where the execution stops responding is:
while(1) {
succ = ReadFile(hReadPipe, buffer, sizeof(buffer)-sizeof(char), &nread, NULL);
//****** it waits here after reading all the op from the pipe***********//
if(nread == 0)
break;
buffer[nread]=0;
fwrite(buffer, strlen(buffer), 1, fp);
}
if(nread) {
buffer[nread]=0;
fwrite(buffer, strlen(buffer), 1, fp);
}
fclose(fp);
DWORD err = ::GetLastError();
::CloseHandle(hReadPipe);
Can anyone help ???
|
|
|
|
|
Have a look at this[^]. You need to use duplicate handle and close your end of the pipe, otherwise your child process will hang.
Ryan
|
|
|
|
|
Hi
Anyone Know how to change the border style of a listbox at runtime...That means when listbox is non-active, the border is not bold but it is in focus, the border is darker to indicate to the user...
I tried to use getwindowlong and setwindowlong but i am unable to set it properly..maybe i miss some APIs..
Thanx.
|
|
|
|
|
Like:
GetDlgItem(IDC_LIST1)->ModifyStyle(0, WS_THICKFRAME, SWP_DRAWFRAME);
If you say wanted to turn on WS_THICKFRAME at runtime.
Or
GetDlgItem(IDC_LIST1)->ModifyStyle(WS_THICKFRAME, 0, SWP_DRAWFRAME);
To remove
|
|
|
|
|
Hi all
I get a some complcation here:
template <class t=""> void fun(..)
{
...
switch (typeid(T))
{
case (typeid(char)):
....
break;
}
...
}
/*
This snip of code brought a compiler erro
1) typeid(T) - return const type_info& value and
this inconsistent with switch(...) - expression type
2) case(...) - expression in brackets should be const but in this case
its const referience[const type_info&]
I cant do an casting here because of type_info constructor
private.
*/
...
}
Can i avoid this error ,or i had to use if() statement,in this case.
THANKS
|
|
|
|
|
You can only switch on integral types - char , short , int , long (and their unsigned variants) and enumerated types.
You'll have to use an if statement in this case.
If you have to modify your processing based on the template parameter, then I don't thing you're really understanding the concepts of using templates. Read some articles or books on templates, particularly on partial template specialisation. "Modern C++ Design" by Andrei Alexandrescu is an extremely good book for learning about templates in depth.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
HI all
the setup i'm working on has the debugger out of step with the code.
Working in Visual C++.net.
If i set a breakpoint and step through the debugger thinks theres code where there is clearly whitespace.
I've cleaned and rebooted and rebuilt and all that but it doesn't seem to help.
There is only one copy of the source code on the hard drive and the build times are correct for all the files
I was wondering if anyone had any suggestions as to what might be going on and any solutions that might present itself.
regards
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Are you debuging a DLL? I have only come across this when the DLL I was debugging was not current!?
Ant.
|
|
|
|