|
Does anyone know how to use WTL's CDoubleBufferImpl? Any article about it?
BTW: What's the meaning of "Double Buffer" within "CDoubleBufferImpl"?
|
|
|
|
|
shaohao wrote: CDoubleBufferImpl
Google finds this[^]?
|
|
|
|
|
The WM_PAINT handler sets up a memory DC and calls the derived class's DoPaint() method. That way, all your own window classes don't have to have the boilerplate double-buffering code (create a mem DC, paint to it, blit to the screen when done).
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
All,
I am working on ATL COM DLL and I am writing a DLL which exposes few interfaces to the application. These interfces can be called either from the VBScript or C++ routine. Any rules which i need to follow especially for having a parameter[[IN], [OUT]. As every one knows that VBScript has data type limitations and we can't pass all the parameters as like in normal. For example the IN and OUT parameter will be used to send and receive values from the interfce and should always be having a VARIANT* data type.
For example:
1. STDMETHODIMP CXX::FUNC_XX( BYTE bnl,BYTE bCurrCl,VARIANT* vSData,BOOL boFlag, SHORT *pRetVal)
2. STDMETHODIMP CXXX::FUNC1_XXX(VARIANT* vReconfig,SHORT *pRetVal)
Please let me know if any one is having suggestions or sample ATL COM DLL which can be called from VBScript.
Thanks,
AKS
|
|
|
|
|
Hi
When I started C++ I used MFC. I found CString a doddle to use sadly it turned out to be not exactly the finest of string implementations.
Has this been resolved in the WTL or should I stick with the STL string or lower level self made implementations?
Thanks
Tom
|
|
|
|
|
What versions of ATL, WTL and MFC are you using? If it's the ATL+MFC that came with VS.NET, then WTL uses the ATL CString...which is the same as the MFC one...which is a *complete* rewrite compared to the previous version of MFC.
Otherwise, I think the CString that was in WTL was much the same as the precious MFC one.
Also - what issues did you have with the MFC CString? Not that I've used it that much, I'm just interested
|
|
|
|
|
TClarke wrote: When I started C++ I used MFC. I found CString a doddle to use sadly it turned out to be not exactly the finest of string implementations.
I assume you are referring to how it allocates memory, since other than that, it actually offers many features that even the STL string class doesn't give.
TClarke wrote: Has this been resolved in the WTL or should I stick with the STL string or lower level self made implementations?
The answer to this question largely depends on what you are doing. If you are trying to write portable code, I would use std::string. If you are writing Windows-only code and have need for doing certain kinds of string operations, CString is probably the way you want to go.
The newest versions of WTL/ATL/MFC all use the same implementation of CString. Older versions were slightly different for MFC than the other toolkits.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
|
Firstly, thank you to all of you for your respones
I'm using VS.NET creating code only to be used on Windows.
It's encouraging to hear that CString no longer has the reputation it did whilst in it's VC6 incarnation. The issue that alarmed me was that it was considered inefficient and slow, a heavy weight implementation included to bridge the gap until the STL string was completed. though I never noticed any cost to my programs in terms of speed or size.
"Also - what issues did you have with the MFC CString? Not that I've used it that much, I'm just interested"
My main issue is more with the STL implementaion as CString has never been any trouble to use. Why the STL string does not have an implemmentation of CString::Find, or CString::Format and all those Windows crucial overloads that makes CString a breeze to use I don't know but it's always put me off
Thanks
Tom
|
|
|
|
|
Hi
Does any know of a reason for not utilizing the WTL library when writing ActiveX controls in ATL?
Thanks
Tom
|
|
|
|
|
If you are doing windowless controls, then WTL is pretty much useless. If not, then WTL will serve you well.
--
Not based on the Novel by James Fenimore Cooper
|
|
|
|
|
Thanks
|
|
|
|
|
Hi,
I have an array A[10][2].
The first column of the array consists of marks and the second consists of student code number.
I want to sort the array based on the first column.
How do I use stl::sort() to achieve this?
Cutebug
|
|
|
|
|
You can't - arrays aren't assignable objects (i.e. you can't do x = y; where x and y are of type int[2] ), which is a requirement of any of the mutating algorithms.
I'd suggest you use records instead (oh, and std::vector s for storage rather than arrays):
#include <algorithm>
#include <vector>
struct Mark
{
int mark;
int studentCode;
};
bool operator<(Mark const& left, Mark const& right) { return left.mark < right.mark; }
int main(int, char**)
{
std::vector<Mark> marks;
std::sort(marks.begin(), marks.end());
}
Try to forget arrays ever existed...
|
|
|
|
|
Thank you!
Cutebug
|
|
|
|
|
Does anyone know how to use WTL's CToolTipCtrl in dialog box with TTN_NEEDTEXT?
I want to popup a tooltip when mouse hover each control in dialog box.
|
|
|
|
|
|
|
We try to execute a console application as a noninteractive user (NT AUTHORITY/SYSTEM).This console application is supposed to launch an IE process ,and perform certain steps.But it fails to launch the IE browser - is this a characterisitc of such user accounts?If so,is there some way I can make this account launch the browser?I am able to launch the IE broswer successfulyl when i execute as a normal domain account
|
|
|
|
|
Hello, im using wtl to create static text ctrls. The problem is that the background color of these controls does not default to the default color of a plain client window. Which is white in xp and system-grey in windows2000. The color of the static-ctrl is system-grey aswell.
It looks like crap, see it here:
http://hem.passagen.se/storage/bad-color-static-ctrls.jpg
Question: How do i set the background color of the static control, alt, the color of the window, to a default system color which they can share on any windows version.
Im looking for something like AtlGetDefaultGuiFont() but for color.
And how to set it.
Thanks in advance.
|
|
|
|
|
GetSysColor(COLOR_3DFACE) and GetSysColorBrush(COLOR_3DFACE) will give you the colour and a brush. To persuade a static to paint it's background a different colour, the parent needs to handle WM_CTLCOLORSTATIC and return the brush that it wants the static to use.
That help at all?
Steve S
Developer for hire
|
|
|
|
|
It looks like you're drawing a custom background in the dialog. You need to make the static controls' text transparent so that background remains intact.
Handle WM_CTLCOLORSTATIC , call SetBkMode(TRANSPARENT) on the DC, and return a null brush.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Dear All,
I stared using WinDbg for Debugging. I used !analyze extension command for analyzing crashed application dump file . it provides me FAILURE_BUCKET_ID. Please let me know how i will use this bucket id to find out the crash code???
With Regards
Manoj
|
|
|
|
|
The best resource I can offer is to go to All Programs, Debugging Tools for Windows, Debugging Help, look up !analyze in the index, then click the link to 'Using the !analyze extension' at the bottom of the page.
|
|
|
|
|
i have a variable whose type is long*.
i wanna assign it to a CComVariant variable.
//put value into variant
CComPtr< IMyInterface > spInter;
long *p = (long*)spInter.p;
CComVariant vt;
vt.plVal = spInter.p;
//how to get value from variant
CComPtr< IMyInterface > spNew;
spNew = (IMyInterface*)vt.plVal; (i can do this because i know the value type in variant, but how could i do if i don't know the type? should i call changetype() first?but what should i pass into ChangeType(???) as parameter?
-- modified at 1:18 Wednesday 16th August, 2006
|
|
|
|