|
|
Thanks for ur response.I solved it. Can u suggest some links for studying memory management
S.Yamini
|
|
|
|
|
|
|
|
I'm working in a VC++ project. In this project I have included some 3DStudioMAX Libraries. This project while compiling gives "Fatal Error: UnKnown MAX Version" C1189. What is the problem?
|
|
|
|
|
Have a look at some of these entries, should give you an idea of what is wrong.
Basically the error is that you are using an unknown version of 3DStudioMAX, check the header file that is producing the error to see why it thinks the version is unknown.
regards,
|
|
|
|
|
Hi Friends ,
I am new to this Forum and to the seamless World of C++.
I have just been assigned the task of managing database updates and i dont have much clue abt it so without beating about the bush ill get to that!!!
In my C++ application the database is read once in the begining into local variables which are nothing but C++ objects acting as a sort of "Logical Cache" ,and the data thus retrieved into cache is processed .
WHile the first process is in progress ,the database gets updated which will be notified to the application ,upon receiving this notification , the application without disturbing the current process , has to update my Cache , so that the latest data is avaialble for the subsequent processes/calls.
I think it might require usage of Multithreading and Mutex,but thats that!
Can somebody help me with some tips or even better some sample code to kick start this activity.
Thanks in advance friends!
C++_Newbee
|
|
|
|
|
C++_Newbee wrote: WHile the first process is in progress ,the database gets updated which will be notified to the application...
If the application is already being notified of the update, then you've got the hard part done. All you need to do now is call the routine that queries the database, and then update the UI.
Yes, you can use secondary threads for (some of) this, but they are not for the faint of heart. Unless you use them exactly right, they will cause more problems than they solve.
"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
|
|
|
|
|
Thanks...
DavidCrow wrote: Yes, you can use secondary threads for (some of) this
Is there any other method other than threads , with which i can achieve the application processing its current call with the old data , and at the same time it updating the Logical Cache with the new data , for subsequent calls.
|
|
|
|
|
Hello,
i redirect the output flow of stdout with a pipe to a buffer.
Is it also possible to catch the position and color of the font & background?
Big thanks
|
|
|
|
|
To know the colors used you can use ReadConsoleOutput .
To know tho cursor position I think you can use GetConsoleSelectionInfo .
Russell
|
|
|
|
|
Big thanks!
It works great, but not with PDCurses
|
|
|
|
|
Hi all,
How can one catch the event of the 'End Task', generated from the task manager window? Why do I want to know, to prevent users from closing certain applications.
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I think you'll find it impossble to stop the user unless they don't have permissions to end the task, have you thought about making you application a Service ?
|
|
|
|
|
I know there is a WM_QUERYENDSESSION message which will occured during shutdown.
If u can Dream... U can do it
|
|
|
|
|
Hello All..
I am trying to draw a bitmap as background for the status bar. I have derived my own status bar from CStatusBar. When I try to override OnPaint ().. it erases the default status bar messages and panes.. I tried to change the Device Context on OnCreate () and OnNCPaint () both are not working here is the code.
<br />
void CMyStatusBar::OnNcPaint()<br />
{<br />
CDC* pdc= GetWindowDC();<br />
<br />
CDC memdc; <br />
memdc.CreateCompatibleDC(pdc); <br />
memdc.SelectObject(m_hBmp); <br />
pdc->BitBlt(0, 0, <br />
m_rectLogo.Width(), <br />
m_rectLogo.Height(), <br />
&memdc, 0, 0, SRCCOPY); <br />
<br />
ReleaseDC(pdc); <br />
}<br />
<br />
int CMyStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CStatusBar::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
<br />
m_hBmp = (HBITMAP)LoadImage(AfxGetInstanceHandle(), <br />
MAKEINTRESOURCE(IDB_BKCOLOR_BMP), IMAGE_BITMAP, <br />
0, 0, LR_CREATEDIBSECTION);<br />
<br />
BITMAP bm;<br />
GetObject(m_hBmp, sizeof(bm), &bm); <br />
<br />
m_rectLogo.left = 15;<br />
m_rectLogo.right = 15 + bm.bmWidth;<br />
m_rectLogo.top = 2 ;<br />
<br />
return 0;<br />
}<br />
Next I tried to create a solid brush (for testing) in OnCreate and tried to select that object but that is also not working
<br />
int CMyStatusBar::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
if (CStatusBar::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
<br />
if (!m_oBrush.CreateSolidBrush (RGB(255, 0, 0)))<br />
AfxMessageBox ("Error in creating brush");<br />
<br />
GetStatusBarCtrl().GetDC ()->SelectObject (&m_oBrush);<br />
<br />
return 0;<br />
}<br />
I am unable to change the DC of the status bar.
Let me know how to draw a bitmap as back ground for a status bar?
Thanks for your time
|
|
|
|
|
Ok . Try CDC->fillsolidrect instead of bitmap painting. iF it not works , problem may with ur dc handle .
If u can Dream... U can do it
|
|
|
|
|
Thanks for quick response. I am looking for chaging the background with an image. The function fillsolidrect changes the full color of the status bar.
|
|
|
|
|
Ok , i tried it and got the result.
try moving the same code to onpaint.
If u can Dream... U can do it
|
|
|
|
|
I tried to override OnDraw () but all panes are not getting painted I am getting solid rectangle image on full status bar. here is the code
void CMyStatusBar::OnPaint()<br />
{<br />
CPaintDC dc(this);
RECT rect;<br />
GetClientRect (&rect);<br />
dc.FillSolidRect (&rect, RGB(255, 124, 20));<br />
}
If I remove FillSolidRect function the status message, panes are not visible.
Please help me out.
Thanks for your time.
|
|
|
|
|
|
Thanks... Here is an easy solution for that, you can call SetBkColor () directly. it will change the back ground color.
m_wndStatusBar.GetStatusBarCtrl ().SetBkColor (RGB ( 255, 255, 22));
Thanks for your time
|
|
|
|
|
Ok. But you said you need to Draw image as a background . I think there is no function to set background image. you need to handle drawitem
If u can Dream... U can do it
|
|
|
|
|
You are right... I could achieve drawing background color, but not image.
Here is the code
<br />
void CMyStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
CDC dc;<br />
dc.Attach(lpDrawItemStruct->hDC);<br />
<br />
CRect rect(&lpDrawItemStruct->rcItem);<br />
<br />
switch(lpDrawItemStruct->itemID) {<br />
<br />
case 0:<br />
dc.FillSolidRect (rect, RGB (255,255,0));<br />
break;<br />
here is the code in mainfrm.cpp in OnCreate () function
for (int i=0; i<4; i++)<br />
{<br />
m_wndStatusBar.GetStatusBarCtrl().SetText("", i, SBT_OWNERDRAW); <br />
}<br />
Since it is owner draw.. DrawItem is called. but FillSolidRect is getting executed but no change in UI. I tried to use CDC functions like TextOut, rectangle,etc.. UI there is no change.
Can you say why is this behaviour? What went wrong
Thanks for your time.
|
|
|
|