|
|
Hey George, what's up, took another spin on your Wheel Of Questions did you?
led mike
|
|
|
|
|
led mike wrote: Hey George, what's up, took another spin on your Wheel Of Questions did you?

|
|
|
|
|
A dll is broken into 2 parts: code and data.
The first app that loads a dll causes the os to load the code into physical memory and set its reference count to 1. The app also gets its own copy of the dll data block. The os then creates mapping tables for the app that map the app address space to physical address space (or swap file).
Subsequent apps that load the dll cause the os to see it's already loaded and the reference count is just increased. Each of these apps gets its own copy of the dll data block. The os then creates mapping tables ...
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
cmk wrote: causes the os to
All DLL's are not created equal
link[^]
led mike
|
|
|
|
|
Quite right, however a full explanation is beyond the scope of a forum reply - as is evident by the length of the article you linked to (it's a good link, hopefully he will read it).
I figured a simplified version of what would/should happen, in an ideal situation, was sufficient [shrug].
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
cmk wrote: hopefully he will read it
Doesn't matter, even if he reads it he can't understand it. But there it is and the answer to his question none the less.
led mike
|
|
|
|
|
Thanks led mike,
It is really a good document. I read from begin to end and take notes.
My current understanding is, if DLL code is relocation, then it will consume a duplicate copy in memory, or else share a common copy in memory. Correct?
regards,
George
|
|
|
|
|
George_George wrote: Correct?
What? People have written pages and pages of text, and who knows how much code, to account for one simple if condition that you explained in a single sentence. Whatever dude.
led mike
|
|
|
|
|
Hi led mike,
I just summarize. Theory is short.
regards,
George
|
|
|
|
|
|
Also read:
http://support.microsoft.com/kb/100635[^]
http://support.microsoft.com/kb/103858[^]
When thinking about what's in physical memory don't think in terms of the module (dll) as a whole, think in terms of its pages.
Only those pages that have been read will have been loaded from disk into memory.
Only those pages that have been written to (e.g. data page or code page with fix-ups) will have been copied in memory.
At any given point in time a non-copied page could be freed, and loaded again later from the disk when required.
At any given point in time a copied page could be freed from memory and put in the pagefile.
Even after your last app, that uses a given dll, exits pages of the dll may still be using physical memory in the page cache until they expire.
So, the simple answer, the one i originally gave, is usefull for thinking about what happens in general, because thinking about what happens in detail isn't much use.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Thanks cmk,
Let me finally clarify and confirm your points, from simple reply, I think you mean if there is relocation fix in DLL, there is a duplicate copy of page (either in memory or in page file). Correct?
regards,
George
|
|
|
|
|
Hi Experts
I need some Grid Control artical or example.Plz help me
|
|
|
|
|
|
|
|
Hi All,
I am working on a borderless window frame.
Can anyone tell me how can i detect the left and right mouse click on the application taskbar button so that i can minimize,maximize the window and can show the command menu????
Tarun Sharma.
|
|
|
|
|
Why remove the frame window and do extra work to mimic the frame window behavior? I'm baffled. Please explain.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Well i investers don't want the default windows look on the main window,so i removed the border and created my own,where i am showing minimize,maximize and close button and handling all the mouse click events in these buttons. But when i click on taskbar button it doesn't minimize the apllication.
|
|
|
|
|
apply these styles to your window
these will enable sys menu on taskbar button
and will enable minimize & maximize selections on menu
WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
|
|
|
|
|
Well all these three styles are applicable only to windows which have title bar and my window doesn't have any titlebar.
|
|
|
|
|
Hi,
Sorry Only_jack....I again tried using these style and it worked.
But now my window dosen't resize ??????
In my window i was handling all four side resizing and moving by testing NcHitTest.
moving is working but resizing is not at all working!!! I don't get any clue about this.
Can you give some idea about this.
Tarun Sharma.
|
|
|
|
|
this style may add a resize border to your window
WS_THICKFRAME
also check this[^] link for all window styles
|
|
|
|
|
Hi all..
How do i use DrawText in animate window. With the help of animate window i'm popping up my dialog box. And in WM_PAINT i'm using DrawText to put some text on Bitmap. DrawText works fine when i don't use animatewindow. But it didn't work when using animatewindow.
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hDC;
hDC = BeginPaint(hWnd, &ps);
RECT r = {0};
HDC hdc_bitmap_text = NULL;
UpdateWindow(hWnd);
GetClientRect(GetDlgItem(hWnd, IDC_NEW_BITMAP), &r);
hdc_bitmap_text = GetDC(GetDlgItem(hWnd, IDC_NEW_BITMAP));
if(hdc_bitmap_text)
{
SetBkMode(hdc_bitmap_text, TRANSPARENT);
SetTextColor(hdc_bitmap_text, RGB(0,0,0));
DrawText(hdc_bitmap_text,
iCm->BitmapMessage,
-1,
&r,
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
ReleaseDC(GetDlgItem(hWnd, IDC_NEW_BITMAP), hdc_bitmap_text);
hdc_bitmap_text = NULL;
}
EndPaint(hWnd, &ps);
break;
}
modified on Thursday, October 16, 2008 7:25 AM
|
|
|
|