Click here to Skip to main content
15,907,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LPCTSTR and HRESULT Pin
George_George29-Jul-07 19:18
George_George29-Jul-07 19:18 
GeneralRe: LPCTSTR and HRESULT Pin
Shouvik Das29-Jul-07 19:22
Shouvik Das29-Jul-07 19:22 
GeneralRe: LPCTSTR and HRESULT Pin
Shouvik Das29-Jul-07 19:31
Shouvik Das29-Jul-07 19:31 
GeneralRe: LPCTSTR and HRESULT Pin
George_George29-Jul-07 19:46
George_George29-Jul-07 19:46 
QuestionAccess Violation problem Pin
p_26-Jul-07 18:23
p_26-Jul-07 18:23 
AnswerRe: Access Violation problem Pin
Jonathan [Darka]26-Jul-07 20:54
professionalJonathan [Darka]26-Jul-07 20:54 
GeneralRe: Access Violation problem Pin
p_26-Jul-07 21:08
p_26-Jul-07 21:08 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]26-Jul-07 21:20
professionalJonathan [Darka]26-Jul-07 21:20 
No problem, does the debugger indicate which line might be cusing the access violation ?

Try changing the code a little as your error handling could be improved, I rewrote it like this, but obviously have not tested it, so give it a go and see if that improves anything.

int i;
MYSQL *myDB = NULL;
MYSQL_RES *res = NULL;
MYSQL_ROW row;
CString user,pass,aqp;

if((myDB = mysql_init((MYSQL*) 0)) &&
mysql_real_connect(myDB,"localhost","root",NULL,NULL,3306,NULL,NULL))
{
    if(mysql_select_db( myDB,"gourav"))
    {
        GetDlgItemText(IDC_USER,user);
        GetDlgItemText(IDC_PASS,pass);

        if(mysql_query(myDB,"select * from login"))
        {
            res=mysql_store_result(myDB);
            row = mysql_fetch_row(res);
            MessageBox(row[0]);
        }
    }
    else
        MessageBox("Can't connect !\nPlease try later.") ;

    mysql_close(myDB);
}


regards,



Jonathan Wilkes
Darka[Xanya.net]

AnswerRe: Access Violation problem Pin
p_26-Jul-07 22:16
p_26-Jul-07 22:16 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]26-Jul-07 22:19
professionalJonathan [Darka]26-Jul-07 22:19 
GeneralRe: Access Violation problem Pin
p_26-Jul-07 22:31
p_26-Jul-07 22:31 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]26-Jul-07 23:07
professionalJonathan [Darka]26-Jul-07 23:07 
GeneralRe: Access Violation problem Pin
p_26-Jul-07 23:33
p_26-Jul-07 23:33 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]26-Jul-07 23:37
professionalJonathan [Darka]26-Jul-07 23:37 
GeneralRe: Access Violation problem Pin
p_26-Jul-07 23:47
p_26-Jul-07 23:47 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]27-Jul-07 0:02
professionalJonathan [Darka]27-Jul-07 0:02 
GeneralRe: Access Violation problem Pin
p_27-Jul-07 0:09
p_27-Jul-07 0:09 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]27-Jul-07 0:24
professionalJonathan [Darka]27-Jul-07 0:24 
GeneralRe: Access Violation problem Pin
p_27-Jul-07 0:40
p_27-Jul-07 0:40 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]27-Jul-07 0:41
professionalJonathan [Darka]27-Jul-07 0:41 
GeneralRe: Access Violation problem Pin
Shouvik Das27-Jul-07 0:06
Shouvik Das27-Jul-07 0:06 
GeneralRe: Access Violation problem Pin
p_27-Jul-07 0:35
p_27-Jul-07 0:35 
GeneralRe: Access Violation problem Pin
Shouvik Das27-Jul-07 0:45
Shouvik Das27-Jul-07 0:45 
GeneralRe: Access Violation problem Pin
p_27-Jul-07 1:06
p_27-Jul-07 1:06 
GeneralRe: Access Violation problem Pin
Jonathan [Darka]27-Jul-07 1:07
professionalJonathan [Darka]27-Jul-07 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.