|
We'd prefer VS (and couldn't find how to do it -if it is possible at all- yet) but i will give WinDbg a try, thanks.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Use Microsoft's Symbol Server[^]. Part of the release process for a build becomes adding its symbols to your downstream store and you set it up to pull symbols for the OS from upstream (from Microsoft). Look here[^] too.
Steve
|
|
|
|
|
Thanks, we will check it out to see if we can use it.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Hi,
I am having a list control with icon view in my application. I have populated the dialog with some items. I need to focus on the first item when the dialog containing the list control shows. Currently even if i set the selection with the SetITemState in the initdialog it is not showing because the default item in the dialog is a button so the focus goes there first.
Also, when i try to delete the first item of the list control by clicking on the item and selecting the button 'delete'[which is another element in the dialog] I am not getting some junk values from the function GetNextItem()
Please advice
Regards,
Joe
|
|
|
|
|
emmmatty1 wrote: I need to focus on the first item
You can set the tab order in the dialog, or set the focus in the function that handles the WM_INITDIALOG[^] message.
emmmatty1 wrote: Also, when i try to delete the first item of the list control by clicking on the item and selecting the button 'delete'[which is another element in the dialog] I am not getting some junk values from the function GetNextItem()
I guess you mean that you are getting some junk values. If you are iterating any sort of list and you delete an item then you should restart your loop, since the iterators may no longer be valid.
|
|
|
|
|
Try the GetFirstSelectedItemPosition / GetNextSelectedItem methods.
The selection not showing may be because the Always Show Selection property is not set to true .
Try doing a SetFocus to the list control in OnInitDialog at the end.
|
|
|
|
|
Hello ,
I can access the right pane of the Windows Explorer in XP ( 32 bit ) , by getting the handle to the "SysListView32" .
But in Windows 7 , the window class for the right hand side of the Windows Explorer is DirectUIHWND. I have used Spy++ to see the child windows, but I only find ControlNotifySink .
Any idea how do I get the list view .
Thanks in advance
Sujay
|
|
|
|
|
What are you trying to do?
I guess you should be writing a shell extension.
What you're doing is not a recommended way and this is exactly the situation why it is not recommended.
|
|
|
|
|
I want to find out which item has been selected .
If it was a SysListview32 , I could have SendMessage and used the HWND of the SyslistView32 .
But as it is a DirectUIHWND, I dont see how to get the list view out of that. There is no documentation of DirectUIHWND .
One way maybe to get the COM interface, I am thinking of that way.
Any help would be appreciated.
Thanks,
Sujay
|
|
|
|
|
I am writing a Windows application in Visual C++. I want to make a program loop take exactly a thirtieth of a second per loop. Please how can I make the program find the time since the program started running, or similar, accurate to a millisecond or a microsecond? I have found many time-related functions, but all giving the time to the nearest whole second.
|
|
|
|
|
GetTickCount will report with ms accuracy - but it's lumpier than that. It used to change at ~19ms intervals, but I think it's finer.
If you want *exactly* 1/3 of a second, then windows is the wrong OS for you.
After that, it boils down to your exactness. You could use SetTimer (..., 333, ...), or waitable timers, or...
Do you want no less that 333ms between events, 3 events pretty evenly per second, but you can handle some jitter?
Short version: Define "exact".
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hey warrior, how goes on the great invasion of Sweden?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Going great - see the change in my sig!
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
QueryPerformanceCounter can give better resolution than GetTickCount or 'time()' or SetTimer. but you will never get a loop that takes exactly 1/30s in Windows - you can get close, on average. but not exactly, all the time. Windows just isn't that kind of OS.
|
|
|
|
|
Use the MultiMedia timer with a callback function. It is the most accurate timing you can have in Windows.
Lookup the following in the VC++ help:
TIMECAPS
timeGetDevCaps
timeBeginPeriod
timeSetEvent
|
|
|
|
|
This "event setting" sounds complicated, like trapping errors. My program uses this method, and it seems to work:
NEXTFRAME: t=GetTickCount();
InvalidateRect(wn,0,0); RedrawWindow(wn,0,0,RDW_UPDATENOW);
for(j=0;j<4;j++) {if(!isdigit(MFN[i+j])) goto DEF; FN[j]=MFN[i+j];}
fn=(FN[0]-'0')*1000+(FN[1]-'0')*100+(FN[2]-'0')*10+FN[3]-'0'+1;
if(fn>9999) goto DEF;
FN[3]++; if(FN[3]>'9') {FN[3]='0'; FN[2]++;}
if(FN[2]>'9') {FN[2]='0'; FN[1]++;}
if(FN[1]>'9') {FN[1]='0'; FN[0]++;}
MFN[i]=FN[0]; MFN[i+1]=FN[1]; MFN[i+2]=FN[2]; MFN[i+3]=FN[3];
if(!readfile(I,MFN,wn)) goto DEF;
do {} while(GetTickCount()-t<33); goto NEXTFRAME;} ;
but the loop in the last line looks like it ties up the computer until time comes to display the next frame, instead of letting aniother process run.
|
|
|
|
|
I would have thought that, in these times when desktop computers can run at a gigahertz and more, that it would be routinely easy for a C++ program to time events by the microsecond.
|
|
|
|
|
It's really not that complicated once you have done it a couple of times. The do while loop that you are using is extremely wasteful in terms of CPU utilization. The proper way to block a thread is with WaitForMultipleObjects. Also, you should never block the main thread of your application. The best solution would really be to use a background thread to draw on a BITMAP and use use BitBlt to transfer the image to the screen every 333 ms.
As a side note the values returned by GetTickCount are really only accurate to 15.2 ms so using it to time 33 ms isn't going to work well on a loaded machine. The advantage of the multimedia timer is that you can truely have 1 ms accuracy. And by using a background thread and proper thread synchronization your code will scale properly on faster and multi core machines and still work correcly on a slower or heavly loaded machine.
|
|
|
|
|
In this case I need to wait not 333ms absolutely, but (333ms minus (the time taken to read that frame from a file)).
|
|
|
|
|
Hello VC++ gurus,
I have to add a dual interface to a non-MFC, non-ATL application.
I have a non-ATL, non-MFC enabled project and a plain Win32 application. Now, this Win32 exe must expose some services through an IDispatch interface.
My question: Can I somehow use ATL to help me with that IDispatch implementation? Event if the project is a non-ATL project?
Note: My Win32 exe must act as Local Server (CLSCTX = CLSCTX_LOCAL_SERVER) here.
I'll appreciate your help a lot.
Regards
P.S.: Thanks to all how replied to this thread.
I'll try to use ATL in my non-ATL project: use CComObjectRootEx, CComCoClass, IDispatchImpl and CAtlModuleT<base> etc. straight away. So far, it looks OK.
Regards,
Joerg
|
|
|
|
|
|
Thanks. Now, let me try to understand the XYZDispatchDriver: does it assume that the IDispatch Interface has been defined (in an IDL) and a coclass has been implemented? Or, is this created dynamically on the fly?
In my situation, I do not yet have IDL defined, class implemented.
Regards,
Joerg
|
|
|
|
|
Sorry, I'm not a COM expert, I just remembered this article from my own studies on the subject. You could try posting your question at the end of the article as it will then go to the author, who probably is an expert.
|
|
|
|
|
Thanks anyway.
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|