|
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 ?
|
|
|
|
|
Hi,
I have 2 applications, A.exe and B.exe, that have the following
interaction.
A's job is to start and kill B. (LaunchProcess to start and sending
WM_QUIT to kill)
Now I need B to log that shut off, meaning I want A to notify B that it
is going to kill it and I need B to log that info before it receives
the WM_QUIT.
B is a no GUI app, it has a WinMain which does some configuration work
and then calls RunMessagePump, which is also part of my code and it
looks like this :
inline WPARAM RunMessagePump() {
// Run the usual Windows message loop.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
WM_QUIT is sent using PostThreadMessage and as far as I understand I
can not use PostMessage since B does not have any windows.
So I did some web research for PostThreadMessage and it seems like if I
send such msg to a windowless app than DispatchMessage can not handle
that since it does not know what to do with the message and it is
advised to write a thread specific hook, meaning define a callback
function, call setwindowshandler to set the callback and do all my
logging in the callback func.
However, what I do not understand is why changing the RunMessagePump
wont work, its in my code and I can change it. I tried it out and I
never receive the WM_MYMESSAGE, only the WM_QUIT, at least GetMessage
does not return that. One more thing I am concerned about is that the
MSDN documentation says that for messages WM_USER and up I need to
write my own custom marshalling. What does that mean ? What do I need
to write besides the thread-specific hook ?
Also, this all seems really complicated and delicate - any other way I
can let B know that it is going to die soon and therefore it needs to
do some special logging ?
--
Thank you!
|
|
|
|
|
You could use a message-only window[^] in B, that way A could do a normal PostMEssage or SendMessage to that window to do the communication.
|
|
|
|
|
The second process could watch for a specific event to be set, then use MsgWaiForMultipleObjects instead of your GetMessage() as the blocking call.
|
|
|
|