|
Mr David Crow has an article about process on the codeproject Im not sure its your answer or no but see it
|
|
|
|
|
You need to use a performance counter.
Either do this using code, or use Perfmon.
|
|
|
|
|
Let me clarify -- from inside my process.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
With performance counter he can see a lot of detaily of his process(Working set/handle/thread/priority,Mem usage ,...);)
|
|
|
|
|
See if this helps.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You cna 'walk' your entire use of memory using VirtualQuery.
The status returned for each block of memory used tells you if it is read/write, executable, image, etc.
|
|
|
|
|
Hi,
I am not sure if this is the correct forum to post this question.. pardon me.
I created a DLL using VC++6.0 with 3 functions in it.
Now i am using VC++.NET 2003 and i want to import this dll and use the functions. but it prompt me unresolved external symbol.
i have no clue what happen.
any solutions?
or anyone know how to import VC++ dll in VC++.NET 2003?
thanks.
regards,
terr
|
|
|
|
|
Have you linked the .lib for that dll in to your project ?
|
|
|
|
|
hi. tks for the reply.
hmm.. what i did was:
1. i paste the dll file in my debug folder of my VC++.NET application
2. i added the dll.h ( header file ) into my application.
3. i place the dll.lib in the debug folder as well.
4. go to my linker-> additional dependencies-> i included the path to the dll.h
so in my application, i want to use the dll function, eg. installhook()
it prompt me unresolved external symbol
" error LNK2019: unresolved external symbol __imp__installhook referenced in function "public: __thiscall CChildFrame::CChildFrame(void)" (??0CChildFrame@@QAE@XZ)"
in my dll.h, the code is as follows:
------------------------------
#ifdef KEYDLL3_EXPORTS
#define KEYDLL3_API __declspec(dllexport)
#else
#define KEYDLL3_API __declspec(dllimport)
#endif
KEYDLL3_API void installhook(HWND h);
KEYDLL3_API void removehook();
KEYDLL3_API LRESULT CALLBACK hookproc(int ncode,WPARAM wparam,LPARAM lparam);
----------------------------------
what steps did i missed? or the way i link my dll is wrong?
can help? tks.
rdgs, terr
|
|
|
|
|
bengz wrote: 4. go to my linker-> additional dependencies-> i included the path to the dll.h
You need to give .lib path , not headers.
|
|
|
|
|
hi, thats was a typo.
i did entered the path to the dll.lib
so any clues why it still prompt me unresolved external symbol?
also, i never include this dll.lib path, it will prompt me that dll.lib cannot be open. so the program did open the dll but cant recognised the functions. why?
any clues.. need help.
tks
|
|
|
|
|
Did you include lib file (right click on your project and select property then select linker->Input->Additional Dependencies)
|
|
|
|
|
hi. tks for the reply.
hmm.. what i did was:
1. i paste the dll file in my debug folder of my VC++.NET application
2. i added the dll.h ( header file ) into my application.
3. i place the dll.lib in the debug folder as well.
4. go to my linker-> additional dependencies-> i included the path to the dll.h
so in my application, i want to use the dll function, eg. installhook()
it prompt me unresolved external symbol
" error LNK2019: unresolved external symbol __imp__installhook referenced in function "public: __thiscall CChildFrame::CChildFrame(void)" (??0CChildFrame@@QAE@XZ)"
in my dll.h, the code is as follows:
------------------------------
#ifdef KEYDLL3_EXPORTS
#define KEYDLL3_API __declspec(dllexport)
#else
#define KEYDLL3_API __declspec(dllimport)
#endif
KEYDLL3_API void installhook(HWND h);
KEYDLL3_API void removehook();
KEYDLL3_API LRESULT CALLBACK hookproc(int ncode,WPARAM wparam,LPARAM lparam);
----------------------------------
what steps did i missed? or the way i link my dll is wrong?
can help? tks.
rdgs, terr
|
|
|
|
|
Did include dll.lib file to linker-> additional dependencies
|
|
|
|
|
hi..
i did include the C:\dll.lib into the additional dependencies.
it prompt me the unresolved external symbol ( for the functions that i used. )
you know why?
is it because the dll was created using VC++6.0 and i use it in my VC++ .NET 2003 ?
is there any special codes that i need to add?
tks.
|
|
|
|
|
hi tks. i managed to solved the error.
I redo the whole steps again.
tks.
|
|
|
|
|
|
Hi,
I want to safe remove an usb drive programatically .So for that i have followed "Uwe_Sieber" article "How to prepare an USB drive for save removal" in code project .I am able to do it by running the application from another drive.Now i want to safe remove usb drive by running the application from the same drive as per our project requirement.When i tried this the usb drive is not removed.How can i achieve safe removal of usb drive by running the application from the same drive.
Thanks.
|
|
|
|
|
what is the difference between pointer to a function and a function pointer. how to declare these to. how to use it. can anyone explain me. thankx in advance:
|
|
|
|
|
They're the same thing. The syntax is:
return_type (calling_convention * variable_name)(parameter_list); For example:
int (__stdcall* funcPtr)() = NULL; This means funcPtr is a pointer to a __stdcall function that takes no parameters and returns an int , and the variable is initialized to NULL . The calling convention part is optional and defaults to __cdecl in C++ code.
|
|
|
|
|
hi all,
i'm novice in VC++, i tried to create a new dialobox when i click the button setting in my main callback dialog procedure, i tried this code
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_SETTING:
set_dlg =CreateDialog( GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_SETTING),hwnd, DlgProc) ;
if(set_dlg != NULL)
{ShowWindow(set_dlg,SW_SHOW);
}
break;
can i use this method?
thx..
|
|
|
|
|
It looks ok to me. You know that makes it a modeless dialog, right?
Mark
|
|
|
|
|
thx mark for the quick reply,
but i still got nothing when the button pressed, i already build the cpp. files , is there another way? can u explain to me a little bit about modeless,
thx.
|
|
|
|
|
Have you stepped through with the debugger to see where it's failing?
Lots of good info and sample code here: Using Dialog Boxes[^]
|
|
|
|
|
ng4kau1 wrote: set_dlg =CreateDialog( GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_SETTING),hwnd, DlgProc) ;
Here, you have passed same address of diloag procedure(DlgProc ), from which this dialog is supposed to invoke. Why it is so ?
What is not working in this code ? Have you tried to debug the code ? Is is comming in case IDC_SETTING ? Is set_dlg is non - null ?
|
|
|
|