|
Thanks
I experienced that asynchronous disk io is not reliable. Am i correct?
If not then please give some idea about the way to use it
|
|
|
|
|
What do you mean with "reliable" ?!?
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
it is known to occasionally return bits that are neither one nor zero.
|
|
|
|
|
Hi there,
I need to use a memory checker "like" Intel Memory Inspector.
Of course I do'nt have 800 USD to buy such tool so I wonder if there are alternatives ?
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
|
Hi all,
I'm stuck with this.
I want to find the memory usage of my application. So I can work on with GetProcessMemoryInfo, and I need to find the relevant process ID in-advance to workaround. It's possible too.
But if my application runs multiple instances I cannot do that. Because all the process has the same name I cannot pick what the ID is.
Any suggestions really appreciate.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You could use the GetCurrentProcess[^] function and pass it to GetProcessMemoryInfo[^].
HANDLE hProc = GetCurrentProcess();
PROCESS_MEMORY_COUNTERS_EX info;
info.cb = sizeof(PROCESS_MEMORY_COUNTERS_EX);
GetProcessMemoryInfo(hProc, (PROCESS_MEMORY_COUNTERS*)&info, info.cb);
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Thanks for the replay.
Actually I comes with an error, undeclared identifier on the following.
Thaddeus Jones wrote: PROCESS_MEMORY_COUNTERS_EX info;
I've included psapi.h header too.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
You can try PROCESS_MEMORY_COUNTERS instead, maybe PROCESS_MEMORY_COUNTERS_EX was introduced later than your compiler (it requires WinXP SP2 or above).
modified 13-Sep-18 21:01pm.
|
|
|
|
|
That's why I'm wired. I'm working on WinXP SP3.
Anyway I work on with PROCESS_MEMORY_COUNTERS, and works fine. But when I'm invoking GetProcessMemoryInfo(...) it gives an unusual error at build.
error LNK2019: unresolved external symbol _GetProcessMemoryInfo@12 referenced in function "public: void __thiscall CMyExceptionLogger::LogMemoryUsage(enum LOGLEVEL)" (?LogMemoryUsage@CMyExceptionLogger@@QAEXW4LOGLEVEL@@@Z)
You have any idea about this?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Did you link psapi.lib to your project?
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Oh no. I don't. Could you please guide me how to do that?
I appreciate your help all the time...
CodingLover
|
|
|
|
|
That varies per compiler, you'd have to look that up in the manual.
Typically there's a menu item named Project with subitem Settings or Configuration or something.
modified on Monday, December 6, 2010 8:25 AM
modified 13-Sep-18 21:01pm.
|
|
|
|
|
As replied, you can use GetCurrentProcess to get a handle to the current process.
But this is a pseudo-handle and its value is always -1 .
This handle is not valid outside of the current process.
If you want to pass the handle to another process, you can call DuplicateHandle on this pseudo-handle to get a real one.
|
|
|
|
|
Hi
How to convert a CString value to HEX?
eg:
CString strHex = "0008103e";
to
HEX value = 0x0008103e
please help
Thanks
|
|
|
|
|
An hex value doesn't exist, what you want probably is to convert a string representing an integer in hexadecimal notation to an integer. For this you can use strtol[^] function.
|
|
|
|
|
Benjamin Bruno wrote: How to convert a CString value to HEX?
eg:
CString strHex = "0008103e";
to
HEX value = 0x0008103e
What Cedric said.
ULONG nVal;
CString str = _T("0x4335");
nVal = _tcstol(str, NULL, 0);
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
You got excellent C answers. In C++ use the facilities of the Standard C++ Library:
#include <sstream>
int GetIntFromHexString(const char* HexString)
{
int val;
std::istringstream(HexString) >> std::hex >> val;
return val;
}
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
It can be read words in .pdf document file ? Should be use an special .pdf library , or MFC can do that ?
|
|
|
|
|
You should either use a library or parse yourself the PDF format (specifications are available).
I believe there are articles, here at CodeProject, covering both techniques.
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]
|
|
|
|
|
After all , I need a pdf library to read words in .pdf file ... I was thinking that MFC knows something tricky ...
|
|
|
|
|
mesajflaviu wrote: After all , I need a pdf library to read words in .pdf file ... I was thinking that MFC knows something tricky ...
Why would MFC need to bother about PDF files?! MFC is just a wrapper around Windows API. On the other hand, PDF is one of the several hundred proprietary file formats which is not related in any way with Windows or Microsoft. I wouldn't ever expect MFC to make it easier for me to read PDF files.
By the way, if you do a Google search as suggested by two of us, you'll find a whole lot of libraries/code/exmaples which deals with the subject of manipulating PDF files.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|
|
You are right ... I try http://www.pdflib.com/[^] but I didn't find what I need : to read every string from an .pdf file ... and I was thinking that I could read a .pdf file like an binary file or something ...
|
|
|
|
|
|
I'd recommend Haru[^]. Just do a Google search and CodeProject search as well - there are several articles with examples on that topic.
It was ever thus, the Neophiles will always rush out and get 'The Latest Thing' at a high price and with all the inherent faults - Dalek Dave.
|
|
|
|