|
iam also searching this type of code .
so please tell me where i find that code.
vasu
|
|
|
|
|
how do i open a pdf or doc file from VC++ say on a button click.I want to give HELP to my program in the form of a pdf or doc file and want to be able to open it from my application itself.
|
|
|
|
|
Use ShellExecute or ShellExecuteEx
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
|
thanks appu... it worked...
"Never Judge a book by its cover.. So you can only judge those u love"
|
|
|
|
|
like this
<br />
::ShellExecute(NULL, "open", "iexplore.exe", "1.htm", NULL, NULL, SW_SHOWNORMAL);
whitesky
|
|
|
|
|
when i enter usename and password it will give that incorrect usename and password plz try later option
even that username and password are in the mysql table users
plz tel me or send me any working code
i make a dialob box in mfc which contain two edit controls one for usename and other for password and a button for login
now i made a table users in mysql which contain user names and passwords
now i want when i click on login button the usename and passwrd conformation is made from mysql table and it then login else not
i use this code but ot not works for me plz tel me the code:::
void CPasswordDlg::OnLog()
{
int i, j, k;
MYSQL * myDB ;
MYSQL_RES * res,*res1;
MYSQL_ROW row,row1;
CString sStr, sPwd;
GetDlgItem(IDC_LOG)->EnableWindow(FALSE);
SetDlgItemText(IDC_STATIC, "Logging in. Please wait...");
if ( (myDB = mysql_init((MYSQL*) 0)) &&
mysql_real_connect( myDB, "localhost", "root", NULL, NULL, MYSQL_PORT, NULL, CLIENT_MULTI_STATEMENTS ) )
{
if ( mysql_select_db( myDB, "gourav") < 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;
}
GetDlgItemText(IDC_USER, sStr);
GetDlgItemText(IDC_PASS, sPwd);
sStr = "SELECT * FROM Users WHERE UserID=\'" + sStr + "\'";
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;
}
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]) ;
sPwd = (((row[3]==NULL)||(!strlen(row[3])))?"NULL":row[3]);
GetDlgItemText(IDC_PASS, sStr);
sStr = "SELECT PASSWORD(\'" + sStr + "\')";
if ( ! mysql_query( myDB, sStr) )
{
res1 = mysql_store_result( myDB ) ;
if ( (row1 = mysql_fetch_row( res1 )) )
{
sStr = (((row1[0]==NULL)||(!strlen(row1[0])))?"NULL":row1[0]);
if (sStr == sPwd)
{
SetDlgItemText(IDC_STATIC, "Login Successful.");
}
else
SetDlgItemText(IDC_STATIC, "Incorrect User Name / Password. Please try again.");
}
mysql_free_result( res1 ) ;
}
else
SetDlgItemText(IDC_STATIC, "Could not execute query01 on server.") ;
}
mysql_free_result( res ) ;
}
else
SetDlgItemText(IDC_STATIC, "Could not execute query on server.") ;
exit_here:
GetDlgItem(IDC_LOG)->EnableWindow(TRUE);
mysql_close( myDB );
}
hi
-- modified at 2:13 Thursday 8th June, 2006
|
|
|
|
|
I see your code but whats error you said not work but where?
whitesky
|
|
|
|
|
i send modified code that gine incorrect username and password even username and passwrd r in the mysql, table now wat should i do
if u hav code that do this work then tel me
hi
|
|
|
|
|
Why don't you do a debug session and single-step the code?
Then you will know exactly what's going on, and find out where the problem is.
|
|
|
|
|
I DONT FIND THE PROBLEM IN THAT
hi
|
|
|
|
|
your problem is in VC or Sql
whitesky
|
|
|
|
|
iam using MFC(VC++) anmd backend is mysql
hi
|
|
|
|
|
Then please tell us this:
What is your specific problem? What's not working?
What statement dosen't work?
You can't expect anyone to copy your code, clone your database e.t.c. and then come up with a solution.
|
|
|
|
|
i make a dialog box in mfc which contain two edit controls one for usename and other for password and a button for login
now i made a table users in mysql which contain user names and passwords
now i want when i click on login button the usename and passwrd conformation is made from mysql table and it then login else give incorrect
tel me the code
hi
|
|
|
|
|
HI,
I am using a class derived from CSocket in my application. As when the Socket is sending or reciveing a data and the data not came then it gets blocked. There is a CancelBlocking method in the CSocket.
But how can I programaticaly handle it, when one of the application Client or Server stops sending or recieving dta then other application should not gets blocked.
any idea / link
Thanks
Regards.
|
|
|
|
|
zahid_ash wrote: when one of the application Client or Server stops sending or recieving dta then other application should not gets blocked.
Try the CAsyncSocket Class.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I have already used CSocket in my project.
Should I replace CSocket word with CAsyncSocket , woiuld it not disturb the project.
or how can I handle this with CSocket?
Regards.
|
|
|
|
|
zahid_ash wrote: I have already used CSocket in my project.
Should I replace CSocket word with CAsyncSocket , woiuld it not disturb the project.
or how can I handle this with CSocket?
Try it..
As the CSocket is derived from CAsyncSocket class
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Can i handle this blocking and cancel blocking in CSocket.
Can the timer be helpfull , means if in specific time nothing has been recived or sent then socket use the cancel blocking or so ?
Regards.
|
|
|
|
|
Hi,
yes you can i.e. CreateEvent and use WaitForSingleObject( HANDLE hHandle, DWORD dwMilliseconds ).
-----------
Mila
|
|
|
|
|
Hi I’m making a project.
I’m making a project in vc++.
i have to connect sipx phone with my software. And I have done it successfully.
But the problem Is that when I put the correct info then phone ring up.
I have took a status of sipxInitialize, sipxLineAdd , and other function in SIPX_RESULT variable but these function always return me success.
So how would I check the wrong status.
PLz Tell me the solution.
thanx
Amit Agarwal
|
|
|
|
|
I can use "GetMenuString" to get caption of a menu item which has an ID!but i dont know how to get cation of an menu item which has a submenu(Popup menu)!
Please help me!
Thank!
|
|
|
|
|
Same way....as you are doing but pass the ID of you submenu.
or you can use:
GetSubMenu( int nPos ) const; function.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
I tried,but by that way, i can only receive caption of submenu item,not a popup item!
|
|
|
|