|
Hello,
Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How?
Software Developer
Sanjay K
|
|
|
|
|
no, a DLL always requires a process to be loaded into else into which memory address space would it go ?
Why would you want to do this ?
|
|
|
|
|
SanjaySMK wrote: Even if no process is referring to a DLL after using it for some time, can we still keep it loaded in memory? How?
Until FreeLibrary() is called, it will remain in your process' address space.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think that if the process which is using DLL still exist, then the dll will also remain in memory whether you use it or not.
To Remove the dll, use FreeLibrary. But that will only remove dll loaded with LoadLibrary.
But what you will achieve with that ?
|
|
|
|
|
From the MSDN:
Each process maintains a reference count for each loaded library module. This reference count is incremented each time LoadLibrary is called and is decremented each time FreeLibrary is called.
A DLL module loaded at process initialization due to load-time dynamic linking has a reference count of one. This count is incremented if the same module is loaded by a call to LoadLibrary.
|
|
|
|
|
Hi, I'm using this control (report style, single selection, only text, no header, one column) with LVS_EX_TRACKSELECT | LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE .
How I can get item text when mouse cross over item? Is it with LVM_GETHOTITEM message or how?
Thanks for help!
|
|
|
|
|
How I can get item text when mouse cross over item?....
When exactly you wnat to retrieve text from List control?
Please write in brief
|
|
|
|
|
When mouse holds for a brief time my item is hilited, at that time I need to get index of that item so I can get items text!
Thanks.
P.S.
The question is can I monitor some message. I cant just use GetHotItem function I need to do so on a special moment (when hilited)!
|
|
|
|
|
I don't know how to do it with the messages that you are trying, but what do you think about...
If you move the mouse, reset a timer that counts while the mouse is quiet.
If the timer ends its count and the pointer is in the ListCtrl area (you can easyly make a PtInRect with the corners of the ctrl) you can emulate the click of the mouse
and then you get the hitlited and the row number with the NM_CLICK like:
int CView::OnClickListCtrl(NMHDR* pNMHDR, LRESULT* pResult)
{ int nRowNum = -1;
POSITION pos = m_clcMyListCtrl.GetFirstSelectedItemPosition();
while (pos)
{ int nPos = m_clcRuleList.GetNextSelectedItem(pos);
nRowNum = nPos;
}
return nRowNum;
}
With this you have the number of the row, and can use it to get the item text and anything you want
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
The Messages which are post,they are synchronized due to message queue.What about the messages which are sent?
never say die
|
|
|
|
|
I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type.
This is a part of MS Windows that has evolved over the years, working slightly differently in older versions.
However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que.
To read more about messages and message queues, the MSDN has an excellent article located here:
http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^]
Best Wishes,
-Randor (David Delaune)
|
|
|
|
|
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place
-- modified at 0:41 Thursday 20th September, 2007
never say die
|
|
|
|
|
I just read in the msdn Messages sent between threads are processed only when the receiving thread executes message retrieval code.May be the message retrieval code does the synchronization .If any body knows more than this please share it
never say die
|
|
|
|
|
Do you know what a message queue is?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is a thread specific message queue for GUI/non-GUI application. It stores the messages post by system or some other application.The thread retrieves the messages from its message queue using GetMessage or PeekMessage .If i m wrong somewhere pls rectify it.
never say die
|
|
|
|
|
The MSDN is somewhat misleading in that it states: "directly calls the WndProc"
This is only true if the window belongs to the same thread executing SendMessage()
In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed.
If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que.
Hope it helps,
-Randor (David Delaune)
|
|
|
|
|
Thanks a lot
never say die
|
|
|
|
|
Hi All,
I want to insert smiley faces in the Rich Edit Control (like Yahoo Chat)...can anyone help me in this issue..
just tell me how to load the smiley and display it in the Rich Edit control.
Thanks in advance,
Shiva
|
|
|
|
|
Said smiley face is a graphic, so you'll need to load it like any other graphic, or from the clipboard.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
How can I increase/decrease the size of the property page?
Thanks in advance
- NS -
|
|
|
|
|
There are several article here to solve this problem.
Greetings from Germany
|
|
|
|
|
NS17 wrote: How can I increase/decrease the size of the property page?
The size of the sheet is governed by the size of the smallest and largest pages.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I use a customized tab in the property sheet. I need to extend the page to the border of the tab control. That is what I actually needed.
FYI: I solved the issue by handling the WM_WINDOWPOSCHANGING in the page.
But this solution has disadvantage that i need to do it in all the pages.
- NS -
|
|
|
|
|
And why dont you make a generic function using the identifier of the sheet as parameter? and then call the function changing the parameter when a sheet is becoming visible.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I am sorry. I didnt get you.
- NS -
|
|
|
|