|
The funtions to help you are:
DWORD GetVersion(VOID); Gets the version number of the operating system.
BOOL GetVersionEx(<br />
LPOSVERSIONINFO lpVersionInfo
); Gets the version of the current operating system
lpVersionInfo [in/out] Pointer to an OSVERSIONINFO data structure that the function fills with operating system version information.
Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of the OSVERSIONINFO data structure to sizeof(OSVERSIONINFO).
Windows 2000: This member can be a pointer to an OSVERSIONINFOEX structure. Set the dwOSVersionInfoSize member to sizeof(OSVERSIONINFOEX) to identify the structure type.
Do check at www.msdn.com for detailed and updated description of the above functions
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Hello,
I have a MFC property sheet dialog baised application (a wizard.) I need to use data entered into the second page on the third... does anyone have any information on how I do this?
|
|
|
|
|
The PSM_QUERYSIBLINGS message might be of help to you.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Typically, there is one instance of a class representing the property sheet or wizard that is derived from CPropertySheet, and this has member variables of a class derived from CPropertyPage. Within one CPropertyPage instance, you can use GetParent(), which returns a pointer to your CPropertySheet, but it is typed as a CPropertySheet*, so you need to cast to to a pointer to *your* derived CPropertySheet class. From that, you can access all the children pages, and the member variables and functions within each child page.
|
|
|
|
|
Here is a silly question for you, Graham (can you tell I'm a noob?): How do I cast it to a pointer to my derived class?
|
|
|
|
|
In one of your classes derived from CPropertyPage:
CYourDerivedClass* pYourDerivedClass = (CYourDerivedClass*) GetParent();
|
|
|
|
|
Hi,
how can I make a asynchronous function call?
I want to call a member function of class B from class A, but asynchronous.
my thoughts:
1) using a class C which runs as a thread. Class A starts the thread and C then calls the function of class B.
2) creating a window in class B and sending a messages to B using a message pump
Are there any better ways of doing this?
Thanks
|
|
|
|
|
Why do you want to do this exactly?
PostMessage would be the easiest way. You could just post your CMainFrame class and get it to despatch to the appropriate class. The 'this' pointer could be included as a param to PostMessage().
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Why I want to do this:
I have gota class A with an array of class B items.
Class B owns two items of class C. Class C runs in a thread.
When the thread of class C ends, I want A to remove B from its array. So I must call a function in A from within C (just before the thread terminates). But the function call can never return to C, because it will be killed during this call. So I think this will not work properly. That's why I want this call to be made asynchronous. So the function will return.
Chris
|
|
|
|
|
Does sound like a good approach. One possible solution would be to get C to call A and tell it that C is no longer valid. Then let C delete itself. Next time A tries to access B/C it will test this flag and no it can't. Something along those lines. Or maybe use smart pointers.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hello !
How do i create a Modeless Dialog Box which is to be shown in task bar
|
|
|
|
|
Set the WS_EX_APPWINDOW bit in the extended style. This needs to be done prior to window creation (i.e. specified as part of the CreateWindowEx call).
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
how can you convert a CString to a WCHAR?
Thanks
|
|
|
|
|
First of all there is no real comparison between CString and WCHAR.
If you are compiling under _UNICODE then CString already contains string in WCHAR format.
so...
(LPCTSTR)strTest; // will return you string in WCHAR under _UNICODE.
If you have not declared _UNICODE then you may need to use WideByteToMultibyte api... lookup in the MSDN for further information.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Mr.Prakash wrote:
If you have not declared _UNICODE then you may need to use WideByteToMultibyte api... lookup in the MSDN for further information
should be MultiByteToWideChar..
|
|
|
|
|
thank you.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Hi everyone,
I bussy working on my c++ skills at the mooment and I came across a little hitch that I cannot find the answer to any where on the net. How do you retrieve the file name of your own application at runtime. The reason is that I don't want people to change it and if it is changed then I would prompt to change it back before running the app.
Any Ideas I would be most greatfull.
Kind Regards
Nyhl G Rawlings (in spain)
|
|
|
|
|
|
Thank you, you have been a great help.
I hope to be helping out on here soon, although at the momment I fear I would confuse people if anything.
Kind Regards
Nyhl G Rawlings
|
|
|
|
|
artful wrote:
I hope to be helping out on here soon, although at the momment I fear I would confuse people if anything.
no problem, help in any form is always welcome.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
:-DMany newbie questions are more about C rather than C++, so dive on in!
INTP
|
|
|
|
|
AfxGetAppName
LPCTSTR AfxGetAppName( );
Return Value
A null-terminated string containing the application’s name.
Remarks
The string returned by this function can be used for diagnostic messages or as a root for temporary string names.
GFLPOWER
|
|
|
|
|
Hey, if you are using Windows API to program, you can use the GetCommandLine function to obtain the command line string, and then use CommandLineToArgvW to convert the command line to an argv style array of strings.
Remember, the first argument of the commandline is always the "filename"
Check msdn online resource for details about these functions
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Ahoy there,
I've made this custom list control which supports edit controls, check boxes and combo boxes in its items.
However, I have a minor problem. Say I have restricted the user to only input numbers into the edit control of a specific item. Now, I would also like to verify that the inputted data is between a specific range whenever the user has finished typing (that is, when the edit control loses focus and is destroyed). I do not want to put this verify code specifically in my custom list control class as I want it (the class) to be as abstract as possible. Instead, it should be up to the specific application which uses the control to verify this inputted data. The problem is, however, how I can notify the dialog containing the custom list control about the need to verify some data.
I've tried sending e.g. the LVN_ENDLABELEDIT message but it doesn't seem to be intercepted by the dialog. Also, I've been thinking that one could perhaps pass a function pointer to the custom list control class which the class can then just call whenever it needs data verification.
I'm not sure, though, which one is the best and if my ideas even are preferable.
Suggestions are very welcome!
Thanks in advance,
|
|
|
|