|
Hi alok,
I have created DSN Name. On class view when i clicked on new class and selected CRecordset (as baseclass) -> selected ODBC -> and in List box DSN which i have created -> after entering pasword clicked on OK -> then it should display list of tables for which i need to make a class but it not showing that table at all...
|
|
|
|
|
Hi megha,
First we will have to see whether you have successfully established the connection with your Oracle. For This :-
1. Test your connection to Oracle by opening a DOS Prompt and typing tnsping rep
2. The result should say "OK" at the bottom. Any failure to connect most likely indicates a problem with the sqlnet.ora file on the system. Replace the sqlnet.ora and tnsnames.ora files in C:\oracle\ora92\network\ADMIN.
|
|
|
|
|
there is a string represent time like this:
Mon, 17 Dec 2007 08:36:48
How can I format this string into a CTime object or some other internal time structure?
I've written a function to translate this string into a CTime, but I still wonder is there some library function can do this for me?
Thank you!
A Chinese VC++ programmer
modified on Tuesday, January 15, 2008 3:43:55 AM
|
|
|
|
|
See here[^] for low level time string formatting stuff. To go the other way you'll probably have to roll your own based on sscanf, shouldn't be difficult as long as you're only accepting a well known fixed input format, otherwise you're going to need a parser and that's more complex.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Yes, my own code is based on sscanf, and the string format is fixed like the sample above.
strftime, wcsftime, _strftime_l, _wcsftime_l these functions format tm to string, but what I want is formating string to tm or CTime object.
Thanks!
A Chinese VC++ programmer
|
|
|
|
|
Try this
COleDateTime class to format the Time/Date.
i think this will help you.
|
|
|
|
|
And it can also parse a string representing time. Good hit, indeed.
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.
[my articles]
|
|
|
|
|
can any one tell me how to draw .tga file on device context
by using win32 api .
|
|
|
|
|
you'll need to find some code to parse the TGA into a DIB (Device Independent Bitmap).
|
|
|
|
|
how can I parse it can you give some hint using win32 api
|
|
|
|
|
|
Hello everyone,
In your experience, what is system idle process doing? In my experience, this means system is (CPU is waiting for) doing some I/O,
1. like hard page fault;
2. waiting for information from network.
Are there any other cases which will cause system idle process happen and consume a non-neglitible percentage of CPU?
thanks in advance,
George
|
|
|
|
|
George_George wrote: what is system idle process doing?
What do you do when you are idle?
I suspect the vast majority of computers run with system idle process at 99% a lot of the time. System Idle is just a low priority 'do nothing' process that runs when all the other processes have yielded.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thanks cp9876,
You mean when system is not doing anything, it is idle, right?
Sorry that I may not make myself understood, I mean what other case (beyond not doing anything) will cause system idle process happen.
Any ideas?
regards,
George
|
|
|
|
|
In most desktop systems the processor stays powered up and clocking, this means it keeps fetching instructions. It can't stop doing this. In a multitasking OS the OS in some way allocates time to tasks. When no other task wants any time then the processor doesn't stop, it simply enters a do nothing loop. This can be implemented by executing a separate lowest priority process called system idle.
This is not really a c++ question.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thanks Peter,
I am monitoring the performance of my C++ application. I see somethings there is a system idle process while my application is running. I want to know what reasons may cause the system into idle status -- this is the key point of my question.
If CPU is in idle status because of waiting for some resources, I think I have found the bottleneck of performance.
Do you have any ideas what will cause idle process to happen besides the case when there is nothing to do?
regards,
George
|
|
|
|
|
Ah, more information, the real question emerges - "Why does system idle process run when my application is running?"
Well, if your application is running some computationally intensive routine it shouldn't unless you have more processors than threads.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thanks Peter,
Yes, I have two CPU. You mean my application is running on one CPU, and making the other CPU idle?
cp9876 wrote: you have more processors than threads
regards,
George
|
|
|
|
|
George_George wrote: You mean my application is running on one CPU, and making the other CPU idle?
Not making it idle, but unless you start a second thread you haven't given it any work to do. A single thread can only keep a single processor busy.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thanks for your clarification cp9876!
regards,
George
|
|
|
|
|
I would like to bring your attention to this article[^] which more accurately describes what System Idle Process actually does, including the use of the HLT instruction to cut the processor's power usage.
|
|
|
|
|
Thanks for the link, I didn't realise that the HLT was used dynamically in system idle.
I especially liked the link in hte article to the HCF - Halt and Catch Fire instruction[^], brought back some hardware memories.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Try right-clicking "System Idle Process", and you won't see a popup menu. It's something like void .
Maxwell Chen
|
|
|
|
|
Hi Maxwell,
My question is not what the idle process is and I understand system is doing nothing in idle process. My question is what makes the idle process happen and even consume a non-neglectible percentage of CPU.
This is what I explained before.
--------------------
I am monitoring the performance of my C++ application. I see somethings there is a system idle process while my application is running. I want to know what reasons may cause the system into idle status -- this is the key point of my question (not what is, but what cause).
If CPU is in idle status because of waiting for some resources, I think I have found the bottleneck of performance.
--------------------
Do you have any ideas what will cause idle process to happen besides the case when there is nothing to do?
regards,
George
|
|
|
|
|
Hi George,
as long as there are CPU cycles consumed by the idle process, there is a good chance you
could improve your app's performance by revisiting the way it is structured and using
multi-threading. Basically threads offer the possibility to do some useful computation
while part of an app is waiting for something (say a file access, a network operation, ...).
Analogy: When you paint several rooms in parallel, you can paint one while another is
drying, with enough rooms, you will have to no idle time before everything got painted.
Once idle time is down to almost zero, there is not much you can gain from adding threads,
which does not necessarily mean you are running at maximum performance since
you may have selected a suboptimal algorithm, inserted a busy loop, etc.
Performance optimization is a very broad subject, some simple observations may give
a hint for quick wins. The idle percentage is one of them.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
modified on Tuesday, January 15, 2008 4:15:37 AM
|
|
|
|