|
Use GetMonthCalCtrl to get CMonthCalCtrl from a CDateTimeCtrl. Use SetCurSel to select a date.
Sample from MSDN:
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_DATETIMEPICKER1);
CMonthCalCtrl* pMoCalCtrl = pCtrl->GetMonthCalCtrl();
CTime dt2(1998, 3, 15, 0, 0, 0);
pMoCalCtrl->SetCurSel(dt2);
- NS -
|
|
|
|
|
ok, I think I may not have explained it clearly enough, what I need is for the day field of the control to be selected (i.e. if the user types then the day changes). I'm using a Date Time control which is liniked to a CDateTimeCtrl object.
cheers,
|
|
|
|
|
ShowWindow(SW_MAXIMIZE)Not working properly in 98 machine. ShowWindow(SW_MAXIMIZE) Maximize my application is draw only half of the desktop(screen).If any one know this pls help me.
|
|
|
|
|
Viknaraj R wrote: Not working properly in 98 machine.
Did u have tested it in other OSs? What kind of window you have?
- NS -
|
|
|
|
|
it work properly in xp My window is a dialog in vc++
|
|
|
|
|
Is there any custom painting?
- NS -
|
|
|
|
|
I have a little application called updater.exe. This updater gets called by the other application called someapp.exe. Updater receives three arguments
1. calling application (full path of someapp.exe)
2. location of the installer file
3. installing destination folder
So when someapp.exe calls updater.exe it immediately exits (it will get overwritten). Because this exiting process isn't instant, updater should check if it's still "alive". How can I do this? Can I get some handle from 1st argument and check if application is still running?
Best regards,
Rostfrei
|
|
|
|
|
Will this[^] helpful ?
Regards,
Paresh.
|
|
|
|
|
You could use a kernel object, as describes by Christian Graus here[^].
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
Have the calling process pass a HANDLE to itself to the callee. Make sure this HANDLE is inheritable and then when you call CreateProcess to create the callee ensure the bInheritHandles argument is set to TRUE. The callee can then call WaitForSingleObject passing in this HANDLE to wait until the caller has exited.
Steve
|
|
|
|
|
I have a char* that holds a numeric value of for example: 172,500 and I want to multiply this by another number and write the contents back to a new char*. Could someone give some example code on how to easily achieve this?
|
|
|
|
|
You can use atoi and itoa functions to achieve this.
atoi - converts string to int.
itoa - converts int to string.
|
|
|
|
|
Andy H wrote: for example: 172,500
Actually is there a comma (,) ?
- NS -
|
|
|
|
|
There is a (,) in the string.
What I think I will do is write a class that can cater for all eventualities, as there is also a possibility of the number being in scientific notation, just to make matters worse!
|
|
|
|
|
You can do it simple... first filter out the comma.
If you are using the CString, use str.Remove(',') so that the comma will be filtered. Then you can convert it to integer using atol, atoi, etc., or _ttol, _ttoi, etc.
- NS -
|
|
|
|
|
hi
i am new to MFC and i have a small (my first ) program-sort of schedular program .I want to package it and deploy it to my friends so that they can run 'setup' and install it in their PCs. is it much work to do that and how is it done?
thanks in advance
|
|
|
|
|
You want to make an installer. There's many ways to do this, commercial packages and freeware.
I use "Advanced Installer" -- they have a freeware version... http://advancedinstaller.com/feats-list.html#free[^]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
|
Hi,
Is there any SDK of winzip through that I would be able to create zip file, or is there a way I can create zip file programmatically that can be opened by winzip and winrar utilities.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
|
HBRUSH b = CreateSolidBrush(255);
SetLastError(0) ;
if( DeleteObject(( HGDIOBJ)b) )
{
printf( "brush deleted\n" ) ;
}
DWORD dw = GetLastError() ;
printf( "%d" , dw ) ;
----------------------------------
the above code returned..
brush deleted
0
when i debuggin this app gdi object count is incremented by one from 4 to 5(on windows taskmanager) when calling CreateSolidBrush, the deleteobject function return success but the gdi object count is still at 5.
iam using vs2003 under winxp sp2
thanks....
|
|
|
|
|
I had faced the same issue regarding the brush and pen objects. But I failed to get a solution.
See my post in CP[^]
- NS -
|
|
|
|
|
If you have the GDI object selected into a DC at the time of the DeleteObject() , the object will not be deleted. You must first use SelectObject() to restore the original object, before using DeleteObject() .
|
|
|
|
|
But this issue is not due to that. Even if we just create a brush and delete it very next, this issue exists.
- NS -
|
|
|
|
|