|
The first line should be inside the while loop.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquin, my while loop now works. However for some reason my switch statements are not being run. If you or anyone has any suggestions it would be great.
Thanks again,
Aaron
arrrgh
|
|
|
|
|
Dear All,
I am creating a dialog application using MFC , and in which i am using a "Date Time Picker control"
I want to set the time in format hh:mm.
---------
I have kept ID of control : IDC_TIME
and using the following macro in Initdialog
DateTime_SetFormat((HWND)GetDlgItem(IDC_TIME),"HH:mm");
---------
But it is not serving my purpose. I donot want to make its member variable. Can u make some modification in above code to solve the problem.
Please comment.
|
|
|
|
|
You need to get a pointer to the control - this should work:
-----------------------------
CDateTimeCtrl* pCtrl = (CDateTimeCtrl*) GetDlgItem(IDC_TIME);
ASSERT(pCtrl != NULL);
pCtrl->SetFormat("HH:mm");
-----------------------------
Hope that helps
JohnJ
Time for a but no
http://www.rainbow-innov.co.uk[^]
|
|
|
|
|
I'v built a SDI based application,and create two classes based on CWnd, in the view, i created them and set theirs parent to this view, and want the last window on the topmost, the first on the middle layer, and the view on the back, so i use SetWindowPos() function with the last window class,but it doesnt work,when i click the middle layer window ,the middle layer window appear to the top,why?
Is there anyone can give me any idea?
Thanks anyway!
|
|
|
|
|
|
In my application:
the view be the background,
the 1st CWnd based window be a portrait(middle layer),
and the 2nd be a frame(topmost layer,and with a rect hole in it),
so the three layer can make up a photo,(god,my poor english!),Can you understand?
So,i can't set one window to the other's parent,the two can be moved separately.
|
|
|
|
|
Is it possible to use ModifyStyle function at runtime?
if possible, how?? please help me.
Best regards.
|
|
|
|
|
Like this:
pWnd->ModifyStyle( 0, WS_VISIBLE );
The first parameter is styles to remove, and the second is styles to add. Multiple styles can be combined using the bitwise OR operator e.g. WS_BORDER|WS_CHILD|WS_VISIBLE.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
also, I think that not all styles are modifiable at run time (ie. with ModifyStyle ) once the CWnd is created.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
I have a dialog-based application with a ListBox control on it.
I wanna popup a menu when user click right button on the ListBox.
But in MFC ClassWizard, the framework doesn't deliver WM_RBUTTONDOWN
to me for a ListBox.
How can I do to meet my requirement?
Thanks!
|
|
|
|
|
|
My Scenario:
I’m using MFC on the VC7. I have a MDI application. I wrote a class that delivered from CToolBarCtrl. I created a few button. I added ID and icon on the buttons.
UINT cButtonID[] ={ ID_FILE_NEW
,ID_FILE_OPEN
,ID_FILE_SAVE
,ID_FILE_PRINT
,ID_APP_ABOUT
};
TBBUTTON TBButtons[ICON_NUMBER];
for(int i = 0; i < ICON_NUMBER; i++)
{
TBButtons[i].fsState = TBSTATE_ENABLED;
TBButtons[i].iBitmap = i;
TBButtons[i].idCommand = cButtonID[i];
TBButtons[i].iString = i;
TBButtons[i].fsStyle = TBSTYLE_BUTTON;
}
There is a dialog (CMyToolBar). When the dialog receives WM_CREATE message, I create an object from above class. On the CMainFrame When receive WM_CREATE message, I create two objects from CReBar and CMyToolBar. Object of CMyToolBar adds to Object of CReBar (m_ReBar.AddBar(&m_dlgToolBar)).
(I think, my way is very long. I guess, there is a shorter way, but I don’t know.)
My Problem:
When I click the new file button or open file button on the tool bar, it is run. But when I click the save file button or print button, it isn’t run. What is the problem?
( I know that my English is very bad. I'm Sorry!)
Everybody thanks for your helps.
|
|
|
|
|
It might sound crazy, but try to clear your vc++ project from old temorary files. Delete your ReleaseTemp or DebugTemp. Then recompile the whole application.
I have sometimes a similar problems with my toolbars in VC++ 6.0, if I change something in the toolbar it does not work correctly until I delete all temp files and recompile.
|
|
|
|
|
:(Is there any way of accessing assembly level "Privileged Instructions", like out and in, with out having to write a kernal-mode driver. All I want to do is output a few instruction to a very simple piece of hardware, creating a driver to wrap them seems like over kill. My program, of cource, works with out a driver on Win95 and Win98.
I've already downloaded the "Driver Wizard" from codeproject and generated a project, which I will start working on tomorrow (5/10/03). Because I do not think I have a choice in the matter at this time.
Note: Once the program has insued its instructions, it is no longer required to be loaded in memory for the hardware to work.
Trust in the code Luke. Yea right!
|
|
|
|
|
I needed something like that time ago, so I looked over the internet and found the UserPort driver - it allows to use the in and out asm instructions when is installed & initialized.
For documentation how it works look @:
UserPort doc.[^]
If this is what you want, the google should help you with your next steps
|
|
|
|
|
Thank you very much.
Trust in the code Luke. Yea right!
|
|
|
|
|
hi guys
could some one tell me please how can i create database ".mdb" without using
Access? i've XP installed with office XP when i try to use table made in
Access i get error "Unrecognized file format"
please help
|
|
|
|
|
The issue is that Office is creating a mdb using a newer version of DAO/Jet (the database engine behind Access) and that MFC is using an older version of DAO (because MFC was created when DAO. In order to use the newer version DAO, you need to set an internal variable to tell DAO to use the newer version. Do this before calling ANY DAO routines.
AfxGetModuleState()->m_dwVersion = 0x0601;
Joel Lucsy
|
|
|
|
|
When reading information from the disk drive it's read wrong. Let's say this is the contents of the disk:
B3 2D 02 40 (hexadecimal)
when i read that information into a DWORD it becomes 0x40022db3. Is it possible to read the data so it becomes 0xb32d0240 in my buffer? OK. Let's say i convert this to binary:
10110011001011010000001001000000
Is it then possible to load the data into a struct from right to left instead of left to right?
so if i have this struct and the above data is on the disk, that it would put it in from right to left:
typedef struct {
unsigned int horizontal_size_value:12;
unsigned int vertical_size_value:12;
unsigned int aspect_ratio_information:4;
unsigned int frame_rate_code:4;
} info;
Thanks all!
|
|
|
|
|
I don't know how you're reading your data but I remember that in intel processors data is stored backwards from what you see, which is what is happening in your case. This leads me to believe that you are using assembly (correct me if I am wrong). On the other hand if you want to read data from the right to the left you could do the following (by the way there could be better ways but this is the first solution that popped into my head).
For example:
long lResult;
long lNum = 0xb32d0240;
int iRMBit; // The right most bit
// There are 8 numbers of 4 bits each, a total of 32 bits
for( i = 0; i < 32; i++ )
{
lResult = lNum & pow(2, i);
if( lResult == 0 )
iRMBit = 0;
else
iRMBit = 1;
} // end for
However, I don't see why do you have to go through so much trouble when you can get this data while you are converting the hex number into a binary number. Technically, the above loop is reading the number bit by bit.
none
|
|
|
|
|
Hi,
If I have a App that launch a dialog. After the dialog is launched, I can set the focus into an edit control contained by the dialog. By adding
m_wndMyEdit.SetFocus() into OnInitDialog() and returning false.
How can I do it for a CDialogBar? CDialogBar dont have any OnInitDialog() method?
thanks;)
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Make sure you return FALSE from your OnInitDialog() . Alternatively, you could use GotoDlgCtrl() . Finally, you could set the tab order of your controls so that the edit control is the first one.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
k thanks, But how can I do it for a CDialogBar?
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hye,
I have create my own control which derived from CWnd. In this control their are ScrollBar what I manage in code. I work perfectly except for the mouse Wheel ! I never receive the message WM_MOUSEWHEEL. I also check with spy++ and I didn't receive to.
Who can't I manage the mousewheel for my custom control (MFC) like other windows control. I must had a style to the windows ?
François.
|
|
|
|