|
it was a possibility, but i want to get time in microseconds, and this functions only give me the time in miliseconds. Is there any function which return the microseconds?
thanks
|
|
|
|
|
You can get more bits by using GetSystemTimeAsFileTime and working with the result, which is in 100ns intervals.
However, you won't get any better results, because the system clock is only updated as often as the clock timer ticks, which on most Windows systems is approximately 15ms. To see what yours is, run ClockRes[^]. I'm sure this is true of Linux as well.
The system doesn't necessarily add 15ms every time the system timer ticks, it may add a slightly larger or smaller amount to allow for clock drift.
|
|
|
|
|
If you really need more accuracy then you'll need to use the QueryPerformanceCounter API: HighResolutionElapsedTimer and MS's KnowledgeBase has more details on this. It's not an actual 'time of day' though; just a high resolution timer you can use to time. If you need both time of day and very high precision timings, you'll need to combine the two methods (or even use an external hardware peripheral like a GPS receiver!)
|
|
|
|
|
Hi
i have created a bitmap and i want to load that to my dialog window.
how to load the bitmap into the dialog.
pls give me the sample code if possible
|
|
|
|
|
The Name itself implies the API.
::LoadBitMap(...).
Think Clever.
Uday kiran
|
|
|
|
|
reddy harish wrote: load the bitmap into the dialog.
Use BitBlt()/StretchBlt() API's
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
See LoadImage or LoadBitmap from resource or see CImage::Load and then CImage::BitBlt
|
|
|
|
|
Hi, i can capture frames with directshow but just with ICaptureGraphBuilder2 Interface so i capture an avi file,
i want to capture frames in my file (not avi), help please
thanks
Thanks
|
|
|
|
|
Use the SampleGrabber filter. I prefer the one that comes with the SDK since the source code is provided.
|
|
|
|
|
I split the window into 3 view.
some buttons in first view by clicking these buttons second view changed.
In the second view some buttons there by clciking these third view is changing
i attached the pictures to these button. in OnIntialUpdate() funtion . if i replace SOme X view with Y View, and again i repalcing Y with X view. the pictures are not showing..........
how i always get pictures to these buttons?
delete
|
|
|
|
|
kiranin wrote: if i replace SOme X view with Y View, and again i repalcing Y with X view. the pictures are not showing..........
Do you mean switch between views, is it?
Can you show some code?
|
|
|
|
|
Hi out there,
I use ShellExecute() to open a file with the default extension. Works well for Word-Documents, Excel, Powerpoint, PDF, JPG and so on.
My program calls ShellExecute() so that the user can read the or work on the file. When finished, the file should be closed or minimized again and my program is visible again. Works well.
Now I created a MessageBox() right after ShellExecute() whee I want the user to click Yes or No (I want to know if the file was of any Help for my user). Now something strange happens:
I call ShellExecute(), a PDF is started, my Messagebox appears and the PDF is displayed. I close my PDF and see my messagebox. Works well
On the other hand:
I call ShellExecute(), a Word-document is started, my messagebox appears, the word-document is brought in the background an my application with the messagebox is displayed as top-window. So my user is asked, if the document was of any help, but the document is in the background, behind my application. The user has to bring it in the foreground. The same happens for Excel-documents.
Is there any way to tell either Office to stay in the foreground or to tell my programm to remain behind the currently started shell-object?
thanks in advance
Juergen
|
|
|
|
|
I think that the "pdf" behaviour is sort of on exception and the "office" behaviour is the rule.
What you can do is rearrange the windows in the Z-Order and make your application second from the top before firing the message box (however, this seems to be what you already do).
Another solution would be to make a non modal message box, in which case it must be possible to activate it without having your application directly in the background.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Hm, I also thought of a nonmodal dialog.
But I have to wait in my application for the end of a nonmodal dialog.
So, I have to do the following:
ShellExecute()
Create Dialog
Show Dialog without activating it (how can I do this??)
Wait for End of Dialog (how can I do this?)
Continue with my program based on the results of my nonmodal dialog
I haven't done a lot with nonmodal dialogs, but I will learn...
Juergen
|
|
|
|
|
e-DJ wrote: ShellExecute()
Create Dialog
Show Dialog without activating it (how can I do this??)
Wait for End of Dialog (how can I do this?)
Create Dialog:
CMyDialog md;
Show Dialog without activating it : there is an option in the resource editor to start a dialog unvisible.
Wait for End of Dialog : Post a custom message when the dialog is destroyed to your main application. In the main application, simply wait for the message.
PS: David's remark is good, but I think this is what you already started to do.
PS2: Ein Juergen in USA ? Bist du wirklich ein Ami ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
I managed to display my dialog as modeless. But How can I wat in my Application for a posted message?
Background:
I have a listctrl. This list displays a lot of filenames. The user makes a dblclick and the file is opened. I then add an entry in my database, that the user has started this file and ask, if it was useful for him. Then I add another entry in my database.
Right now, my algorithm looks like this:
OnDblClick:
Get klicked filename
ShellExecute
Display MessageBox
When it was of use, add entry in database
increment hitcounter in database
It is my own ListCtrl derived from CListCtrl. I was not able to call a dialogbox of my application from inside my ListCtrl (which makes sense, because my ListCtrl does not know about my application). So I initialised my modeless dialog in my application and pass a pointer to this dialog to my ListCtrl. However, my ListCtrl only accepts CDialog as pointer, therefore I can not access members of my modeless dialog.
So after doing a ShellExecute, I just show my previously created modeless dialog and have to wait in my DblClick-handler for the end of my modeless dialog. Sound difficult. Otherwise I have to completely reconstruct my ListCtrl.
Juergen
PS. Ich bin nicht aus Amerika, sondern lebe in Deutschland. Wie kommst Du darauf, ich wär Ami?
|
|
|
|
|
Don't display the message box until after the program that ShellExecuteEx() spawned has finished. It makes no sense to ask if the file was of any help if the message box comes up first.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to write a program in Visual C++ to transfer data between a computers and microcontroller via 10/100 Ethernet RJ-45.
What i need (libraries, or is there any help in MSDN.)
What i figured out is that i need "winsock" for programming.(TCP client and TCP Server)
Where should I start.
thanks
|
|
|
|
|
|
How about here[^] and related articles.
By the way, posting to multiple forums isn't necessarily a good idea...
Steve S
Developer for hire
|
|
|
|
|
In my application I hook Windows registry query's and read direct them to a file. I use the following code:
<br />
LONG __stdcall Mine_RegQueryValueExA(<br />
HKEY hKey,<br />
LPCTSTR lpValueName,<br />
LPDWORD lpReserved,<br />
LPDWORD lpType,<br />
LPBYTE lpData,<br />
LPDWORD lpcbData<br />
)<br />
<br />
{<br />
char * filename = "\\testapp.ini"; <br />
char buffer[_MAX_PATH];<br />
_getcwd(buffer, _MAX_PATH); <br />
strcat(buffer, filename);<br />
LPTSTR lpReturnedString = "";<br />
unsigned int nSize = MAX_PATH;<br />
GetPrivateProfileStringA("Section" , lpValueName, "\255", lpReturnedString, nSize, buffer);<br />
lpData = reinterpret_cast <LPBYTE> (lpReturnedString);<br />
LONG rv = ERROR_SUCCESS;<br />
return rv;<br />
<br />
<br />
__try {<br />
rv = Real_RegQueryValueExA (hKey,lpValueName,lpReserved,lpType,lpData,lpcbData);<br />
} __finally {};<br />
<br />
return rv<br />
}<br />
Now in a number of cases I get an error the the GetPrivateProfileString line along he lines of 'The memory could not be "written"'. Can anyone see what is causing this error as I really have no idea.
Thanks
|
|
|
|
|
nSize is set to MAX_PATH whereas buffer is of size _MAXPATH. Do these match ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
stevelam wrote: LPTSTR lpReturnedString = "";
unsigned int nSize = MAX_PATH;
GetPrivateProfileStringA("Section" , lpValueName, "\255", lpReturnedString, nSize, buffer);
watch fourth parameter, it should be like this
char ReturnedString [ MAX_PATH + 1 ] ;
unsigned int nSize = MAX_PATH+1;
GetPrivateProfileStringA("Section" , lpValueName, "\255", ReturnedString , nSize, buffer);
|
|
|
|
|