|
m_combobox.SendMessage(CB_SHOWDROPDOWN ,(WPARAM)true,0);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Just follow the method below u will get ur rsult.
Right click on the combo box;
Select ‘Properties’ from the list displayed. This will open the ‘Properties’ window;
Click on ‘Event’ tab and place your cursor next to the ‘On Got Focus’ event;
Then, click on the ‘…’ button;
Select ‘Code Builder’ from the code builder window and click on OK.
The following Subprocedure will be created:
Private Sub Combo2_GotFocus()
End Sub
You can also call the function on Event of Mouse Move.
OK
|
|
|
|
|
alternatively you can also use
m_combobox.ShowDropDown();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: alternatively you can also use
m_combobox.ShowDropDown();
if (!pmyComboBox->GetDroppedState())
pmyComboBox->ShowDropDown(TRUE);
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Use the CBS_SIMPLE style.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
How to find the reading order of the language of the current locale or the input language. Are there any APIs available?
Thanks.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Use GetProcessDefaultLayout() .
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks DavidCrow.
Adios,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Is it possible to handle active x control events using COleControl class.
if so how?
|
|
|
|
|
Hi expert
I embed excel to my program and now I can't not open file excel.
How can I open excel file?
Thanks
Ngoc Quyen
|
|
|
|
|
CSpreadsheet class will retrive columns wise data.so download. its as simple as opening a normal file
|
|
|
|
|
From where can i get the CSpreadSheet class.
|
|
|
|
|
download from codeproject website
|
|
|
|
|
Vu Ngoc Quyen wrote: I embed excel to my program...
How did you do this?
Vu Ngoc Quyen wrote: How can I open excel file?
Using what method?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Vu Ngoc Quyen wrote:
Hi expert
I embed excel to my program and now I can't not open file excel.
Which Interface are you using?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello all's
i am new in VC++ and feel some problem in my program
i am trying to making a login program but in some line
i think i am wrong .The code of that line are below
can any one help me and also tell me where i am wrong
int i, j, k;
MYSQL * myDB ;
MYSQL_RES * res,*res1;
MYSQL_ROW row,row1;
CString sStr, sPwd;
SetDlgItemText(IDC_STATIC, "Logging in. Please wait...");
if ( (myDB = mysql_init((MYSQL*) 0)) &&
mysql_real_connect( myDB, "localhost", " ", NULL, NULL, MYSQL_PORT, NULL, CLIENT_MULTI_STATEMENTS ) )
{
if ( mysql_select_db( myDB, "login") < 0 )
{
SetDlgItemText(IDC_STATIC, "Can't select the database !\nTry later.") ;
goto exit_here;
}
}
else
{
SetDlgItemText(IDC_STATIC, "Can't connect to the mysql server !\nPlease try later.") ;
goto exit_here;
}
sStr.Empty();
GetDlgItemText(IDC_USER, sStr);
sStr = "CALL sp_auth_user(\'" + sStr + "\', \'";
GetDlgItemText(IDC_PASS, sPwd);
sStr = sStr + sPwd + "\');";
if (!mysql_query( myDB, sStr) )
{
res = mysql_store_result( myDB ) ;
i = (int) mysql_num_rows( res );
if (i != 1)
{
SetDlgItemText(IDC_STATIC, "Incorrect User Name / Password. Please try again.");
mysql_free_result( res ) ;
goto exit_here;
}
SetDlgItemText(IDC_STATIC, "Login Successful.");
if ( (row = mysql_fetch_row( res )) )
{
sStr.Empty();
j = mysql_num_fields( res ) ;
//for ( k = 0 ; k < j ; k++ )
// sStr += (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k]) ;
sStr = "Welcome - ";
sStr += (((row[2]==NULL)||(!strlen(row[2])))?"NULL":row[2]) ; // Name
sStr += " (";
sStr += (((row[1]==NULL)||(!strlen(row[1])))?"NULL":row[1]) ; // Group
sStr += ")";
SetDlgItemText(IDC_STATIC, sStr);
}
mysql_free_result( res ) ;
}
else
SetDlgItemText(IDC_STATIC, "Could not execute query on server.") ;
Please mailing me
|
|
|
|
|
But what is your problem.
Is the application crashing at some point. or are you not able to verify the user login and password.....
From a look at your code what I feel is there is something wrong in the conditions . given here with the goto exit_here statements ie if the we are not connected to the database you are checking the password.
if ( mysql_select_db( myDB, "login") < 0 )
{
SetDlgItemText(IDC_STATIC, "Can't select the database !\nTry later.") ;
goto exit_here;
}
}
else
{
SetDlgItemText(IDC_STATIC, "Can't connect to the mysql server !\nPlease try later.") ;
goto exit_here;
}
in ti
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 5:29 Friday 9th June, 2006
|
|
|
|
|
My problem is that application is looked after creating database connection
and it not check the below if condition:
if (!mysql_query( myDB, sStr) )
{
res = mysql_store_result( myDB ) ;
i = (int) mysql_num_rows( res );
if (i != 1)
{
SetDlgItemText(IDC_STATIC, "Incorrect User Name / Password. Please try again.");
mysql_free_result( res ) ;
goto exit_here;
}
SetDlgItemText(IDC_STATIC, "Login Successful.");
application are blocked before
plz tell me that the line of code
sStr.Empty();
GetDlgItemText(IDC_USER, sStr);
sStr = "CALL sp_auth_user(\'" + sStr + "\', \'";
GetDlgItemText(IDC_PASS, sPwd);
sStr = sStr + sPwd + "\');";
is correct or not.
Thanking you
Please mailing me
|
|
|
|
|
Hi there.
I have an application that uses CRecordset to query the contents of a large MSSQL database table. The main task of this application is to loop through the CRecordset using CRecordset::MoveNext() and print each record to a file on disk.
Unfortunately, calling MoveNext() with DoFieldExchange causes the SQL database to be queried singly for each and every row - causing performance issues on the SQL Server (there are many thousand records).
To improve the performace, I'm looking at using DoBulkFieldExchange so that more than one record at a time are queried. However, I'm having trouble finding info for this approach on the web.
Q: Is this a wise approach to take (the lack of web resources is making me nervous!)?
If so, any ideas of where I could find good code samples?
If not, what other approaches could be taken?
Any halp would be much appreciated!
Len
|
|
|
|
|
Hi
I am trying to develop an activex control. The control has methods to respond to the WM_KEYDOWN messages and in the test container these seem to be working but when a put the control on a dialog window the control doesn't seem to get the focus - seems to remain with the dialog window as the OK and cancel buttons flash wildly when I press the up and down keys. How can I get the messages through to the control.
Thanks
Andrew Hoole
|
|
|
|
|
What framework (if any) are you using? ATL, MFC?
Steve
|
|
|
|
|
Sorry. I am using Visual C++ 6 and MFC.
Andrew
|
|
|
|
|
Does the control receive the focus and then WM_KEYDOWN messages if you first click it with the mouse?
|
|
|
|
|
No the control is handle mouse message just fine but even after clicking in the window several times the key messages don't get through.
See my further post regarding how I might have fixed it. My concern now is if I have several of these controls on a dialog which one will respond to the messages.
Andrew
|
|
|
|
|
Hi
I have solved my problem by making my control handle the WM_GETDLGCODE and forcing it to return DLGC_WANTARROWS|DLGC_WANTALLKEYS|DLGC_WANTCHARS;
Still to discover if this has further consequences.
Andrew Hoole
|
|
|
|