|
This[^] might help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Thanku so much for the help.. i made it work in my exe... working fine..
One more help how do we find the time of boot up of our system..
thanks again
|
|
|
|
|
What exactly do you mean by "time of bootup"?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
i mean, how can i display the exact time i turned on my PC..
thanks for ur quick response...
|
|
|
|
|
I supose you could try using GetTickCount[^] and then subtract this from the current system/local time to get the time the system was started.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Code-o-mat wrote: I supose you could try using GetTickCount...
Unless the system has been up for longer than 49.7 days.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
True, but what can he do to avoid this problem? Is there some api call that gives him the exact time the computer was switched on even if it happened 2 days ago or somesuch?
I guess he oould check windows's uptime, and if that is longer than what he gets out of GetTickCount then he can calulate how many times that might have overflown to correct the value.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
sonualex wrote: One more help how do we find the time of boot up of our system..
Look at the Win32_OperatingSystem WMI class, specifically the LastBootUpTime member.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi I ahve created a Listbox using myclass which is derived from Clistbox. I want to set the Mouseover effect on the listbox, I mean whenever my mouse moves from one index to other it should be hilighted.
Can anybode please help me..
Please send me some sample code if possible..
Thanks
|
|
|
|
|
As far as i know CListBox doesn't provide you with this feature. You can however try implement it yourself , you would probably need to use an owner drawn list box for this by adding the LBS_OWNERDRAWFIXED style, handle the WM_MOUSEMOVE message, use TrackMouseEvent[^], the ItemFromPoint[^] method.
p.s: CListCtrl however does have an extended style called LVS_EX_TRACKSELECT that probably does what you want, if possible you might try to use CListCtrl instead of CListBox.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I am trying with the below function, but every time its drawing the 1st item only..
basically the GetItemRect() needs the index value as the first parameter, can u please tell how to get the index value of the list box when mouse is moving from one item to other.
my code is like this :
void CTxListControl::OnMouseHover(UINT nFlags, CPoint point)
{
CDC* pDC = GetWindowDC();
CRect rect;
GetItemRect(0,rect);
rect.OffsetRect( -rect.left, -rect.top);
CBrush brush( RGB(0, 0, 255));
pDC->FillRect(rect, &brush);
}
|
|
|
|
|
See ItemFromPoint[^], as i already wrote.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
We know that in a 32 bit system a 4 gb memory gets allocated to a process.
So how much maximum memory can be allocated using a malloc function call?
|
|
|
|
|
That depends on what OS you will be using.
|
|
|
|
|
Thanks Niklas for the inputs
If suppose I am using a 32 bit windows or linux OS then what will be the limit?
|
|
|
|
|
Again it depends on the OS.
In window, usually a process can take only 2GB of memory( User mode ), the remaining 2GB is reserved for Kernal mode.
Again among this 2GB, some memory will be already taken by process, for loading exe, dll, heap, stack etc. So technically, the maximum about of memory that you can specify in malloc is always less than 2GB and the excat value depends on various factors I mentioned above.
I dont know about Linux
|
|
|
|
|
rupeshkp728 wrote: We know that in a 32 bit system a 4 gb memory gets allocated to a process.
It's 2GB unless the /3GB startup switch is used.
rupeshkp728 wrote: So how much maximum memory can be allocated using a malloc function call?
Since it has to be contiguous, no more than 2GB, but realistically it will be less.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Thanks David for the solution
|
|
|
|
|
That's a bit like asking "how long is a piece of string?"
Here's why...
- Every process is given it's own address space to run in. Depending on where the OS and compiler conspire to load your code will determine the largest lump of memory you can allocate
- The OS may allocated loads of other guff which will restrict where the compiler can stick it's heap
- The OS may have extra overheads managing it's heap (e.g. Windows having different heaps for different size ranges of allocation)
- How malloc is implemented on top of the underlying OS can also mess things up
- The computer may not have enough disk space or memory to service your request
So to find out how much you can allocate try it! Do a malloc for INT_MAX bytes and if that fails divide the size by 2 and try again. You can use something a bit more sophisticated but you really need to try it on a particular system with a given compiler and load to see what happens.
Cheers,
Ash
|
|
|
|
|
Thanks Ash for the reply.
I tried malloc with INT_MAX and it indeed fails and with your way we can find out how much exactly the memory can be allocated.
|
|
|
|
|
How hash tables are used to quickly locate a data record?
|
|
|
|
|
|
|
Hi!
When I run my application, it crashes and says "SlogOut3D.exe has triggered a breakpoint". When I break the
Exception, it goes to a file "irrArray.h". It stops at the following line:
const T& operator [](u32 index) const
{
_IRR_DEBUG_BREAK_IF(index>=used)
return data[index];
}
Here is the Call Stack:
> SlogOut3D.exe!irr::core::string<char,irr::core::irrAllocator<char> >::c_str() Line 410 + 0x3 bytes C++
SlogOut3D.exe!CGameMenuPlayerProfileState::fillStructure(const irr::core::array<irr::core::string<char,irr::core::irrAllocator<char> >,irr::core::irrAllocator<irr::core::string<char,irr::core::irrAllocator<char> > > > result={...}, playerData profileData={...}) Line 334 + 0x11 bytes C++
SlogOut3D.exe!CGameMenuPlayerProfileState::GUIEvent(CGameManager * pManager=0x0012fdb4, const irr::SEvent & event={...}) Line 168 C++
SlogOut3D.exe!CGameManager::OnEvent(const irr::SEvent & event={...}) Line 171 + 0x1d bytes C++
Irrlicht.dll!1000dccf()
[Frames below may be incorrect and/or missing, no symbols loaded for Irrlicht.dll]
Irrlicht.dll!10002d28()
Irrlicht.dll!1000e1b6()
Irrlicht.dll!101325ae()
Irrlicht.dll!101333b3()
shimeng.dll!6e374435()
gdi32.dll!776f48d9()
user32.dll!76700979()
opengl32.dll!684e834f()
user32.dll!766ffd72()
user32.dll!766ffe4a()
user32.dll!766ffdf3()
user32.dll!7670018d()
user32.dll!766f8343()
Irrlicht.dll!10134005()
SlogOut3D.exe!main() Line 24 + 0x25 bytes C++
SlogOut3D.exe!__tmainCRTStartup() Line 582 + 0x19 bytes C
SlogOut3D.exe!mainCRTStartup() Line 399 C
kernel32.dll!774ad0e9()
ntdll.dll!77a919bb()
ntdll.dll!77a9198e()
SlogOut3D.exe!btDbvt::update() + 0x104 bytes
89cccccc()
How to clear the exception?
|
|
|
|
|
By not indexing out of the array probably...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|