|
I have one dailog box with two functions as exercise and monitor...My question is....When i check the exercise check box the monitor should diable...after finishing the exercixe function...automatically the monitor should get enable?My functions are in threads....
How can i ??
PLs help me..,..
|
|
|
|
|
|
Anu_Bala wrote: My question is....When i check the exercise check box the monitor should diable...after finishing the exercixe function...automatically the monitor should get enable?
Use EnableWindow() for this.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Have your worker threads post predefined windows messages (custom user-defined messages) back to the dialog, in the message handler the dialog enables/disables the controls as needed.
It's usually best to communicate with your GUI thread from your worker threads using messages. Takes away a lot of synchronization issues too, since messages are by definition synchronous.
I think there's a good article somewhere on Dr. Joseph Newcomer's site on this subject: www.flounder.net
Good Luck!
Mike Stephenson
|
|
|
|
|
Hi all
I need your guidelines, problem is something like this
I want to add keboard hendling in already existing project.
First Suppose that
1) There is a CList in which many items are there.
2) when user double click on any item(row) of the list then a Tabbed dialog box appears in which we have all the settings related information of selected items.
3) So here I need that dispite of double clicking, user must be able to see same tabbed dialog box by entering to that item
Please help me.
Thanks
|
|
|
|
|
I think you have already written the code for opening that Tabbed dialog box you were talking about. (When double clicked). So your problem is to handle the key press event. You can easily solve this by overriding the PreTranslateMessage() .
Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Thanks for your advise.
Could you please tell me by some code snippet that how can I override PreTranslateMessage()message.
Please reply
Thanks
|
|
|
|
|
rajeevktripathi wrote: how can I override PreTranslateMessage()message
MFC or plain WIn32 ?
~RaGE();
|
|
|
|
|
I am working on MFC based application.
So it should be MFC based.
(Also better if tell me in Win32 for knowledge enhancement)
Please reply
Thanks.
|
|
|
|
|
rajeevktripathi wrote: how can I override PreTranslateMessage()message.
Add a handler for it from the class wizard.
rajeevktripathi wrote: code snippet
Append this code inside your PreTranslateMessage() handler
if(pMsg->message == WM_KEYDOWN)
{
}
</code>
The value at wParam will be virtual key code of the key that was pressed. Its not ascii value or scan code. Please read about virtual key code on MSDN. Handle the key event as you wish. Log it into a file, or execute a function, etc.
Regards,
Rajesh R. Subramanian.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
In the dll project, I use export funciton like this:
extern "C" __declspec(dllexport) START()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
theApp.Start ();
}
In the Main project which use the dll, I write this:
#pragma comment(lib,"xxxxDll.lib")
void START();
...
void CADlg::OnStart()
{
START();
}
When linking ,there is an error:
TestCltDlg.obj : error LNK2001: unresolved external symbol "void __cdecl START(void)" (?START@@YAXXZ)
Why?
|
|
|
|
|
In your application, you need to mark the function as __declspec(dllimport):
extern "C" __declspec(dllimport) void START();
BTW, I assume you've mistyped the function at the top and left out the void keyword. Functions with no specified return type implicitly return int , not void .
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Would anyone know how to obtain the standard USB Interface details (Device , Config and Interface descriptors ) for a USB device ,programmatically on win98 ?
The assumption is that I get pnp notifications for the PNP device , based off a
OnDeviceChange notification to a Cwnd Object .
|
|
|
|
|
I have written a program that stores data in the registry. Now I need to write an uninstaller. How do I clean up the registry programmatically?
My program starts with code like:
SetRegistryKey("Progname");
AfxGetApp()->WriteProfileString("section", "Filename", FileName);
which stores a filename for future use. How do I reverse the effects of SetRegistryKey and/or WriteProfileString to leave the registry as it was originally?
Shraddhan
|
|
|
|
|
I'm using Visual Studio 2003 for an MFC project, and every once and a while (more frequently lately) some of my menu IDs convert from the ID representation (e.g. "ID_FILE_HELLO_WORLD" to the number (e.g. "20412").
Has anyone else seen this bug, and if so, how can I avoid it? It's driving me nuts!
Warren
(sorry, I also posted this in the C++/CLI board by accident)
|
|
|
|
|
Have you checked your resource.h file to check if the resource ID's #define s are still there? I've never come across this problem...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yes, they are okay (and it still compiles fine), it's just when you go into the menu editor all of the ID_... entries are converted to their numbers. It's VERY frustrating!
Count yourself lucky if you don't experience this...
Warren
|
|
|
|
|
This is a well known VS 2003 bug. Annoying huh? It appears to have been fixed in VS 2005.
|
|
|
|
|
Yes it's REALLY annoying. It started out as just a few of my menu items, and now it's "spreading" to quite a few of them! (this is the sort of thing that makes me jealous of those open-source projects - I honestly would spend the time to fix this myself, it would probably be less work than continually repairing my menus)
Is there no work-around? (other than VS 2005)
Warren
|
|
|
|
|
I don't know of any workarounds unfortunately.
|
|
|
|
|
I found this submitted as bug ID: FDBK17799 at Microsoft.
The final (and not so helpful comment) was:
============================
Resolved as Won't Fix by Microsoft on 2005-07-27 at 12:31:15
Thank you for reporting this issue. We've been reproduced the bug for Resource IDs >= 32768. Unless you are using that many IDs we suggest to use Resource IDs < 32768. Sorry for the inconvinience.
===========================
(which conflicts with the ID-range advice from:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfcnotes_tn020.asp
but maybe for the time being, I will change my IDs to this lower range, and take my chances down there
Warren
|
|
|
|
|
I've already posted this question in the XML forum but i got no answer and i think it's more related to programming than XML.
I have hundreds of structs and enums which describe the data in an ECU (engine control unit), fuel map etc.
The headers with thousands of lines are currently written in C and are used for the embedded system and also in the MFC project on the PC side to edit the tables and to communicate with the ECU.
With Microsofts new .net strategy that won't work well anymore because the embedded and desktop world devides in my eyes.
So what i would like to do now is describe the structs in XML and then create headers for C/C#/... from it. Does a common XML and XSLT file for this taks exist? Any examples? Maybe even an interface editor?
Thanks
Andre
|
|
|
|
|
Of course xsl can do it, but u will have to render it into .h files in a pre-compile step.
macros will take less time to write and pre-compile without a hustle.
|
|
|
|
|
The structs don't change anymore, but in cases where they does a pre-compile step could be added to the project.
I would like to see how others have made it before i custom make it, how unions are described and how i can add language specific attributes to the structs.
C++/CLI / C# expects additional keywords like value/ref/public...
|
|
|
|
|
Why won't it work any more? You can use C headers in C++ under .NET
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|