I mean the graph which identifies the intesity of the sound and varies...
Some chart controls are available on this website (go in the "miscellaneous controls" section of this website). I don't know if they can be used for your application because in general they display 'static' data (you plot your complete series like on a excell chart).
I developped also my own chart control that can display 'dynamic' data (you can add new points to the control) and it's quite fast. Unfortunately, the article is not finished yet (I started to write it) and it will be available soon. If you need it now, I can send you what I have yet (the documentation is not complete).
This time i have tons of problems. I'm trying to learn how to connect to a db using ODBC. unfortunatly i can't find any good reference to show me how to do this (or maybe i'm stubit). Anyway I know is not right to ask from u to teach me how but u r me last chance so thanks for any help.
i wan't to built a spam filter that uses statistics to classify an email.
This is done using a db to store all words previously evaluated.
The db has only one table with the following rows:string word,int spam, int legitimate
i want to connect to the db and check one by one all the words(tokens) of the email if exists in the db and what value they have
i know i'm not very clear and i'm sorry. So far i manage to connect using some codei found on the web.
HENV hEnv = NULL;// Env Handle from SQLAllocEnv()
HDBC hDBC = NULL;// Connection handle
HSTMT hStmt = NULL;// Statement handle
UCHAR szDSN[SQL_MAX_DSN_LENGTH] = "project";// Data SourceNamebuffer
UCHAR* szUID = NULL;// User ID buffer
UCHAR* szPasswd = NULL;// Password buffer
UCHAR szWord;// word buffer
SDWORD cbWord;// word buffer bytes recieved
UCHAR szSqlStr = "Select * From tblDictionary Where Feature='token'";// SQL string
RETCODE retcode;// Return code
// Allocate memory for ODBC Environment handle
// Allocate memory for the connection handle
SQLAllocConnect (hEnv, &hDBC);
// Connect to the data source "dictio" using userid and password.
retcode = SQLConnect (hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPasswd, SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
// Allocate memory for the statement handle
retcode = SQLAllocStmt (hDBC, &hStmt);
// Prepare the SQL statement by assigning it to the statement handle
retcode = SQLPrepare (hStmt, szSqlStr, sizeof (szSqlStr));
// Execute the SQL statement handle
retcode = SQLExecute (hStmt); // Project only column 1 which is the word
SQLBindCol (hStmt, 1, SQL_C_CHAR, szWord, sizeof(szWord), &cbWord); // Get row of data from the result set defined above in the statement
retcode = SQLFetch (hStmt);
while (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO)
printf ("\t%s\n", szWord);
retcode = SQLFetch (hStmt);// Fetch next row from result set
// Free the allocated statement handle
SQLFreeStmt (hStmt, SQL_DROP);
// Disconnect from datasource
// Free the allocated connection handle
// Free the allocated ODBC environment handle
This code only gets the first colum i want to get all 3 colums and i want to check if the word does not exists i want to INSERT
i know is a lot of work to ask from u but believe me i tried and i can't find what i'm looking for.
Thanks again appriciate the help.
p.s if i ever make this spam filter to work i'll give it as a gift to all of u(though i doubt it )
I'm implementing a OO framework for the Win32 User Interface. The normal stuff like creating windows and so forth doesn't seem to be a problem, but hanling the messaging is.
I have a base Control class that does all the CreateWindow, font settings and other general stuff. Then I derive other controls from it, just setting the classname for the class to a something else to create a specific kind of control, like setting the classname to BUTTON, creates a button control. This works fine, but I still have to do the WM_COMMAND processing in the Window/Frame Control. I'd like to do this in the derived control class. I've tried chaining that derived control's WNDPROC's, but when trying to retrieve that specific object through a GetWindowLong ( GWL_USERDATA ) doesn't work, as the control that has the original WNDPROC is set in the USERDATA variable..
I'm pretty stuck ... hope you understand what I mean. I'll post some code if you don't understand.
This is a stripped down skeleton of it and when I want to create a derived control I do this:
class EditControl : public Control
virtual bool SetParams ( void );
bool CEditControl::SetParams ( void )
classname = "EDIT";
Boom! Edit control. Same with a buttons, list views, tree views, etc.....
For a actual window control, I derive a CustomControl class which adds some registration methods to register a new window class with WNDPROC etc....
Now here's the problem: I add eg. EditControl as a member in MainWndControl and run the create with MainWndProc as the parent. That window has it's own WNDPROC, and I do a GetWindowLong ( GWL_USERDATA ) inside the wndproc to get a pointer to the actual MainWndControl. Then I add some WM_COMMAND message handling in there to do what the buttons and edit controls is supposed to do. This is fine, but what I want to do is add message handling to specific Control classes to handle things like WM_PAINT, WM_LBUTTONUP, WM_FOCUS and that kind of generic messages.
This is where I tried chaining the WNDPROC's, but the Control receiving the message isn't the Control that has to get processed, because the GWL_USERDATA is set to something else.....