|
In my application I trap the end of entering text in an edit control with an OnKillfocus... function. When I press the ENTER key the commands in the OnKillfocus... function are executed but then my entire application terminates. I use GotoDlgCtrl(...) to set the focus to another control which works but then the application terminates. Do I need to trap the ENTER key and do something else? Thanks.
|
|
|
|
|
Is it a dialog-based application ?
If so, then pressing Enter is the same thing as clicking on the default button, which generally is Ok. What happens is that when you press Enter, the focus first moves from the edit box to the default button (thus firing the OnKillFocus event) and causes a click on the default button, thus terminating the application.
To fix this, change the default button of your application to something else. Alternatively, you can trap the enter keypress (WM_KEYDOWN event) or override the default OnOK handler, omitting the call to CDialog::OnOK, which will terminate the dialog.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thank you very much. That's kinda what I thought was going on but wasn't sure how to deal with it. Thanks again.
|
|
|
|
|
Dear:
I wondering what is the best technique to do with ISAPI filter to determine user trends when visiting web site .
so I can determine if user scraping my site or s/he just observing normaly.
Regards
|
|
|
|
|
Dear all,
I am looking for .DBF file format descriptions. I want to write an empty DBF file header, which contains only column informations (how many columns does a record contain, what is the type of each column). I am wondering where can I find descriptions for each field (bit/byte) of .DBF file. And where can I find free and open source libraries which can be used to generate .DBF file according to column informations. I am using .DBF for Visual Foxpro 6.0.
Thanks in advance,
George
|
|
|
|
|
Hi,
I am using ClistCtrl in my project, I use a large icon (100 x 100) pixel,
I want to draw a text on the icon.
Can any one give me a manner to do this.
Thanks in advance.
|
|
|
|
|
Hello friends,
Whenever we Click an Image present in the ListControl, the image will be shown as selected by selecting the whole image and displaying in some color. But I want to display on Border to be displayed whenever I click the image. Somewhat like the ThumbNail View in the Windows Explorer. there if we selected any directory then only the directory will be focused by displaying the border in blue color.
Thank you,
Bye
|
|
|
|
|
I want to create MDI app which is going to start with dialog, not with child frame on start up. If I use the Wizard to create the MDI app, and start the application, I get the child window opened on start up and I don't know how to remove it.
I want to go to the File menu, chose New option and start the dialog, not the child window.
Help me please!!!!!!!!!!!!!!!!!!!1
Thanks in advance!!!!!!!!!!!!
|
|
|
|
|
Try
cmdInfo.m_nShellCommand = CommandLineInfo::FileNothing;
after
ParseCommandLine(cmdInfo);
within the InitInstance()
MfG
Gérard
|
|
|
|
|
Thanks for answer.
I'll try it, and I'll see if it works.
Thanks again!!!!
|
|
|
|
|
Hi Guys,
i've derived a class from CRecordset like so
=========================
class myrec : public CRecordset{
myrec():CRecordset(&MyDatabase){/*do stuff etc*/}
============================
lets say I have a member function called AddCustomer(); //yes i know
the function needs to call CRecordset::AddNew() or CRecordset::Edit() (inherited from CRecordset) like this:
===========================================
BOOL myrec::AddCustomer(Customer & xr_Cust){
//for clarity
if(CanAppend()&&IsOpen()){
TRY{
AddNew(); //on some systems folowed by Requery()
this->Number = xr_Cust.Number();
this->Name = xr_Cust.Name();
etc etc
=========================================
BOOL myrec::EditCustomer(Customer & xr_Cust){
if(CanUpdate()&&IsOpen()){
TRY{
//put curser at right record, then:
Edit();
this->Number = xr_Cust.Number();
this->Name = xr_Cust.Name();
etc etc
==========================================
in all the examples i've seen are like this:
CRecordset x(CDatabase * bla_bla);
x.AddNew(); //or .Edit()
x.field_in_database = "hello";
i'm not sure how it does this since x does not have a member field_in_database, the database does!
so how are we accessing it using the dot operator? (no it's not overridden, i think);
and even if it did work in their examples it certainly does not in my derived class when i try this:
==============================================
this->Number = xr_Cust.Number();
==============================================
it simply tells me that "Number" is not a member of CRecordset or my derived class (and quite rightly so!)
so if anyone can tell me how to use Edit || AddNew in functions of a derived class please post or e-mail me at:
psycode@webmail.co.za;
please please please!!!!
Consistency is the last refuge of the unimaginative.
Oscar Wilde
|
|
|
|
|
Hello 0100110110,
when you derive a class from CRecordset (or CDaoRecordset) using the Class Wizard it automatically implements the so called DFX mechanism for the exchange of field data between the database table and your recordset class. For each field of the record on the data source the DFX mechanism creates a member variable in the recordset class. I think thats what you are searching for.
Hope this helps
MS
|
|
|
|
|
Hi,
In my application, I've got a multiline edit control, and I would like to be able to dynamically remove/add the horizontal scrollbar. I tried by simply changing the style:
SetWindowLong(hLog, GWL_STYLE, GetWindowLong(hLog, GWL_STYLE) & ~WS_HSCROLL);
Unfortunately, the scrollbar disappears but the space it was using is still there (looks like a disabled area). I've tried to call RedrawWindow() but that doesn't work.
I would just like the edit control to looks like it was created without the horizontal scrollbar.
Any idea?
|
|
|
|
|
I just discover the ShowScrollBar(), it does just what I want
|
|
|
|
|
Hi Everyone !
Do anyone know how i can convert a CString to a TCHAR[1024] ??
Please help !!!
MFG
RedDragon2kx
Unix and C are the ultimate computer viruses.
Visit me: www.programming.info.ms
|
|
|
|
|
CString ?
so you are using mfc?
i am, and use CString::GetBuffer(), followed by CString::ReleaseBuffer();
obviously you have to do something useful with the array (like doing a strcpy() ) as direct changes to it will modify the CString;
also when you call ReleaseBuffer() it realloc's the internal buffer of the CString ie: your array, unless copied, points to undefined memory!
i'm sure there's an easier way, but if you need to get the proj up and running NOW, there it is.
Consistency is the last refuge of the unimaginative.
Oscar Wilde
|
|
|
|
|
It is unnecessary to use GetBuffer() and ReleaseBuffer() when a read-only copy of the buffer is all that's required. For example:
CString str;
TCHAR tch[1024];
strcpy(tch, str);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi,
Can any one explain me how I can...
1)copy a bitmap(CBitmap object) into the clipboard in MFC?
And
2)load a .bmp file into a CBitmap Object?
Please help.
|
|
|
|
|
Can use the following code 4 loading a bitmap
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP);
CDC *pDC = GetDC();
pDC->DrawState(CPoint(70,70),CSize(216,232),bm,NULL);
pDC->ReleaseAttribDC();
|
|
|
|
|
Hello All,
I am trying to make a game for assignment and need to communicate between 2 processes.
I am creating memory map and sharing memory between 2 processes....
After I copy the memory on memory map from the main process, I need to inform the child process to start reading the memory..how can i do this?
is SendMessage a proper way to do it? if yes how do i do this, I just need to find a way to send message from the main process and receive messege in the child process....
any help will be greatly appreciated
Thank you
|
|
|
|
|
Are you talking 2 different applications or 2 different threads?
For applications you need to implement some form of interprocess communication (ipc) in which there are various tried and tested methods, each with their pros and cons. I suggest you read up on these before deciding on an appropriate one.
For threads, your child thread will need to process messages. Then you should use PostThreadMessage()
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Hi,
Thanks for your reply, I am talking about 2 different applications...
for IPC i have already created memory map and i can read data from both application....but the problem is how do i inform processes when they can read data...
|
|
|
|
|
You may want to look at the WM_COPYDATA message. This would be sufficient for notification purposes.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thank you,
I will look into it
I appreciate your help
|
|
|
|