Hi everyone, I'm new to programming in C++ and have the following problem: I would like to Drawing lines (and other objects, ie squares, circles, etc) with OpenGL(like the Paint program in windows)with a MFC application. I've created a MFC application that is linked to OpenGL. How do I created functions like the ones we see in the "Paint" program found in windows accesories? For example, if I click on the menu which as a "draw lines" function and after clicking on that, I would like to use the mouse to draw lines, (line starts when the mouse is clicked and dragged. Then the line stops when mouse is released). I'm having great difficulty doing this and if anyone can help it would be greatly appreciated. Thank you in advance! Steve
Steve Lai
Posts
-
** Help!: Drawing objects with OpenGL(similar to the "Paint" program under windows) -
Drawing lines with OpenGL(like the Paint program in windows)Hi everyone, I'm new to programming in C++ and have the following problem: I would like to Drawing lines (and other objects, ie squares, circles, etc) with OpenGL(like the Paint program in windows)with a MFC application. I've created a MFC application that is linked to OpenGL. How do I created functions like the ones we see in the "Paint" program found in windows accesories? For example, if I click on the menu which as a "draw lines" function and after clicking on that, I would like to use the mouse to draw lines, (line starts when the mouse is clicked and dragged. Then the line stops when mouse is released). I'm having great difficulty doing this and if anyone can help it would be greatly appreciated. Thank you in advance! Steve
-
*** Displaying TABLES from Access in a MFC application ***Hi Everyone, How do I display the data in a Microsoft Access Table with an MFC application? Can I call up a table from Access for display directly? If anyone knows, Please let me know. Thanks in Advance! Steve
-
*** Saving TABLES from Access with MFC application ***Hi, I have a MFC application that uses Microsoft Access tables. The result of my program writes data into a Access database so at the end, I have a Table with the results. I would like to know: How can I allow the user to save that RESULT TABLE where they SPECIFY the name of the table and the location of where to save it? If anyone has any ideas, Please let me know. Thanks in Advance Steve
-
*** Saving TABLES from Access with MFC application ***Hi, I have a MFC application that uses Microsoft Access tables. The result of my program writes data into a Access database so at the end, I have a Table with the results. I would like to know: How can I allow the user to save that RESULT TABLE where they SPECIFY the name of the table and the location of where to save it? If anyone has any ideas, Please let me know. Thanks in Advance Steve
-
*** Displaying TABLES from Access in a MFC application ***Hi Everyone, How do I display the data in a Microsoft Access Table with an MFC application? Can I call up a table from Access for display directly? If anyone knows, Please let me know. Thanks in Advance! Steve
-
*** Saving TABLES from Access with MFC application ***Hi, I have a MFC application that uses Microsoft Access tables. The result of my program writes data into a Access database so at the end, I have a Table with the results. I would like to know: How can I allow the user to save that RESULT TABLE where they SPECIFY the name of the table and the location of where to save it? If anyone has any ideas, Please let me know. Thanks in Advance Steve
-
*** Displaying TABLES from Access in a MFC application ***Hi Everyone, How do I display the data in a Microsoft Access Table with an MFC application? Can I call up a table from Access for display directly? If anyone knows, Please let me know. Thanks in Advance! Steve
-
*** Declaring Array inside another Array ***Hi Everyone, How do I declare an Array inside another Array? For example, I have the following two arrays: ///////////////////////////////////////////////////////// int UserInputSize1, UserInputSize2; int *array1; array1= new int[UserInputSize1]; int *array2; array2=new int[UserInputSize2]; //the size of the arrays will be determined by the user input during runtime. /////////////////////////////////////////////////////// How do I declare them so under array1, it’ll contain the other array? So for example, if the size of array1 is 3 and the size of array2 is 10, then under every element in array1, I’ll be able to store 10 numbers. Then I’ll be able to store a total of 30 numbers with this example. I would like to do something like this: Array1[0].Array2[0]=5; Array1[0].Array2[1]=10; Array1[0].Array2[3]=11; … If anyone knows, Please let me know. Thanks in advance Steve
-
*** Declaring Array size from User Input ***Hi Everyone, I would like to use an array that has a size that is determined by the user input. But I'm getting this problem of " array must contain constant " from this array declaration: int UserInput; int TheArray[UserInput]; How do I declare the size of the array with user input?? if anyone knows, Please let me know. Thanks in Advance!
-
*** Displaying COleVariant variables ***Hi everyone, I have a project that is MFC based and I would like to know how I can display the value of an COleVariant variable in a messagebox? For example, I have the following: COleVariant var; var then contains some data. I retrieved from a database with GetFieldValue() function. which is done with a CDaoDatabase connection. How do I display whatever that is in var in the MFC application to see what is inside it? If anyone knows, Please let me know. Thanks in Advance! Steve
-
** Random Number Generator **Hi Everyone, I have a question regarding generating random number. Is there a function that can generate random number between a range without having the random number repeat itself? For example, let's say I have 100 records in a database. i want to randomly select a certain number of records upon user input and make it as a new table. if i use rand() function, and mod the numbers by 100, i'll get the numbers between 1 and 100, which then i can use to set the position of the record to copy that row of data. but the numbers might repeat themself if i select a large amount of records out of the 100. is there a way to check the random number generated to see if it has already been selected before? If anyone knows, plmk. thanks steve
-
*** Changing Title of a Document Frame ****Hi everyone, I'm just wondering how you change the "Untitled" text found on the top left of a single document frame. If anyone knows, plmk. Thanks in advance! Steve
-
** Passing Variable Values to other Dialog Boxes **Hi Everyone, How do I pass the values of a variable in one dialog box to another dialog box?? For example, let say I have a dialog box with an edit box and a button. So when I type something into the edit box and presses the button, the value of what I typed is stored in the variable for the edit box. Then how do I use that edit box variable in a DIFFERENT dialog box? Let say I want to display of whatever I typed in the edit box from the first dialog into a List box in the second dialog box, how do I do that? If anyone has any ideas, PLMK. Thanks in Advance! Steve
-
*** Dialog Box of Open & Save ******Hi Everyone, How do I get the dialog box of Open & Save to come up?? (like the ones you see when you want to open and save a document in Microsoft Words). I tried using CFileDialog but I'm having trouble. I'm not sure if I'm putting the wrong things in the parameter or what. I also get this error message of "failed assertion". If anyone have any codes on an example of how to get the dialog box to work, please let me know. Thanks in Advance! Steve
-
*** Retriving Rows of Data from Access Tables **Hi Everyone, I’m using Visual C++6, and I have this question regarding Database programming with Microsoft Access. How do I get a certain row’s field names and it’s values?? For example, let’s say I have an Access table such as: CustID CustName Item Price 1 John Pen 1.99 2 Mike Mirror 5.00 3 Erin Pencils 1.00 4 Joe Eraser 1.50 5 Tim CD 14.99 How do retrieve the data of certain rows such as row 2 and row 5?? I would like then to take the values of the selected rows and write it into a new table somewhere else. Is there a simple method such as (SELECT this row and INSERT INTO a database)?? If anyone has any idea, PLEASE LET ME KNOW. Thanks in Advance. Steve P.S. How do I only retrieve the FIELD NAMES of a table?
-
** Changing TEXT FILES to Access Tables **Hi everyone, I need help with converting Text Files into Access table and hope you can help me out. I have 2 TEXT FILES, first that contains the table name, and its attribues, and the SECOND file contains the values of the table. So if the first TEXT FILE that has the following table values: tablename field1, integer field2, string field3, integer field4, string then another TEXT FILE will contains the values for the table: 1, john, 6, smith 2, steve, 7, clark 3, carrie, 8, wayne 4, dan, 9, chait 5, erin, 10, alan what i need to do is to read the values from the FIRST TEXT FILE that contains the table attributes and create the table. Then i need to read the SECOND TEXT FILE and plug in the values. so at the end, i'll have a Access table like: field1 field2 field3 field4 1 john 6 smith 2 steve 7 clark 3 carrie 8 wayne 4 dan 9 chait 5 erin 10 alan But i need the readings of BOTH TEXT FILES to be dynamic so it'll work if the TEXT FILE has x number of columns, and x number of rows. and i also need the reading to be dynamic so it can read the values from the SECOND TEXT FILE no matter what kind of values it contains, ie, integer, string, char, etc... If anyone can help me out, Please let me know. Thanks in Advance. Steve
-
Changing TEXT FILES into Access TablesThanks Phil! Does anyone else know how to solve this problem with the database part?
-
Changing TEXT FILES into Access TablesThanks Phil!
-
Changing TEXT FILES into Access TablesHi everyone, I need help with converting Text Files into Access table and hope you can help me out. I have 2 TEXT FILES, first that contains the table name, and its attribues, and the SECOND file contains the values of the table. So if the first TEXT FILE that has the following table values: tablename field1, integer field2, string field3, integer field4, string then another TEXT FILE will contains the values for the table: 1, john, 6, smith 2, steve, 7, clark 3, carrie, 8, wayne 4, dan, 9, chait 5, erin, 10, alan what i need to do is to read the values from the FIRST TEXT FILE that contains the table attributes and create the table. Then i need to read the SECOND TEXT FILE and plug in the values. so at the end, i'll have a Access table like: field1 field2 field3 field4 1 john 6 smith 2 steve 7 clark 3 carrie 8 wayne 4 dan 9 chait 5 erin 10 alan But i need the readings of BOTH TEXT FILES to be dynamic so it'll work if the TEXT FILE has x number of columns, and x number of rows. and i also need the reading to be dynamic so it can read the values from the SECOND TEXT FILE no matter what kind of values it contains, ie, integer, string, char, etc... If anyone can help me out, Please let me know. Thanks in Advance. Steve