|
can any body suggest me how can i devolop an intermediate device driver
passthru driver which can be hyperthreaded in HT multicore machine
vineesh
|
|
|
|
|
I am writing an MFC application which has a CPropertySheet and a number of CPropertyPages. The application uses a manifest to use the XP themed common controls, and in general this works fine.
However, I've got one page of the sheet where the background of the page does not get themed correctly. This seems to be because the only control on the page is a CListCtrl - if I add a CButton or a CStatic then its fine, but I would really rather not add one.
An example of this can be found in XP itself in the file properties dialog - the summary tab on file properties has the incorrect background compared to all other pages. I'm guessing the controls on there are hidden / dynamically created, and so it behaves like an empty page.
Does anyone know why this happens? Presumably there is some behaviour in CPropertyPage that depends upon the child controls? Or is this fundamentally outside of my control, and I should put up with needing a CStatic?
Cheers
|
|
|
|
|
I have never before so much as looked at the docs for GDI+, so please forgive me if my questions are a little too simplistic.
I am thinking of converting my application to use GDI+, but after flicking through the docs on MSDN I'm not sure if there would be an advantage. My app is basically a skinning library. For each window there can be up to 9 bitmaps. Currently I am relying heavily on regions to both draw these bitmaps and to clip windows from parents. Creating a region from a bitmap in GDI is quite painless (using DIBs), but how would it be done in GDI+?
|
|
|
|
|
I'm not sure there would be much advantage, especially after doing it with GDI already.
GDI+ regions are in world coords so they are scalable, according to the docs. Advantage
for you?
I hope you're going to show a screenshot or two at some point.
|
|
|
|
|
Mark Salsbery wrote: I hope you're going to show a screenshot or two at some point.
From this project alone I could probably write about 10 GDI related articles
I'm thinking of converting because of problems I am having with the regions in particular, well more to do with the "GDI Objects" count in the task manager. But to be honest, after looking at the GDI+ docs, it's surprising how close to re-creating the GDI+ classes I have come.
As for the screenshot, I would take me half an hour to find somewhere to host it
|
|
|
|
|
Also from the docs:
Windows XP or Windows Server 2003 supports GDI for compatibility with existing applications,
but programmers of new applications should use GDI+ for all their graphics needs because
GDI+ optimizes many of the capabilities of GDI and also provides additional features.
|
|
|
|
|
Is there some way how to catch all user's clicks in the html document and in the handler obtain interface to the clicked element? (I need to catch clicks to any button or link or anything what causes navigation. Then optionally continue in normal click operation including executing of original element's onclick handler)
Thank you
rrrado
|
|
|
|
|
|
I have a Property Sheet that has three pages. One of the pages contains some edit controls. I have all the data exchange functions set up, blah, blah, blah...and the sheet works great, all data gets exchanged and I can view the changes in the data before I delete the property sheet.
OK. Here's where the problem occurs.
I open a dialog box via AfxMessageBox() to warn the user of a failure before the property sheet and pages are deleted. Immediately after (line after the call to AfxMessageBox()) the dialog is closed the values in the edit controls are reverted back to the values when the property page was first opened. If I comment out the call to the messaged box, the data remains changed.
I've stepped through most of the guts of AfxMessageBox() to find exactly when the data is reverted. Didn't really notice any changes in the data until after I click OK on the message box.
Synopsis:
- Open property sheet
- change data on a page
- click OK
- Data is changed
- Open message box to warn user
- click OK on message box
- Data is reverted
No DDX functions seemed to be called during the call to AfxMessageBox().
Code:
---------------------------------------------------------------------------------
...
//Change the printer values
if (returnValue == IDOK) {
**Data is CHANGED/UPDATED/STORED at this point**
if (generalProperties != NULL) {
//Printer Name
printer->name->replace(0, MAX_STRING, generalProperties->name);
...
}
if (printerControlProperties != NULL) {
//Assuming printer control properties was not open for
// printers that don't have controls
//Open the communication source
PrinterControl * printerControl =
printer->getPrinterControl();
_ASSERT(printerControl != NULL);
//Check for failure
if (!printerControl->openCommunicationSource((char *)
printerControlProperties->connection.GetString())) {
-----> AfxMessageBox(
"Unable to open connection to printer control.",
MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION, 0);
**Data is REVERTED at this point**
}
}
...
---------------------------------------------------------------------------------
End - Code
onfused:
|
|
|
|
|
If I move the message so that I displays after I store the data in another object, I am good. But the funny thing is that it doesn't revert the data if the call is further down in the code....
-- modified at 12:59 Thursday 16th November, 2006
|
|
|
|
|
AfxMessageBox() shouldn't change any data but is anything going on in the calls leading up
to it, like printerControl->openCommunicationSource(...) ??
|
|
|
|
|
openCommunicationSource() is totally disjunct from the page. It's parameter is just receiving a combo-box's value.
|
|
|
|
|
Are using SetModified() when the user changes any items in the dialog?
The code you posted is in an OnKillActive() override?
If using DDX are you calling UpdateData() where appropriate?
|
|
|
|
|
I'm am not using SetModified().
I have OnKillActive() and OnSetActive() overridden to only return TRUE to prevent the changes in the pages from being reverted by the DDX calls when switching between pages (tabs). Will SetModified(TRUE), fix this?
I'm using UpdateData() on my overridden OnOK(), since for some reason the data wasn't being updated (probably due to me not using SetModified()).
I'll try to incorporate SetModified() (which I need to do anyways) and get back with you. Having to redesign a little to accommodate the Apply functionality.
|
|
|
|
|
OK I've modified a few things to handle the Apply functionality, and I am using SetModified().
Everything looks good except, If I apply a change, and then click Cancel, the changes are not updated. I read that OnApply() just calls OnOK(), which calls UpdateData(TRUE), so why are my changes being reverted?
If I make a change and click OK, my changes are stored.
I'm used to Apply storing changes, regardless of clicking OK or Cancel.
|
|
|
|
|
switang wrote: If I apply a change, and then click Cancel, the changes are not updated
Sounds like it's working like it's "supposed" to
To save changes on cancel (not what a user would expect) you'd ned to do the same thing in
OnCancel() that you do in your OnOk() (or wherever you are committing the changes).
Instead of duplicating the code you can add a function that does all the saving and call it
from both places.
|
|
|
|
|
Never mind.
In the midst of restructuring the property pages, I forgot I was still updating the properties outside of the actual property page class. And plus I wasn't overriding OnOK() to update the data.
Still don't know about the message box. Hopefully it won't bother me with the new structure.
|
|
|
|
|
It may have something to do with me not using SetModified()...
-- modified at 12:58 Thursday 16th November, 2006
|
|
|
|
|
Hi,
I'm porting one of the dll from vc6 to vc8. In doing so I have created a complete framework to create a dll and subseqently add atl objects.
By default the framewaork adds the follwoing code in the main app file
class MyClassModule : public CAtlDllModuleT< MyClassModule>
{
public :
DECLARE_LIBID(LIBID_MyClassLib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MYCLASS, "{7C00C752-3DA7-4CB9-B721-7F39F9FEDD2E}")
};
In previos versions of ATL CComModule _Module was used which has been replaced by CAtlBaseModule.
Problem:
There was an extern declaration as extern CComModule _Module in stdafx.h and definition in main app file as CComModule _Module .as CComModule is known to stdafx.h all other classes could use _Module and calls its methods by including stdafx.h
How do I replicate the above behaviour in the new version?
How do I use the functionality of the class MyClassModule in other modules as this class is defined in my app file as MyClassModule but this MyClassModule is not known to stdafx.h and thus all ther classes cannot see the definition of MyClassModule.
|
|
|
|
|
I have a file is one of my projects which stores data and behaves as a circular buffer. Since the data need not be stored continiously in the file, I would like to enable and disable "Read only" property of the file as per the requirement.
So I have written the following code for the file.
ofstream _logs;
const char* _file = "xxx.txt"
ofstream _logs(_file, ios::out,ios::trunc)
The file properties will be handled using the APIs
SetFileAttributes(), GetfileAttributes()
Now I would like to control the data written into file externally from the file properties menu. But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny and the data does not get written into the file.
Please suggest a solution for this.
|
|
|
|
|
koumodaki wrote: SetFileAttributes(), GetfileAttributes()
Should not be any problem with these API's.
koumodaki wrote: But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny and the data does not get written into the file.
Could there be other reason for this ? other that 'readonly' property.
Apprantly it should work.
|
|
|
|
|
koumodaki wrote: But I when I uncheck the "Read Only" check box on the file's property menu from windows explorer, the files still behaves as Read Olny...
How are you verifying this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
There is a thread in my application which should write a data continiously.
As soon as the Read Only property is unchecked, a thread in my application will start writing into the buffer. I am not seeing this happen
-- modified at 10:24 Thursday 16th November, 2006
|
|
|
|
|
Hi just a quick question.
How can i set the style of a ListView control to LVS_REPORT. I have searched and only found a method that doesnt work for VS2003.NET - Basically right click the control and change the sytle property. The property doesn't appear to be there.
I am sure I am missing something simple but oh well cant see the forrest for the trees.
Cheers
Dan
|
|
|
|
|
Its there, in properties-->Appearance-->view .
I'm using VS2005 though.
|
|
|
|