|
Try dropping its files from the project.
Or you could even try hitting 'DEL' on the class in class view. (I think this works, but I am not absolutly sure, and can't test just now.)
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I want ActiveX to be rewritten fast -
for that I want to delegate that aspect to the system
from it's onDraw(),
that is - it would be suffitient to rewrite externally it's region,
like control is unchangeble.
It redraws self each mouse window move over it or
sometimes over container,
it is too slow and uneed!
Drawing is some background vased - that is mean - complex.
But views is not changing really.
I think this can be done by seting
OLEMISC_ACTIVATEWHENVISIBLE flag to FALSE,
but where and how to do it?
I wriye ATL ActiveX control like MSDN sample AtlButton.
thanks you.
|
|
|
|
|
These miscellaneous flags are stored in the registry.
You should have a .rgs file for your control which contains the registry entries to be created when it self-registers. Under the control's CLSID entry, you'll see a MiscStatus entry. It's a bitmask of all the values that are set. Typically the ATL wizard generates a value of 131473, which is hex 0x20191, which indicates the flags OLEMISC_SETCLIENTSITEFIRST , OLEMISC_ACTIVATEWHENVISIBLE , OLEMISC_INSIDEOUT , OLEMISC_CANTLINKINSIDE and OLEMISC_RECOMPOSEONRESIZE .
I'm not convinced that unsetting this flag will help, though - what it will do is only activate the control when it has the focus, relying on a cached image representation of the control the rest of the time.
You might be better off trying to optimise your drawing, e.g. minimise the number of drawing operations, following the batching rules mentioned in the GdiFlush[^] documentation, doing as much work with the selected object as possible (changing objects, for example, pens, causes a batch flush). If your control is windowed, consider making it windowless (draws into the parent window's device context) saving a small amount of time.
|
|
|
|
|
I want to minimize drawing - but -
external functionality looking too much efficient - that is already
moves windows and commands to repaint-
to pver emulate this need much work - this is looking unneed
if in the system already there is it's native (external moving windows) ability to do this.
Do you know how to activate this ?
|
|
|
|
|
Hi,
A really basic and dumb question, this one, but here goes:
I have a dialog box (Windows API, *no* MFC) which contains a progress bar. I want the progress bar to keep looping - ie. to keep filling up, returning to zero, and filling up again. (The reason I want it to behave like this is because the dialog box is part of a wizard that allows users to choose a progress bar style and color for another application, so the progress bar is just for display purposes, to show the user how it would look.)
I feel very dense, but I don't know where to put the code. I have set up my progress bar, and I can loop it using code along the lines of:
progress++;
SendMessage(progbardemo,PBM_SETPOS,progress,0);
progress %= progfull;
(where progbardemo is a HWND handle to the progress bar, progress is an int, and progfull is an int giving the max value).
Where should I put this code? I tried placing it under WM_PAINT, but that was a big mistake as it just meant that everything else in my dialog didn't work!
Also, I am aware that using "progress++" is not really the way to go, as the speed will vary from PC to PC. What is a better way of doing this (using a more time-specific command)?
I'm a novice, so please bear with me - any help much appreciated.
Many thanks,
KB
|
|
|
|
|
Create a timer (in OnInitDialog() ) and step the progress bar in OnTimer() . See the WM_INITDIALOG and WM_TIMER documentation for details. Also see SetTimer() and KillTimer() .
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank you! I managed to get it working by looking up all the commands you suggested on MSDN.
Thanks again, much appreciated!
Cheers,
KB
|
|
|
|
|
Excellent! Glad I could help!
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am building a list control and I want to add a property "DataSource" to my list that binds the list to a data source existed in the same form. How can I do this?
|
|
|
|
|
Hi,
I have a picture control where i display the image with scroll bars. I do draw a selection rectangle over the bitmap. It is working fine. But when i scroll through the image selection rectange doesn't match with the selected image. ie selection rectange moves fast towards left than the image.
Here is my logic
ConvertClientToImageREct()
{
m_bmprect.left =(the_xoffset+(floor)(in_ClientRect.left/m_XZoom)) ;
m_bmprect.top =(the_yoffset+(floor)(in_ClientRect.top/m_YZoom));
m_bmprect.right =(m_bmprect.left+(floor)(in_ClientRect.Width ()/m_XZoom));
m_bmprect.bottom =(m_bmprect.top+(floor)(in_ClientRect.Height ()/m_YZoom));
}
ConvertImageRectToClientRect()
{
the_MyRect.left=the_xoffset< m_bmprect.left?(m_bmprect.left-sourcex)*m_XZoom: -1;
the_MyRect.right=the_xoffset< m_bmprect.right ? (m_bmprect.right-sourcex)
m_XZoom:-1;
the_MyRect.top =the_yoffset< m_bmprect.top ? (m_bmprect.top-sourcey)*m_YZoom:-1
the_MyRect.bottom =the_yoffset< m_bmprect.bottom ? (m_bmprect.bottom-sourcey)*m_YZoom:-1;
}
I am diaplying the image using StrechBitblt() as follows
dc.StretchBlt(the_rect.left,the_rect.top,he_rect.Width (),the_rect.Height (),&bmDC,sourcex, sourcey,m_bmp.bmWidth/m_XOrgZoom,m_bmp.bmHeight/m_YOrgZoom,SRCCOPY);
Can anyone tell me where i am doing wrong?
Regards
Neha
|
|
|
|
|
Hmm, this is odd. I'm using GetKeyState(VK_CONTROL) to see if control key is depressed. I have an integer set to that. Now i read on msdn that if the key is pressed, GetKeyState should return 1, otherwise 0.
However, when i stepped-thru my program, when it was depressed, the value was either -127 or -128 (it alternated, once it was 7, once 8, once 7, and so on.) Anothering i noticed, was that when the ctrl key was pressed, other keys had abnormal values. For instance, in the OnChar function i have, if the user held control and hit the letter 'd', nChar would be equivalent to 7. d was equivalent to 4, a = 1, b = 2, c = 3, and so on. Now i looked at www.asciitable.com and i didnt see any numbering system that starts with a = 1 and increments with each letter. Normally, nChar would be equivalent to the dec. value of the letter, but here, it isn't.
Des anyone know why this is happening?
*.*
cin >> knowledge;
|
|
|
|
|
Only two of the bits are documented: bit 0 and bit 15.
Bit 0 only has meaning for keys which switch a mode on or off, for example, Caps Lock, Num Lock, etc. If bit 0 is 1, the mode is on, otherwise, it's off. If the caps lock indicator light is on, and you call GetKeyState(VK_CAPITAL) , bit 0 will be one. Test this by masking this bit using the & operator.
Bit 15 always has meaning, and indicates whether the key is currently down (1) or up (0). Test by using the bitmask 0x8000 .
For example:
if ( GetKeyState( VK_CONTROL ) & 0x8000 == 0x8000 )
{
} The character value of a character when Control is pressed is a holdover from DOS: Ctrl+A produces 1, Ctrl+B 2 and so on, through to (I think) Ctrl+] which produces 27 (normally ESCAPE).
|
|
|
|
|
keegan wrote:
I'm using GetKeyState(VK_CONTROL) to see if control key is depressed.
GetKeyState() is probably not the right API. MSDN says: "The key status returned from this function changes as a thread reads key messages from its message queue. The status does not reflect the interrupt-level state associated with the hardware. Use the GetAsyncKeyState function to retrieve that information."
About GetAsyncKeyState() MSDN says: "The GetAsyncKeyState function determines whether a key is up or down at the time the function is called."
So GetAsyncKeyState() is what you want. You can call it like this:
BOOL bScrollLockDown = GetAsyncKeyState(VK_SCROLL) >> ((sizeof(SHORT) * 8) - 1);
keegan wrote:
when the ctrl key was pressed, other keys had abnormal values. For instance, in the OnChar function i have, if the user held control and hit the letter 'd', nChar would be equivalent to 7. d was equivalent to 4, a = 1, b = 2, c = 3, and so on. Now i looked at www.asciitable.com and i didnt see any numbering system that starts with a = 1 and increments with each letter.
The CTRL+key is ancient ASCII. You can see a chart here.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hi there,
Kindly tell me how can we retrieve the icon associated with a file which is defined by the application used to build that file.
Actually I've got a list of files which I want to display in a List Control along with the icon associated with it.
Regards
Gaurav
Gaurav Gumber
|
|
|
|
|
How about FindExecutable() and ExtractIcon() ?
|
|
|
|
|
Here's a function I use:
HICON GetFileIconHandle(CString cstrFileName, BOOL bSmallIcon)
{
SHFILEINFO sfi;
if (bSmallIcon)
{
SHGetFileInfo((LPCTSTR)cstrFileName,
FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES);
}
else
{
SHGetFileInfo((LPCTSTR)cstrFileName,
FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_LARGEICON | SHGFI_USEFILEATTRIBUTES);
}
return sfi.hIcon;
}
Jason Henderson "I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it."
- Jack Handey
|
|
|
|
|
Hi,
I'm using Qt for my application (but my question has nothing to do with Qt) and I'm using a global pointer, qApp.
I can use it everywhere in my classes, without having to do an 'extern'.
How is this possible ? When I want to declare my own global variables and use them in other files, I have to declare them 'extern' ???
Anyone could explain me this ?
Thanks !
Jerome
|
|
|
|
|
I'd imagine it's declared extern in some header file you're including in all your source files. I'm not that familiar with Qt, so I don't know where you'd look.
|
|
|
|
|
In C++. yes.
You need to declare extern to tell the compiler to look for the global variable in the obj files.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi,
I have an MFC application were in a View i dynamically create a set of Controls(Edit,Button etc).At one point i want to destry all the controls created in a view and create new controls.I am using destroy() window to destroy controls before displaying 2nd screen.
But both the screens are messed up..Controls are not deleted on calling Destroy()..Pls help
Thnks
Valar
|
|
|
|
|
Perhaps it would be easier to design two classes derived from CFormView, one carrying the first set of control, the other one the second set.
You could then replace the views as needed.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
Hi all
How i can to get color of pixel on my device context.
I get device context of my dialog box sucessfully and fill necessary rect by black color (COLORREF cr = 0x00000000).I watch so it was succesfully too.But when i get color of pixel from this rect by GetPixel routine it functiont retreive me unexpexcted color (not black)
Why???
Thanks.
|
|
|
|
|
The GetPixel() API expects screen coordinates, not client. You should call ClientToScreen() for your rect before calling GetPixel() .
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
we are developping a screen capture app, but it is too slow.
the steps are:
1. get WindowDC or screen DC
2. create compatible bitmap and DC
3. call BitBlt function to copy image to compatible DC
4. GetDibits of compatible bitmap then save it to a file
the problem is:
step 3 is too slow (over 200 ms), we need to get all info in 30 ms.
we believe that there must be other ideas to do that, because we know many capture apps work very well.
do u have another idea or how to let it work faster ?
thx in advance
includeh10
|
|
|
|
|