|
I'm updating a MFC app by, among other things, adding a second dockable toolbar to it. Its original toolbar has been there a long time and it works fine: in particular, if you move it around in the frame and close the application, it turns up in the same location you left it the next time the application is opened again. (Its information is preserved and retrieved with a single pair of SaveBarState and LoadBarState calls.)
Not wanting to meddle with what works, I created the second toolbar by basically copying the code which implemented the first. It gets created at the same point in code, with the same properties, in the same way. By and large it works well, but it falls down in one important respect; the new toolbar always appears docked in the upper left corner position whenever the application starts up, even if you moved it somewhere else.
Has anyone else experienced this? Do SaveBarState and LoadBarState have some limitation with multiple toolbars I don't know about? Or is there some better mechanism for managing these which I don't know about?
Ron Ritchie
|
|
|
|
|
It may be a problem with your toolbar IDs. MFC uses the constant AFX_IDW_TOOLBAR for the main toolbar ID. It also uses a couple of successive IDs for things like the status bar, dialog bar, etc.
I would try setting the ID of the 2nd toolbar to AFX_IDW_TOOLBAR + 20 or something similar. (pass the ID via the CToolBar::Create call)
If you search the vc++ folder for AFX_IDW_TOOLBAR, you should see all the defines/constants I'm referring to.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
That was very helpful. It didn't solve the whole problem, but knowing to search for that toolbar ID proved the key to solving the rest. Thanks!
Ron Ritchie
|
|
|
|
|
Hi Everyone!
I have a problem! How can I run an EXE directly from memory?
Thanks for any reply!
|
|
|
|
|
Yeah you can... but you have to implement your own PE loader.
That's quite difficult so I propose that you dump the exe file to the disk and execute it the normal way.
Don't try it, just do it!
|
|
|
|
|
Why did you want to run your application in memory?
It's not a normal operation. Don't do this..
---------------------------
Auto Debug for Windows
http://www.autodebug.com/
|
|
|
|
|
Does anyone know a discussion of the actual overhead imposed by using a SetWindowsHookEx(WH_CALLWNDPROC / WH_CALLWNDPROCRET) for a single thread?
I'm currently writing a test app for my specific case, but I'd be interested in what others have to say.
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
Hello,
Just a short question really. Could anyone either tell me how or give me a link to a webpage that explains how you turn an image using DirectDraw.
Thanks
|
|
|
|
|
Hi,
How to get the name of the treeview node.
on clicktree event. if anybody knows pls let me know .
Regards
Chezhian
|
|
|
|
|
How do you name the node ?
If you have the handle you can issue no of treeview events to get the inforormation.
-prakash
|
|
|
|
|
hi,
i got it by
the following code
HTREEITEM hSelectItem=GetTreeCtrl().GetSelectedItem();
CString itemname=GetTreeCtrl().GetItemText(hSelectItem);
Thanks for ur reply.
|
|
|
|
|
I have created a C++ application WinMain( non-MFC). I included the following code to gather some information.
#########
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "\"C:\\Program Files\\MyProgram\\info.exe \"";
ShExecInfo.lpParameters = "/nfo c:\\temp\\info.txt";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
################
because it takes a while (4-5 mins), the user does not know if the application is running or doing anything at all.
How to display a message "Please wait...etc" while the process is running?
I tried messagebox bot the user must click OK and still has no idea if the app still running?
thanx for any adviced.
|
|
|
|
|
Perhaps you can create a modeless dialog box instead?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Hi all,
This is roland working for s/w comp in pune as trainee programmer in SDK (win 32)as i don't have preiveious experience in sdk i am getting some problem.....so can anybody help me....my project is related to desktop & printing ...when user selects a perticular area on desktop or on screen he should get only that area after printing ..
i am getting the selected image on screen but after taking print for it the colors of that image are not appear as they are on screen i am getting very light colors image....i tried lots for this but i didn't get it...i got one API ColorMatchToTarget But where should it place or is it really work for this ???so can anybody help me & guiide me plz???
thks waiting for reply.......
roland
|
|
|
|
|
Oh God, I was over 2000 lines in my project then I saved it then poof! My cpp files is gone!
Is this a bug or something? Can it be fixed?
|
|
|
|
|
I've been using VC++ since version 1 (c. 1994) and have never seen the compiler delete a cpp file. Even if you mean the editor (Visual Studio), I've never seen it delete a file either. Are you sure you just didn't save it some place other than the project dir?
Cheers,
Tom Archer - Archer Consulting Group
"Eat your brussel sprouts, Junior. There are starving Chinese children American programmers that would kill for that food!"
|
|
|
|
|
Yep, the file is in the same directory as the project. This is bad.
It occured when I click Save. I closed the workspace, reopened it then the cpp file is gone
I even looked for it in the project dir and its not there anymore (I kept the project directory window open, and it was still there until I refreshed it after I saved the project)
EDIT:
After a few minutes of searching, I found one with situation similar to mine:
http://www.codeguru.com/forum/showthread.php?t=332727&page=1
Another one:
http://groups-beta.google.com/group/microsoft.public.vc.ide_general/browse_frm/thread/c48c6d2cfeaabba1/934105cfbac39cff?hl=en&lr=&ie=UTF-8&oe=UTF-8&rnum=2&prev=/groups%3Fq%3D%2522Cannot%2Bsave%2Bfile%2522%2B%2522the%2Bfile%2Bmay%2Bbe%2Bin%2Buse%2Bby%2Banother%2Bapplication%2522%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26sa%3DN%26tab%3Dwg#934105cfbac39cff
|
|
|
|
|
Wow! Good thing I run AVG instead of Norton!
Cheers,
Tom Archer - Archer Consulting Group
"So look up ahead at times to come, despair is not for us. We have a world and more to see, while this remains behind." - James N. Rowe
|
|
|
|
|
If you are referring to VC 7.0 (or maybe even 7.1?), this is a known "problem". For more info/verifications, you could google some MS newsgroups (usenet news).
Obviously it can be fixed - but only by the ones destroying your data in the first place.
|
|
|
|
|
Hmm, I'm using VC 6. And yah, I looked at other boards and they have the problem too. Stupid Micro$oft <_<
|
|
|
|
|
yup.....it happens for me also once a while! just compile and execute ur project and it should be back!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
yes, it has happend to me many times, after saving the file i try to compile the project, the compiler complains that the file is missing.
I know this behaviour so i just do a save all again and then compile again.
yes,
in the past i have lost a file like this, but lucky that i use VSS.
-prakash
|
|
|
|
|
I use VC5 on XP machine and have faced the problem of the cpp file getting deleted. I had to rewrite the whole thing.
|
|
|
|
|
I noticed that if I add a normal ComboBox to a dialog (dropdown list) and add some strings, even though the strings are added (I verified that), the list isn´t displayed when i push the down button. Can anyone give me a solution to that?
I learn my self
|
|
|
|