|
Your app has to have the input focus in order to handle mouse messages. When your app is minimized it does not have the input focus. The only work around that I know of is to setup a global hook. See SetWindowsHookEx(WH_MOUSE, ...) in MSDN and do a search here on CP for "Global Hooks"
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Not a good idea,
that's because - app is beign developed on the PPC.
Any other idea?
|
|
|
|
|
int01h wrote: The problem is that wm_lbuttondown is not beign received when application is "minimized" - please help, this is really urgent..
Are you sure other messages are received by your application ?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
|
Hello,
I have a quick question about serialization. I have a custom built classe (we'll call it MyClass) that contain standard C++ items (i.e. int, float, etc...), MFC objects (i.e. CString, etc...), a few vectors, and some of my custom classes as data memebers. If I derive it (MyClass) from CObject, can I use the standard MFC Serialize functions to save it (MyClass) to a file?
Thanks in advance,
BP
|
|
|
|
|
|
Thank you, I have looked at the article, it is very good. However, I still don't know the answer to my question. Can I save my class using MFC's serialize function?
Thanks again,
BP
|
|
|
|
|
Hi BP, yes, you can. See this[^] excellent article on (MFC) serialization. My article offers a way to implement serialization without having to derive from CObject .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi
i need to call invoke an mfc callback function from a non mfc dll. How do I that?
any samples that I can look at?
Shree
|
|
|
|
|
shreelak wrote: How do I that?
More specific information is required. However you cannot use any C++ class (MFC included) across modules unless the class is exported from a DLL. I have no idea if that is what you are looking for.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
yes what i meant was that MFC callback function is in a DLL and I can call other functions (not callback) from my calling program (non mfc dll) without any problem.
but when my non mfc dll tries to invoke the callback it doesn't get called
the same thing when called from an MFC program works fine.
So my question was is there some thing different that i need to do when i call it from a non mfc app?
like may be sometime of memory mapping? is there any sample code that i can look at?
-S
|
|
|
|
|
shreelak wrote: but when my non mfc dll tries to invoke the callback it doesn't get called
What does that mean? When you debug the application it just steps over the function without the function executing? Is there an exception? An error reported? what?
|
|
|
|
|
yes it seems like it steps over
When i try to go in to the assembly code it show me a ref to the callback function but doesn't jump to it. instead it comesback to my calling functions next statement.
I don't get any exception.
Also I cut and pasted the same code into another applicaiton (MFC) and it works without any problem.
TIA
-S
|
|
|
|
|
Using VS.NET 2003
VC++ MFC project.
Having a problem with dialog resource copies.
In VC6, I could insert a copy of an existing dialog and for which a class has been created, and then with the dialog editor I could add new controls on this copy and add event handler and variables for these new controls. In VC++.NET 2003 it does not seem to work. I can add a copy but after I add new controls on this dialog copy I cannot add events or variables to them because they are not listes in the Control Events in the properties page.
Steps to reproduce:
1) create a dialog (default template will be enough)
2) Create a class for this dialog
3) Right the dialog in the resource view and select 'Insert Copy', you will have to enter a valuee in the condition field, for example 'TEMP'
4) Add an edit control to this copy of the dialog template
Now, if you right click the edit control and select 'Add variable, the wizard will not have the proper control ID filled in. Also, if you go in the Properties of the dialog and select the Vontrol Events view, the ID for the edit control will not show up.
I had no problem doing this in VS6.
Anyone seen this problem and know a workaround ?
Can anyone tell me if it does the same thing in VS.NET 2005 ?
thanks.
Louis
* google is your friend *
|
|
|
|
|
in 2005 after you copy the dialog into the resource tree you open it in the disigner, right click and choose the "Add Class" menu item. This brings up the dialog where you can add a class derived from CDialog bound to the dialog resource. After you do that adding controls and member variables work as expected.
WARNING: Copy / Paste pattern is generally not a good development approach.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?"
Colin Angus Mackay in the C# forum
led mike
Last modified: Friday, July 14, 2006 11:13:07 AM -- copy / paste warning
|
|
|
|
|
Hi led mike,
My example was for a simple dialog. My situation, and I guess this is something many other programmers have to face, is that I have dialogs that already have a working class with all the code and variables and event handlers doing their stuff. Now, I am adding a copy for this same dialog to add features to it, so logically I will want to use the same code that is already there. The compile condition I add to the dialog copy makes it available only when I compile resources with this condition set. I can add code to the dialog that will also be conditionnaly compiled with the same condition. This makes adding new features to a dialog easy and also is more team friendly.
You are suggesting to add a completly new class to the dialog. This would involve copying all the source from the other class to this new class and then adjusting the class name to match the new. If a modification is done to the original dialogs code (team) it will not be reflected in this class.
Why a copy of a dialog resource would not be a good devcelopement approach ?
Louis
* google is your friend *
|
|
|
|
|
ldaoust wrote: so logically I will want to use the same code that is already there.
I don't understand.
ldaoust wrote: In VC6, I could insert a copy of an existing dialog and for which a class has been created, and then with the dialog editor I could add new controls on this copy and add event handler and variables for these new controls.
When you copied the dialog resource how was the new dialog template associated to the existing class so that class wizard would create the variables for the controls etc.?
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
led mike wrote: I don't understand.
I'm extending the functionality of a dialog. The class is already there. I am adding code to it. So the original dialog is bound to that class, i am working with that class.
led mike wrote: When you copied the dialog resource how was the new dialog template associated to the existing class so that class wizard would create the variables for the controls etc.?
The original dialog template was already associated with the class through the ID of the dialog. The dialog copy uses the same ID , only the condition changes, the association is still with the same class. This behaviour is the same with .NET 2003. If you make a copy of an exisiting dialog (Insert Copy as I described in my original post) and only change the condition, that copy will also be bound to the original class.
Did you try it ?
Louis
* google is your friend *
|
|
|
|
|
ldaoust wrote:
Did you try it ?
Yes in 2003 and with or without the preprocessor macro defined I only get the original dialog so the copied template never executes and controls added to the copied dialog resource never show up in the list of controls in the "add member variable" dialog. Never used this feature before today so I never saw it work in VC6.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Hi,
I am writing an application that has a centeralized file on a network. I want to monitor that file for changes and thought ReadDirectoryChangesW would work nice. My question is does the OS continually hit the disk to seek if it is changed? If so, then what is the difference if I just get the attributes myself? I am worried about excessive network traffic. Having 1000+ workstations hitting the disk just to see if the file changed could be a bottleneck.
Thanks in advance.
Darren
|
|
|
|
|
You should have a small local program monitoring that file and broadcasting a message to notify all the users that it's status has changed.
|
|
|
|
|
eusto wrote: You should have a small local program monitoring that file
This is the whole reason for using ReadDirectoryChangesW() - so that you don't have to waste CPU cycles polling for changes.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
badpicker wrote: ...does the OS continually hit the disk to seek if it is changed?
No. The way to verify this is to use FileMon.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
Can anyone tell me how i can change the color and font of some of my static controls
i dont want to change them all, i would just like some of them changed
thanks
Simon
|
|
|
|
|
implement ON_WM_CTLCOLOR for changing color. There's a simple example in MSDN somewhere
|
|
|
|