here's a snippet of the code I'm having trouble with:
Code:
case IDC_GET:
MYSQL *pConnection;
MYSQL_RES *pResult; //pointer to the result set structure
MYSQL_ROW Row;
pConnection = mysql_init(NULL);
SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Attempting to Connect to"));
SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Database......."));
mysql_real_connect(pConnection, "localhost","alakazam","tripletkingsburg","tripletadmin",0,NULL,0);
SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Connected!"));
mysql_query(pConnection,"SELECT * FROM products"); //query the database
pResult = mysql_store_result(pConnection);
printf("\n\nThe Number Of products in the database: %d\n\n",mysql_num_rows(pResult));
SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)printf("%d",mysql_num_rows(pResult)));
mysql_free_result(pResult);
break;
This line is my real problem:
SendDlgItemMessage(hwnd, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)printf("%d",mysql_num_rows(pResult)));
how do I print my results out to the IDC_LIST??
Anybody who has done this please help.
and remember that this is for gui interface not a dos console. I know how to do it in a dos console.