|
You have two options:
1) Use an existing control, there are plenty existing on this website. I also developped one control that can do that (see the link in my sig). I think it is the easiest solution and the one that will save you a lot of troubles.
2) Create your own control. You seem to have some problems with the fact that the line should move. Well, there is no miracle: if you want to do such a thing, you have to make it move yourself (redraw the line completely).
I warn you that this is far from being the easiest solution. If you are completely new to this, I suggest you take the first option. But if you have some time and want to learn how it works, then it can be interesting to take that path. But then, start by reading some tutorials about how to create custom controls before starting to create your own.
|
|
|
|
|
Hi everybody,
i create my self a menu-object, so i can display the menu-items dynamically :
CMenu *Home = new CMenu();
Hom->AppendMenu(MF_STRING,ID_MYMENU_GO,"Go");
Home->TrackPopUpMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,Parent);
The ID_MYMENU_GO isn't known and the menu item is disabled.
If i create a new String-Ressource with the ID of ID_MYMENU_GO and set a String of "-"
the Menu-Element is displayed correctly ...
Is it also possible to set the Menu-Item ID to the project/mainform/.. so that
the application knows the ID ?
For example adding the String via programmation into the known ID's ...
Big thanks for help
|
|
|
|
|
|
just wanted to know if there is any readymade application where in progress bar is used. want some application where the progress bar should should tell me the progress while i am copying or playing a song.
|
|
|
|
|
|
Im not sure CSkinProgress[^] is answer to your question or no if its not more explain will be helpful.
|
|
|
|
|
Hello.
I have found a bug (in Windows maybe) while writting in Win32 API.
I have the following code executed:
OPENFILENAME OpenFileName={0};
TCHAR szFilter[]=__TEXT("Graphs (*.graph)\0*.graph\0All Files(*.*)\0*.*\0\0");<br />
TCHAR szFile[MAX_PATH];<br />
szFile[0] = __TEXT('\0');<br />
OpenFileName.lStructSize = sizeof(OPENFILENAME);<br />
OpenFileName.hwndOwner = hwnd;<br />
OpenFileName.hInstance = NULL;<br />
OpenFileName.lpstrFilter = szFilter;<br />
OpenFileName.lpstrCustomFilter = (LPTSTR) NULL;<br />
OpenFileName.nMaxCustFilter = 0L;<br />
OpenFileName.nFilterIndex = 1L;<br />
OpenFileName.lpstrFile = szFile;<br />
OpenFileName.nMaxFile = sizeof(szFile)-1;<br />
OpenFileName.lpstrFileTitle = NULL;<br />
OpenFileName.nMaxFileTitle = 0;<br />
OpenFileName.lpstrInitialDir = NULL;<br />
OpenFileName.lpstrTitle = NULL;<br />
OpenFileName.nFileOffset = 0;<br />
OpenFileName.nFileExtension = 0;<br />
OpenFileName.lpstrDefExt = TEXT("graph");
OpenFileName.lCustData = 0;<br />
OpenFileName.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_LONGNAMES;<br />
if (GetOpenFileName(&OpenFileName)){<br />
return (CString)OpenFileName.lpstrFile;<br />
}<br />
return (CString)"";
This, as I hope you know, creates the Windows OpenFile Dialog.
When the window appears do the following:
1. Go to the Desktop.
2. Place the cursor above a file (not a link to a file) and wait for the tooltip to appear. Then press Esc to exit. Then execute again the code and do the same thing (on the same file extension). At that point I get a crash in SHELL32.DLL. See the debug output below. I tried that in an other app and I got the same crash. However, same apps do not crash, so I wonder if I am doing sth wrong or if someone knows sth more about this.
Loaded 'C:\WINDOWS\system32\xpsp2res.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\NeroDigitalExt.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\MFC71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\msvcr71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Ahead\Lib\msvcp71.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Common Files\Adobe\Acrobat\ActiveX\pdfshell.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\msvcr80.dll', no matching symbolic information found.
Loaded 'C:\Program Files\Illustrate\dBpowerAMP\dBShell.dll', no matching symbolic information found.
The thread 0x958 has exited with code 0 (0x0).
Loaded 'C:\WINDOWS\system32\browseui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\netshell.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\credui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\iphlpapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rtutils.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shdocvw.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\crypt32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msasn1.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\cryptui.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wintrust.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\imagehlp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wininet.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\normaliz.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\iertutil.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\riched20.dll', no matching symbolic information found.
The thread 0xD34 has exited with code 0 (0x0).
First-chance exception in PlotLibDemo.exe (SHELL32.DLL): 0xC0000005: Access Violation.
==============================================================================
I also think there is a bug in "SetClassLong" when changing the style and CS_NOCLOSE.
Any comments or suggestions would be appreciated.
Thanks.
kostas KEL
|
|
|
|
|
When I say:
"Then execute again the code and do the same thing"
I mean without closing your app and rerunning.
kostas KEL
|
|
|
|
|
Could u pls explain in detail? also pls explain what the following means?
" I tried that in an other app and I got the same crash. However, same apps do not crash, so I wonder if I am doing sth wrong or if someone knows sth more about this."
Ajay
|
|
|
|
|
e.g. Try the following:
Make a new MFC dialog project and add a button.
Add the code I posted above (without the return statement)
for the button click event.
Click on the button to make the code run once and then follow
the described steps (in my first post). Then click the button
again (after you close the dialog using "Esc" or "Cancel") and
do the same actions once again. Your app will crash when the
tooltip (showing the file type size etc...) appears for the
second time. And that happens ONLY on the Desktop (you should
try to see the tooltip on the Desktop, and on a file NOT a link
to a file).
I tried the same thing (openning a file etc...) with an other app
(that was a Hex editor I use) that was using (I guess) the same
code and I had the same crash.
However most of my apps on my PC do not crash when I do this (thank GOD).
e.g. Internet Explorer, Acrobat reader, WMedia Player etc.
I also tried to run the code on other machines and got the same crash
(using my app). The only things (dlls loaded by the shell) in common
where the SP2 DLL (xpsp2res.dll) and Acrobat (pdfshell.dll) (I think).
I don't know if the source of the problem is in one of them.
Note that my code is running perfectly in any folder and it fails ONLY
on the Desktop! I suspect that this is a bug of the shell, since there
is no obvious problem with my code.
I use MSVS 6 C++ and I have SP2 installed.
I do not use unicode libraries.
kostas KEL
|
|
|
|
|
I have no idea how the code relates to the steps to
reproduce the crash.
I do see a potential problem with unicode builds though:
OpenFileName.nMaxFile = sizeof(szFile)-1;
should be
OpenFileName.nMaxFile = sizeof(szFile) / sizeof(TCHAR) - 1;
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please see my post above too. This is a small part of it:
Note that my code is running perfectly in any folder and it fails ONLY
on the Desktop! I suspect that this is a bug of the shell, since there
is no obvious problem with my code.
I use MSVS 6 C++ and I have SP2 installed.
I do not use unicode libraries.
Thanks.
kostas KEL
|
|
|
|
|
If you wish you can download my app from here:
http://rapidshare.com/files/64329713/PlotLibDemo.rar.html[^]
I had no serious problems after the crash, but it's better to save
your work before you do the trick. There is a "open file" icon on
one of the windows you'll see.
Thanks.
kostas KEL
|
|
|
|
|
OK. Someone helped me out! This is the answer :
======================================================
The problem is that the shell is caching column handlers.
When the file dialog exits, it calls CoUninitialize, which
unloads all the handlers even if there are references
outstanding. The next time the file dialog is opened,
the shell tries to access a column handler that isn't
there any more. Boom! If you manage COM initialisation
yourself, you shouldn't run into this problem.
--
Jim Barry, MVP (Windows SDK)
=======================================================
BUT, why does this happen ONLY on the Desktop?
Normally the shell should do the same thing, no matter
which folder you are in, shouldn't it ?
=======================================================
It's because the desktop folder is cached.
Other folders will be released (thus releasing
their column handler caches) before the file
dialog exits, but the shell caches the desktop
folder and so it outlives the file dialog.
--
Jim Barry, MVP (Windows SDK)
kostas KEL
|
|
|
|
|
Hi, did any of you ever encountered with problem when trying to open a Clipboard for the second time?
It happens to me!
I select some text from Notepad (ctrl + c)and get text data from it, here all my actions with clipboard (1.OpenClipboard(), 2.GetClipboardData(CF_TEXT), 3. EmptyClipboard(), and 5. CloseClipboard() is successful). Than again I try the same thing but now my OpenClipboard() fails (I even try to hold for a while with Sleep() function)???
If anyone had similar experience please let me know!
P.S.
I solved this by commenting out EmptyClipboard() function!?
|
|
|
|
|
I think i have written my guestion hasty. My new application works normal in my laptop. And have installed here Visual Studio 2005. But when i'm copying this application to another one (computer)there appears this message "The Application has faild to start because the Application configuration is incorrect. Reinstalling the application may fix this problem."
and now i have find some info from code project. But i cann't do this. There must instal Windows installer 3.0 and ....
My guestion : How can i use my application in another computer. What am i install additionally ?
May be *.dll files, or *.msi files. ????????? Thanks !
-- modified at 13:10 Friday 19th October, 2007
|
|
|
|
|
so what?
what exactly do you want to ask here.
please delete the repeated post.
|
|
|
|
|
thanks my friends. I have found. And now application is working very good . Bye
- - - - - - - - - - - - - - - - - - - -- - -
I think i have written my guestion hasty. My new application works normal in my laptop. And have installed here Visual Studio 2005. But when i'm copying this application to another one (computer)there appears this message "The Application has faild to start because the Application configuration is incorrect. Reinstalling the application may fix this problem."
and now i have find some info from code project. But i cann't do this. There must instal Windows installer 3.0 and ....
My guestion : How can i use my application in another computer. What am i install additionally ?
May be *.dll files, or *.msi files. ????????? Thanks !
Avazov
|
|
|
|
|
;Pkindly observe,
now he has modified his post, and now, it seems something relevant.
i think, by the time you saw it, he has modified it.
thats why u mis took me.
|
|
|
|
|
Then I take back all I said!
And I'm apologizing if I offended you!
|
|
|
|
|
For both...
Original post is below... still repeated :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
|
thanks,
modify your post or better delete it.
lets have a good working atmosphere at code project .com.
|
|
|
|
|
It's so because on another's computer the workarounds of yours application is different then on yours PC.
When compiling, application is compiled with other files (like .dll's for example) and it can be linked with yours application as static or shared... What I'm trying to tell you is that yours application is missing some file on another's computer to work!
Try to find out which one, or post more details here!
|
|
|
|
|
First thing you have to do is distribute the release version of your program.
Then, with your application, you need to distribute vcredist_x86.exe and execute it on the target machine. This can be found here[^]. This will install the C run-time library and the MFC libraries.
If that still doesn't work, then your application depends on other dll's that are not found. Use dependency walker to check which dll's are required to be distributed with your app.
|
|
|
|