|
Update: Just tried it here, and it works with a ZIP drive as well. The key quoted is the whole key. If you set the default entry for that key to a string, Explorer picks that up and uses it instead when displaying the drive.
|
|
|
|
|
Hi all,
I am a new to MFC/VC++.
I have already asked my question,but I think,experts are unable to understand my question.Once again I would like to explain my question.
I create a property sheet which contains three property pages.
pag1.
pag2.
pag3.
page1 contains three - Text Box.
text1,
text2,
text3
Now, I create thee- member- variable of int type.like
m_ntxt1,
m_ntex2 and m_ntxt3,
I enter two integer value in tex1 and text2.
Finally,When I click 'OK' button on a propety sheet(not on a propery page).It should be displayed the sum of integers(m_ntxt1+m_tex2) in text3 and AfxMessageBox.How to do this.
Thanks
rajesh
|
|
|
|
|
The following is a useful check-up list to accomplish what you describe
1. Create a command handler for the property sheet's OK-button click.
2. In this handler, use GetActivePage to get a pointer to the currently active property page object.
3. Use DYNAMIC_DOWNCAST to cast from the CPropertyPage pointer returned above into your derived class' pointer.
4. Create a function into your derived class that does the following:
4.a. Calls UpdateData(TRUE)
4.b. Calculates m_ntxt3 = m_ntxt1 + m_ntxt2
4.c. Calls UpdateData(FALSE)
5. Now, in the property sheet's command handler, call the derived property page class' function that will calculate the sum.
This approach requires that all the controls (Edit boxes) and the integer variables belong to the derived property page class. If you need to display a pop-up message box, then use a temporary CString object, formatting it with the integer data (CString::Format ), then calling AfxMessageBox and supplying the CString object as the text parameter.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
How to call GetActivePage?
rajesh
|
|
|
|
|
This function is defined in CPropertySheet class, from which you have derived your property sheet class. Inside the click-handler function, just call GetActivePage and save the return value into a CPropertyPage -type pointer. This grants you access to the CPropertyPage base class of the object that is currently active.
In here, it is imperative to distinguish between classes and objects. If you feel unsure what their differences are, please look in any given C++ guidebook. Basically, a class is the layout, from which objects (of this class) are built, or instantated.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi!
I am writing MFC SDI. The view is to display graphic objects and needed to be wide. I want to hide menubar, I tried GetMenu, but it does not work. If we can get the menubar m_hWnd, we can use ShowWindow, but I don't know how.
So is there anyway to hide the menubar?
Thanks
sovann.
|
|
|
|
|
Here is a code snipet from MSDN ... maybe you can use this to remove the menu and add it back when required. This code is written in CMainFrame
<br />
SetMenu(NULL);<br />
::DestroyMenu(m_hMenuDefault);<br />
<br />
m_NewMenu.LoadMenu(IDR_SHORT_MENU);<br />
ASSERT(m_NewMenu);<br />
SetMenu(&m_NewMenu);<br />
<br />
m_hMenuDefault = m_NewMenu.GetSafeHmenu();
|
|
|
|
|
This code works! Thank you
|
|
|
|
|
Hi, I am writting an application in which some actions needs to be taken when the system is shutdown or restarted. I have been handling the events using WM_QUERYENDSESSION, but lParam parameter used for it is capable off only differentiating between Log off and shutdown events. In fact all the values remains same for Restart and shutdown.
Is there a way through which i can determine whether the system is shutting down or has been requested to restart?
Mayank Goyal
|
|
|
|
|
HI,
I m using VC++ n Directshow to play a video file (.wmv).
I have a Play and Stop Button on Dialog.
When i press Play Button its starts playing. Stop Button Bcoms Enable n Play button to Disable.
i want to know When the Video becomes end ..
actauly i want Disable Stop Button When whole video is played and it becomes to n end.
any idea .. or help thanx
|
|
|
|
|
Hello all,
i need to make some 256x256 bitmaps from lots of other bitmaps that can be 256x256 and smaller...
how would i set up a loop that can take small bitmaps and add them to a 256x256 bitmap and when full create a new 256x256 bitmap and continue adding until all the small bitmaps are done...
i need to add them without going out of bounds of the 256x256 bitmap and without resizing them to fit...
thanks for any help,
i know how to work with the bitmaps but
i need help with the looping process,
thanks,
[B]*SlimGradey*[/B]
|
|
|
|
|
I have write a service program,now I want to start it when computer appears the login UI,what should I do?
|
|
|
|
|
There are numerous examples on writing services to Windows Plaform available here in CodeProject. Just follow this link to the appropriate section.
If you feel like not following the link, then just go to Code Project main page, browse the left-hand menu down to General MFC/C++ -> System -> Services to find what you need.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I have VS 6.0 and i've been trying to incorporate icons with colors more than 16 but i keep getting a distorted, downgraded appearance. Is there a way to fix this?
|
|
|
|
|
( I'm not in front of VC right now )
did you create icons with bigger palettes ? in VC++6, when you open up an icon, there's a menu somewhere ( in a toolbar ? ) where you can create icons with a different palette. In VC.net, I think it's in a contextual menu when you right click on an icon.
also, I don't believe VC can handle hi-res bitmaps or icons ( more than 256 colors ), yo might need to "patch" them manually in the resources; create a dummy icon file and replace it with a hi-res one, and NEVER editing it in VC.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Hi..can anybody..suggest me How to make timer for
1. Minute
2. Hours
3. days
i.e. User set a time for process to execute after 10 min. then after 10 min. a event is fired & process start running..
this 10 min. can be 10 days...
Plz suggest me how to go next..as I didn't find any timer that even deals with min. or hours..even days r too far. evry timer is based on milisecond..that i don't want...
I hope u'll help me..
Thanks
---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
1000ms = 1sec
60sec = 1min
60mins = 1hour
24hours = 1day
7days = 1week
got the point?
what's wrong with a timer interval of (1000 * 60 * 10) for 10 minutes (just as an example)?
You can safely use SetTimer . There are not "timers for days/minutes" that I'm aware of.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks for reply..
But there must be limit to pass vaue of time in SetTimer function..I'm not sure but that must be 65,000ms
this means I can do with 10 min. interval..but when I wish to do with days interval then it would be problem for program to check over & again...
do u have any idea..
Thanks..bye
sumit_kapoor1980@hotmail.com
|
|
|
|
|
Sumit Kapoor wrote:
But there must be limit to pass vaue of time in SetTimer function..I'm not sure but that must be 65,000ms
Nope, it's about 4 billion ms...
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"
|
|
|
|
|
You could use a couple of CTime objects to keep track of the start and current time. The start time is set when your program starts (you can do this in your dialog's OnInitDialog() handler). Set a timer to fire every second (since this is the resolution you want to honor) and in your OnTimer() handler, do the following:
CTime tmNow = CTime::GetCurrentTime();
int nElapsedSeconds = tmNow.GetTime() - tmStart.GetTime();
if (nElapsedSeconds > ...) {
}
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
the simple code is this
CString m_szCurrentTime;
CTime time=CTime::GetCurrentTime();
m_szCurrentTime.Format("%d : %d : %d",time.GetHour(),time.GetMinute(),time.GetSecond());
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Yup,
I think CTime and CTimeSpan are the way the go.
Look them up on msdn. You'll figure it out.
Good luck!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
hi pple,
i'm working on a program that calculates the percentiles of the sample in an array. i'm not sure how to go about this. any suggestions welcome. thanks
|
|
|
|
|
Hi...
Do u means Percentage of each element of array...?????????????
if yes then use
iNewValue = iArrayElement[i] * ( iPercentageWanted/100);
also..be clear to your question..as i didn't get what u want..just trying..
OK! Good Bye
Never consider anything Impossible before trying to solve that..---Sumit Kapoor--- sumit_kapoor1980@hotmail.com
|
|
|
|
|
hmm sorry my question wasnt too clear. this is wot i want, to calculate the pth percentile in an array of numbers
the pth percentile in a list of numbers is the smallest number with at least p% of the numbers less than or equal to it
i tried different books, but am not getting a universal formula for this !
|
|
|
|