|
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.
|
|
|
|
|
Because after your oncreate the framework again calls some SetText(with default stats messages , in that it is not ownerdraw)for puttif default messages for file -> new ,etc. So ur changes are lost.
If u can Dream... U can do it
|
|
|
|
|
Sorry i forgot to say this , Also put m_wndStatusBar.SetPaneStyle(0,SBPS_OWNERDRAW); in ur on create. 0 -> pane number .
this will be ok.
If u can Dream... U can do it
|
|
|
|
|
How to change a Dialog Form's scrollbar's color?
|
|
|
|
|
try WM_CTLCOLOR
If u can Dream... U can do it
|
|
|
|
|
See WM_CTLCOLORSCROLLBAR .
|
|
|
|
|
Hello Every body,
I had developed an application of attendenceManagement, where Payslip is generated at every 30th of month and that should be sent to each employee mail address, so how can i save a payslip and forward to every empolyee.
Help me.
Sundeep
|
|
|
|
|
Wrong forum, try here, C#[^]
|
|
|
|
|
Oh an C#.Net question on the C++ forum?;)
|
|
|
|
|
Hello
If I want to perform a web based installation like what Symantec anti virus provides for installing updates, what are the things we have to take into consideration. I am new to web based development and unaware of the various factors to be considered during web based development. Is it possible in VC++ ?
Thanx.
|
|
|
|
|
How to write partial scanline to other TIFF file?
|
|
|
|
|
The Tiff file consist of tags and to insert the scan line the 256 and 257 tag should be added to tiff file which denotes the acutal scanline width and hight, and other tags attributes should be filled appropriately.
Its better to insert these tags and scan line data at end, if it is inserted in between then we end up shifting the details of each tag by that offset
I hope this will help in finding the right solutions.
Regards
Sunil Tonger
|
|
|
|
|
Hi all. Im having trouble finding a simple example of CloseHandle. Does anyone know of a place where i can see a simple code using this function? Thanx in advance!
|
|
|
|
|
Please refer http://msdn2.microsoft.com/en-us/library/ms724211.aspx[^].
For example,
HANDLE hFile;<br />
<br />
hFile = CreateFile(<br />
lpFileName,
dwDesiredAccess,
dwShareMode,
lpSecurityAttributes,
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile
);<br />
<br />
::CloseHandle(m_hFile);
|
|
|
|
|
How could you have difficulty ? Did you try google, MSDN, etc ?
Here is a very basic example:
HANDLE myHandle = CreateMutex();
...
if(!CloseHandle(myHandle))
{
}
regards,
|
|
|
|
|
Could someone help me in linking two projects..
I have two projects namely common and iolib...the project common has to access some of the header files in iolib and vice versa.I am using vc++ 2003. I added two projects in under the solution container..I changed the project dependency settings too..but when i build the solution I get errors like
fatal error C1083: Cannot open include file: 'common/EnumsStructsUnions.h': No such file or directory
How do I link two projects so that both the projects can access the header files of each others..
Thanks in advance
|
|
|
|
|
You just need to get the path right. Perhaps something like
#include "..\common\Enums....h"
|
|
|
|
|
I tried that also but still iam getting the error...
fatal error C1083: Cannot open include file: '../common/Constants.h': No such file or directory
|
|
|
|
|
What is the relative path from the file that has the #include to the file you want to include?
|
|
|
|
|
Relative path in the sense..I am not clear with your question..but I can sense something that your aksing for the path information..I am just posting the error msgs which I am getting when building the two projects i.e common and ioLib combinedly..
c:\Documents and Settings\Vijayalakshmi\Desktop\ioLib\ioLib\ModelFileIO.cpp(3) : fatal error C1083: Cannot open include file: 'common/Exception.h': No such file or directory
c:\Documents and Settings\Vijayalakshmi\Desktop\RBF\RBF\common\Model.h(7) : fatal error C1083: Cannot open include file: 'ioLib/NmFileIO.h': No such file or directory
|
|
|
|
|
valli_guru wrote: c:\Documents and Settings\Vijayalakshmi\Desktop\ioLib\ioLib\ModelFileIO.cpp(3) : fatal error C1083: Cannot open include file: 'common/Exception.h': No such file or directory
This is the path the compiler is looking for but it does not exist
c:\Documents and Settings\Vijayalakshmi\Desktop\ioLib\ioLib\common\Exception.h
if Exception.h is in this folder
valli_guru wrote:
c:\Documents and Settings\Vijayalakshmi\Desktop\RBF\RBF\common\
Then the #include in ModelFileIO.cpp should be
#include "..\..\RBF\RBF\common\Exception.h"
You should be able to figure out the other one
|
|
|
|
|
Yes, Its working now..thanks ..thanks a lot...
|
|
|
|
|
valli_guru wrote: thanks a lot
You are welcome. Does it link correctly?
|
|
|
|
|
Yes, it does...It is linking perfectly... Thanks
|
|
|
|