|
<br />
TCHAR GetDriveLetter(LPCTSTR lpDevicePath)<br />
{<br />
TCHAR d = _T('A');<br />
while(d < = _T('Z'))<br />
{<br />
TCHAR szDeviceName[3] = {d,_T(':'),_T('\0')};<br />
TCHAR szTarget[512] = {0};<br />
if(QueryDosDevice(szDeviceName, szTarget, 511) != 0)<br />
if(_tcscmp(lpDevicePath, szTarget) == 0)<br />
return d;<br />
d++;<br />
}<br />
return NULL;<br />
}<br />
|
|
|
|
|
im trying to make a scrolling text im using scrollwindow and it moves back and forth but when it goes from left to right if the text is say "hello" it looks like hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhello how can i get it to look right and not repeat the first letter?
|
|
|
|
|
To avoid such nasty hhhhhhhhhhhhhhhhhhhhheadaches, you can take a look at THIS FAQ[^]
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
CMyDialog::PreTranslateMessage()
{
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_UP)
{
m_bUp = TRUE;
pMsg->wParam = VK_TAB;//tranlate into TAB
keybd_event(VK_SHIFT, 0, 0, 0); //press down the shift
}
else if(pMsg->wParam == VK_DOWN)
{
m_bUp = FALSE;
pMsg->wParam = VK_TAB;//tranlate into TAB
}
else
m_bUp = FALSE;
if(IsDialogMessage(pMsg))
return TRUE;
}
else if(m_bUp)
{
keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);//Release SHIFT
m_bUp = FALSE;
}
return CDialog::PreTranslateMessage(pMsg);
}
|
|
|
|
|
Could someone tell me what open mode I can use to write data only to the end of my already created (existing) file? should I use iso::trunc?
~Moujan
-- modified at 1:59 Sunday 2nd July, 2006
|
|
|
|
|
ios::app
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
|
Could some one tell me how I can prevent duplicate definitions in my program. I mean should I use something like #definemyClass or should I use provate keyword.
Thanks, Moujan
|
|
|
|
|
Typically in your .h header file you would put:
#ifndef _MY_CLASS_H
#define _MY_CLASS_H
class MyClass
{
...
};
#endif // _MY_CLASS_H
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Thanks for replay.
Moujan
|
|
|
|
|
Hi,
I am looking for System Wide hook for File Save as dialog.
What I want is to show more data inputs to enter in the dialog such as : a dropdown with some values, a date control etc.
It is not necessary it be the same dialog, it could be a new dialog all together with customized UI (preferrable) and gets some of the dropdown values from a database.
Creating the UI controls / Getting the information from database will not be issue at all.
What I am specifically looking for is how to make file save as hook, how to show a modified OR a new dialog all together (preferable) in all Apps when file save / file save as is executed ?
Have already seen the articles on System Wide hooks. They are very good but I am looking on how to do this specific application scenerio.
I will really appreciate your suggestions.
Thanks
Mo
|
|
|
|
|
Take a look at:
www.catch22.net/source[^]
I've got a sample there called 'report-view', it shows how to do a system-wide modification to all Open/Save dialogs and change the view to 'detail-view' in these windows.
James
http://www.catch22.net
|
|
|
|
|
Thanks a lot for your response James. I downloaded the source and will have a look at it.
I also liked the content of your web site.
Mo
|
|
|
|
|
Hi all,
When I click in a label in my (heavily subclassed) ListView, I get the following DLL:s loaded:
<br />
Loaded 'C:\WINDOWS\SYSTEM32\winmm.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\fireface_mme.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\setupapi.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\wintrust.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\crypt32.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\msasn1.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\imagehlp.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\EMGA8U2K.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\version.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\wdmaud.drv', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\wdmaud.drv', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\MSACM32.DRV', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\msacm32.dll', no matching symbolic information found.<br />
Loaded 'C:\WINDOWS\SYSTEM32\midimap.dll', no matching symbolic information found.<br />
The loading of the libraries takes about 1 sec, which is not acceptable. The app does not use any multimedia features, and is not based on MFC or any other framwork (pure Win32 API calls).
I have done some research, but is now totally at a loss. Any suggestions will be appreciated!
Thanks!
PS.
Fireface800 is my audio I/O unit, a beautiful piece of hardware if you ask me
|
|
|
|
|
I would put a breakpoint inside LoadLibraryW (and friends) and try to get a call stack of the code which loads "winmm.dll".
Steve
|
|
|
|
|
Good idea. Tried it, but the call stack doesn't tell me that much:
<br />
KERNEL32! 7c80acd3()<br />
COMCTL32! 5d0f0541()<br />
COMCTL32! 5d0f08a0()<br />
COMCTL32! 5d097aae()<br />
USER32! 77d48709()<br />
USER32! 77d487eb()<br />
USER32! 77d4c00e()<br />
USER32! 77d4c034()<br />
esListVw::OnMessage<br />
The bottom one is my own code, calling CallWindowProc(...) in response to a WM_LBUTTONDOWN .
I think this is spooky. I would feel more comfortable if the app just crashed ...
Btw, tried to remove all custom stuff from the control (subclassing and responding to WM_NOTIFY's), but the multimedia DLL's get loaded anyway at first click (left or right mouse button doesn't matter, same behaviour if tabbing to the label).
Any idea on how to move forward? I'm stuck.
Thanks
|
|
|
|
|
Don't use MSVC6 to get the stack. Use WinDBG. You can get it from here[^]. Configure the symbol path (in the "File" menu) with this string:
SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols
You will need an internet connection. This will cause WinDBG to download symbols as needed from Microsoft and store them on your machine at "C:\Symbols". With these symbols you will get a more meaningful stack trace. You can issue the "kvn 1000" command to get a stack trace to send.
Steve
|
|
|
|
|
Hehe, was hoping for that magical non-documentet extended style LVS_EX_NOAUDIO
The call stack looks like this:
<br />
LoadLibraryW<br />
CCPlaySound<br />
ListView_HandleMouse<br />
ListView_OnButtonDown<br />
ListView_WndProc<br />
InternalCallWinProc<br />
UserCallWinProcCheckWow<br />
CallWindowProcAorW<br />
CallWindowProcW<br />
esGridCtrl<br />
Any ideas? Have been using quite a few list views over the years, but this is a total mystery to me.
[Have been away a few days, hoping thread is not dead]
|
|
|
|
|
Can you send more info. i.e. The total info when you enter "kvn 1000" in WinDBG. For examaple where in ListView_HandleMouse did CCPlaySound get called. Also if you issue the "lmv" the results would be useful.
Steve
|
|
|
|
|
Ok, really nice of you to walk me through this. Sorry about late reply, have to do some "real" work as well
<br />
0:000> kvn 1000<br />
# ChildEBP RetAddr Args to Child <br />
00 0012f408 5d0c3011 5d0c3070 00000000 00000000 kernel32!LoadLibraryW (FPO: [Non-Fpo])<br />
01 0012f890 5d0f0541 5d0bd028 001e0020 00145690 COMCTL32!CCPlaySound+0xaf (FPO: [Non-Fpo])<br />
02 0012f904 5d0f08a0 0003056e 00000000 00000020 COMCTL32!ListView_HandleMouse+0x24d (FPO: [Non-Fpo])<br />
03 0012f924 5d097aae 00145690 00000000 00000020 COMCTL32!ListView_OnButtonDown+0x1b (FPO: [Non-Fpo])<br />
04 0012faa4 77d48709 0003056e 00000201 00000001 COMCTL32!ListView_WndProc+0x70c (FPO: [Non-Fpo])<br />
05 0012fad0 77d487eb 5d09637c 0003056e 00000201 USER32!InternalCallWinProc+0x28<br />
06 0012fb38 77d4c00e 00000000 5d09637c 0003056e USER32!UserCallWinProcCheckWow+0x150 (FPO: [Non-Fpo])<br />
07 0012fb68 77d4c034 5d09637c 0003056e 00000201 USER32!CallWindowProcAorW+0x98 (FPO: [Non-Fpo])<br />
08 0012fb88 004039dd 5d09637c 0003056e 00000201 USER32!CallWindowProcW+0x1b (FPO: [Non-Fpo])<br />
the lvm output can be found here: http://www.esaro.se/lvmoutput.txt
Nothing suspicious as far as I can tell, however, my experience with WinDbg is somewhat limited ...
/M
|
|
|
|
|
Does it do this when your program is *not* under the control of a debugger? There could be additional DLLs loaded when you are debugging.
Some part of your program is loading those DLLs. Maybe a 3rd-party system-wide hook has injected into your program? See what 3rd-party DLLs are in your address-space by listing all DLLs in your program (do a 'Module List' in VS when debugging).
I would also use DependencyWalker[^] to see what your program's dependencies are.
James
http://www.catch22.net
|
|
|
|
|
Same thing happens when not debuggin. No 3rd party DLLs as far as I can see. Something is seriously wrong here. Made a blank MFC project with a list view (report style), same behaviour.
|
|
|
|
|
I have override the CMyDialog::PreTranlateMessage() and traslate VK_DOWN to VK_TAB, but how can I translate VK_UP to VK_SHIFT + VK_TAB?Thanks
|
|
|
|
|
Why would you want to? An easier way would be to call CDialog::NextDlgCtrl() and CDialog::PrevDlgCtrl() depending on which arrow key is pressed.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
sendinput
|
|
|
|