|
i make one program for ivrs purpose.in which for database connectivity i use CRecordSet class fuction .in which i access 6 TABLES at a time for data manipulation. at this time cpu goes 100% and upto 15 seconds exe hangup.so another user dont able to access this exe file .so plz tell me can i make data retrival fast by any other method
|
|
|
|
|
Hi
I suggest u to use another Thread for database retrival while ur main msg loop handle user and system msgs.
also if u make a single QUERY for 6 table if it is possible it make ur jobs faster.
Bye
|
|
|
|
|
I need:
*) Get Handle of Main Window from process handle (I know the process handle).
or:
*) Get process info (i.e. process ID or handle) from a Window handle (I know the window handle).
any solution for 2 questions above is helpful - first is prefered.
thx
includeh10
|
|
|
|
|
Answer to your 2. question:
DWORD dwProcessId = 0;<br />
GetWindowThreadProcessId (hWnd, &dwProcessId);<br />
HANDLE hProcess = NULL;<br />
hProcess = OpenProcess (PROCESS_ALL_ACCESS, FALSE, dwProcessId);
|
|
|
|
|
1.
- Use GetProcessId() to get process id from process handle.
- Use EnumWindows() to look at each top-level window.
- For each top-level window call GetWindowThreadProcessId() to get the thread id and process id that was used to create the window.
- Break when you find a top-level window that was created by the specified process handle/id.
2.
- Use GetWindowThreadProcessId() to get the thread id and process id that was used to create the window.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi Guys,
I'm using my app's OnIdle() to monitor a list of CTime objects that are essentially alarm times(these can range from a few seconds in the future to weeks or months in the future). I decided on OnIdle() because I didn't want this monitoring to slow down the main app but also was too lazy to implement a new thread.
However, the OnIdle() calls seem to take too low a priority for my liking! When the application is running in the background it doesn't even seem to get called at all. Do I need to set some kind of priority to my app?
Many thanks,
Simon
|
|
|
|
|
srev wrote:
When the application is running in the background it doesn't even seem to get called at all.
I'd say that's by design and also a good thing. Why not setup a timer that's fired once a second or however often you need to test and when it fires run through the list. Or use a thread or probably best of all waitable timers.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Thanks for the response Neville. I'll definitely look into waitable timers. Reall useful advice, thanks again.
Simon
|
|
|
|
|
I found problem with CSocket when I use it for voice communication in LAN. After a long time the server program and the client program hangs. If I end task one of them then the other will become fine. I use the methods Send and Receive for data transfer.
What will be cause of this problem???
Please help me!
Thanks in advance!
|
|
|
|
|
My program can not use the mouse, And all the operation will be done by the keyboard. But I do not know how to get the ID number of the item which has the keyboard focus.
Thanks!
|
|
|
|
|
pantao551 wrote:
item which has the keyboard focus.
Use GetFocus() to find the Ctrl which currently under the Keyboard Focus.
pantao551 wrote:
how to get the ID number
Pass the HWND or CWnd return from call of GetFocus to GetDlgCtrlID which will return the Numeric ID of Control!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
What Alok said, with the addition that you can use int id = ::GetWindowLong(::GetFocus(), GWL_ID); if you'd like to stay win32.
--
Schni Schna Schnappi! Schnappi Schnappi Schnapp!
|
|
|
|
|
Hi, is it any way I can send a packet using an specific port?, for example, what would I have to do if I want to send a packet using the source port xxxx?
Thx in advance
Vertigo
Real Programmer isn't who just knows how to use a programming tool, Real Programmer is who knows how to write cool stuff in any language, 'cuz he/she/(it!!?) thinks like a machine .
|
|
|
|
|
IS it possible to take a txt file as an input from a user. The txt file contains some C++ code. The code in the file is executed and the result is returned to the calliong program.
|
|
|
|
|
A crude way would be to ShellExecute the compiler (cl.exe), wait till it completes and read and return the generated binaries to the caller.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i cannot differentiate between Cluster computing, Grid Computing, Parallel Processing! Can anyone tell me where i can see an example of the program being run on multiple clients and the result being returned to the server, something like have Cluster computing i guess?
|
|
|
|
|
How do i open an HTML Help file in a Procedure in Visual C++ 6 i want to be able to click help on the toolbar and for the help to open
I will need detailed help
Thanks
|
|
|
|
|
In the handler for your help button handler:
char* path = "c:\\help.html";
ShellExecute(NULL,"open",path,NULL,NULL,SW_SHOWNORMAL);
And there are no "Procedures" in C.
this is this.
|
|
|
|
|
|
Try here[^].
Software Zen: delete this;
|
|
|
|
|
Meaning to bascially substitue the older WinHelp function calls with appropriate parameters to the HtmlHelp function call. So read the MSDN about how to call HtmlHelp .
|
|
|
|
|
Can anyone tell me the best resources for Visual C++. I have worked on C/C++ but i've never had any experience with Visual C++. I need a few tutorials and some reallllly basic ones. Where can i get some? Tutorials that tell you how to create a form use the Microsoft IDE, etc.
|
|
|
|
|
|
hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is:
"If you send a packet to 255.255.255.0 it goes to all the computers on the network"
How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.
|
|
|
|
|
to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.
|
|
|
|