|
i create a CToolBar with no any buttons and dock it, it works well.
next i want to paint it, but i can't.
i override OnPint(), OnNcPaint() and disable WM_ERASEBACKGROUND message etc.
but the tool bar is still painted by microsoft, do u know how to paint it or disable which message so microsoft will not paint it then i can paint myself?
thx
includeh10
|
|
|
|
|
Handle NM_CUSTOMDRAW. You can change colors and button styles in response to that message - see the MSDN docs for the full list of capabilities.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
i create a CWnd with WS_THICKFRAME style (need to resize the window), and want to paint its border.
in OnNcPaint() message, i try all DCs:
1. CPintDC(this), not work, noly for client area
2. CWindowDC(this), only can draw left and top borders, not available for right and bottom borders
3. GetDC(0), OK, but draw on screen DC, sometimes makes screen dirty.
could u give me a hint?
thx
includeh10
|
|
|
|
|
Handle WM_NCPAINT
NC == Non Client
Normski. - Professional Windows Programmer
|
|
|
|
|
before u waste time, read question first, or waste my time also
includeh10
|
|
|
|
|
before you send emails to me, don't be so f***ing rude.
Normski. - Professional Windows Programmer
|
|
|
|
|
Hi,
I have a bitmap file with image size 720*480. Now i want to draw a part of this image, such as draw the image within a rectangle
rect(360, 420, 240, 280). Is there a simple method to do this?
Best Regards,
chen
|
|
|
|
|
BitBlt and StretchBlt both allow you to specify the part of the image to draw.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
it depands speed u need for drawing.
1. if need high speed, u have to draw it from file buffer, in the case, u need to know bitmap format, it is not too hard, but hard to draw because all DC functions are nor available.
2. create a memory DC, display bmp file on it, then draw it with DC functions. if u want to change ur file, save it according to ur memory DC.
includeh10
|
|
|
|
|
Thanks for the reply. It worked!
Best Regards,
chen
|
|
|
|
|
Hi, can someone show me a code or webpage to get size and position of a CDialog? how do I set position and size again? Thanks for help.
|
|
|
|
|
GetWindowRect & SetWindowPos
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hi,
I'm using the function WNetAddConnection2( ) in my application.But on compiling my project it gives the following Linker error.
Generating Code...
Linking...
BackupDlg.obj : error LNK2001: unresolved external symbol _WNetAddConnection2A@16
Debug/Backup.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
can anyone help me?
With regards
Shibu K.V.
Senior Research Associate.
VLSI ASIC Hardware Design Group
Electronics R&D Centre,Trivandrum
India
|
|
|
|
|
I assume your linking in Mpr.lib?
Normski. - Professional Windows Programmer
|
|
|
|
|
Are there any articles on the help features like the "?" box in the right hand corner and things associated with that on this site? I can't seem to find any.
-Raffi
|
|
|
|
|
I have a class which can calculate a mathematics expression,such as "sin(x)+cos(x)",when given a number to x, it could return the value of the expression.It works in two steps:At first,it parses the expression,and then,it calculates.I have a list of x's values,all of them are used in the expression "sin(x)+cos(x)",so they are calculated in the same way,but the class parses the expression for each x value,you see, it does the same work many many times.What can I do if I want the class to parse once but calculate all?
|
|
|
|
|
Make a static array, which is a lookup table. Then each sin or cos is calculated exactly once.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hi All,
I need a Lint checker or something simular for my large C++ program in order to find a bug that is crashing it.
Can anyone suggest a good Lint Checker? Really, I would love a free one??
Thanks !
Philip
|
|
|
|
|
Lint may be of some use, but I'd surprised if it would pinpoint your crash.
Have you tried running a Debug Build under the VC Debugger and inspecting where the crash occures when it happens?
Also have a look at the various BugSlayer articles by John Robbins on the MS MSDN Web site http://msdn.microsoft.com/default.asp and "Improved Error Reporting with DBGHELP 5.1 APIs" http://msdn.microsoft.com/msdnmag/issues/02/03/Hood/Hood0203.asp
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
This is a new one for me.
I have a buffer, i.e., char buffer[100]. I need to copy the contents of the buffer into a BSTR that is already allocated and already has a value. Basically, I need to change the value of the BSTR before I send it to another method that requires a BSTR. I cannot figure out how to do this? Any advice?
Thanks for any help,
Shanti
|
|
|
|
|
comutils.h includes a wrapper class called _bstr_t. You can do this:
HRESULT MyFunc(/*[in, out]*/BSTR * bstr)
{
_bstr_t b_tWrap(*bstr, false); // FALSE means the _bstr_t takes ownership
b_tWrap = mycharbuffer;
*bstr = b_tWrap.Release();
}
Something like that.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
I was interested in this answer too. But, how do you do it in C? Also, how would you convert a BSTR or Variant to a char buffer?. Kind of hard to find examples on how to do these things in C cuz all examples in MSDN etc. only use C++. I'm modifying an existing C program to use COM/OCX and keep running into these kinds of problems.
|
|
|
|
|
JohnnyG wrote:
Also, how would you convert a BSTR or Variant to a char buffer?.
I don't know. There are a range on conversion functions, but I do not know if they are C or C++.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hey, I tried looking up your signature....in regards to a quote from Chris Losinger thinking that must have been an interesting thread but on Nov 7th, 2002, huh???? 11/7/2002 hasn't occurred yet. Typo or deliberate? Hee, hee.
|
|
|
|
|
I don't know the country breakdown for different date formats, but in Australia it's dd/mm/yyyy.
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|