Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Search the Tips
Tip Bank > C++ > Error/Exception Handling

Error/Exception Handling - Page 4

Exception Handling
61-80 of 189     Previous     Next
Avoid Hard Carriage Returns in Your HTML Text Strings
by Manoj K.
When using the element property innerHTML to change the text of an element, make sure that you don't put hard carriage returns inside of the text string. Doing so will cause an "Unterminated ...
Use Windows Script Host to Rename Existing Files
by Manoj K.
You can rename files through the use of the FileSystem object. The problem is that you ...
SQL query results error
by DevX Pro
To show my SQL query results in paged fashion, I used your article as reference. This error message appeared: ADODB.Recordset error '800a0cb3' The operation requested by the application is not supported by the provider. I checked the specified code where the error was generated, and it was the RS.AbsolutePage property. What should I do to fix this error?
Playing Sound Files in FoxPro Apps Quickly
by DevX Pro
I write language instruction programs and have been calling mplayer2 to allow students to hear the pronunciation saved in recorded sound files. But mplayer takes forever to load and play. So do all the other executable programs that I have, such as xrecord. By contrast, Windows can play .wav files instantly. If I could load and play small .wav files that fast I could greatly improve my language program. (There must be some subfile of Windows that plays its sound files so quickly.)What other .exe files are there that load and play very quickly under FoxPro? Using verbs in FoxPro is even slower than calling .exe files for some reason.
Stacks to Strings Conversion
by Manoj K.
Sometimes it is useful to be able to capture the output from a stack dump, redirect it to a string, and then, perhaps, to a window. ...
Patch for Divide-By-Zero Error
by DevX Pro
We are getting a divide-by-zero error running FoxPro for Windows 2.5 on a Novell server on the network on an NT workstation. Can I use the patch in version 2.5?
Using the Assert Macro
by DevX Pro
I am not sure if it is good when I use the assert macro in the following code: int sum(int number) // Precondition: number => 1 // Postcondition: return sum from 1 to n terms { assert(number >= 1); int total = 0; for (;number >= 1; number--) { total = total + number; } return total; } What do you think?
Copying Part of a String
by DevX Pro
I have a little problem which I can't solve. I will give the question with an example. I'm working with Excel. In a cell the string "100dpi.txt" is written. Is it possible to copy a part of this string "100dpi" to another cell? How should I do this? In this example the "part of the string" contains six characters before the dot. This part of the string can vary from one to eight characters.
Maximum Number of Objects on a Form
by DevX Pro
Is there any way to get more than 255 objects on a VB form?
ServerSocket Port Binding Error
by DevX Pro
My Java server compiles perfectly, but when I try to run it on my machine I get an error when it tries to open up the ServerSocket on port 2525. I have tried it on another machine and it works fine. It also worked on my own machine the first few times I tried it.
Use TreeView Control With Checkboxes
by Gerardo Villeda
When the NodeCheck event triggers, you receive as a parameter the node that was checked. Say you need to do some validation and uncheck the node when there's an error. You set Node.Checked = False, ...
Menus Using Virtual Functions
by DevX Pro
What is giving me a redefinition of CMenuItems class error in this code? //cmenu.h class CMenuItem { public: char title[81]; virtual void Do_Command(void)=0; }; //********************* //CMDS.CPP Defines and initializes menu commands. #include #include #include "cmenu.h" class CMenuBell:public CMenuItem{ void Do_Command(void); }; class CMenuSaying:public CMenuItem{ void Do_Command(void); }; class CMenuAdd:public CMenuItem{ void Do_Command(void); }; void CMenuBell::Do_Command(void){ putc('\007',stdout); // "\007" rings a bell } void CMenuSaying::Do_Command(void){ puts("If you know the meaning of the universe,"); puts("Make the sound of one hand clapping."); } void CMenuAdd::Do_Command(void) { double x,y; printf("Enter a number: "); scanf("%lf",&x); printf("Enter a number: "); scanf("%lf",&y); printf("The total is %f.", x+y); } int num_commands; CMenuItem *commands[20]; void Init_Commands(void) { commands[0] = new CMenuBell; strcpy(commands[0]->title, "Sound a bell."); commands[1] = new CMenuSaying; strcpy(commands[1]->title, "Print a message."); commands[2] = new CMenuAdd; strcpy(commands[2]->title, "Add two numbers."); num_commands=3; } //************************ //Main.cpp #include #include "cmenu.h" #include "CMDS.cpp" extern int num_commands; extern CMenuItem *commands[]; void main(void) { int i, sel; Init_Commands(); do { puts("\nMENU:\n"); for (i=0; ititle"); printf("\nEnter a selection: "); scanf("%d", &sel); if (sel>0 && selDo_Command(); } while (sel
Default Button Prevents Firing of Validate Event
by Gordon Lawson
VB6 introduced the Validate event as a way to handle field-level validation without using LostFocus, which doesn
Where Are Exception Objects Stored?
by Danny Kalev
Consider the following ...
Rules of Thumb for Designing Exception Classes
by Danny Kalev
< ...
Passing a Variable to a Compiled Program
by DevX Pro
I am calling an .FXP from a batch file, but would like to pass a variable. Am I able to do this? How would FoxPro recognize it?
Query is not Updateable Error
by DevX Pro
When trying to run the SQL statement, I get this error but I don't know what it means: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. /cgi-bin/action.asp, line 34
Ambiguous Operator Error
by DevX Pro
My small program (see below) below compiles and runs correctly on one machine and generates the following error on another: 'operator Both computers are running Windows NT 4 Service Pack 4, Microsoft Visual Studio C++ v.6. Could you please tell me where the source of this problem could be? Tools | Options | Directories Tab and Tools | Options | Help System Tab of MS Visual C++ Studio have the same settings on both computers. */ #include #include #include using namespace std; class Event{ friend ostream &operator pq; pq.push(e1); pq.push(e2); while(!pq.empty()) { cout error C2248: 'eT' : cannot access private member declared in class 'Event' see declaration of 'eT' error C2248: 'pT' : cannot access private member declared in class 'Event'
File Locations
by DevX Pro
I have set Home as C:\MyApp in Project Information. VFP has no problem finding the project, but when I do a build and, while running, click a link to a form, it wants to look in the VFP directory or, since I put SET DEFAULT TO C:\MyApp in main form Activate code, it wants to look there instead of in: C:\MyApp\Forms. Doesn't VFP know to look in a Forms subdirectory for a form? I want the application to find each component (form, database, report, etc.) based on setting a single "Application Home Directory" so that when I deploy it to the target PC, I only need to change a single location setting. Is this possible? I want the application to find each component (form,database,report,etc.) based on setting a single 'Application Home Directory' so that when I deploy it to the target PC, I only need to change a single location setting. Possible?
Data Source Name Not Found Error '80004005'
by DevX Pro
What does this error message mean? Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /SampleProject/default.asp, line 14 Here's the code I created in Visual InterDev: : : : : Conn.Open "Concerto" strSQLStmt = "SELECT * from TVChannels" RS.Open strSQLStmt, Conn %>
61-80 of 189     Previous     Next
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date