- Upvotes Received
- 6
- Posts with Upvotes
- 6
- Upvoting Members
- 6
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
55 Posted Topics
Re: Knight YUVA i would not recomend iether solutions to your post. Both contain bad programming practices. A better way is to use the the textboxs' validating event which is fired as the the textbox looses focus. See sample code: private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = (!char.IsDigit(e.KeyChar)) && … | |
Re: In function getdat(...) you have declared a local instance of infile which will will be a null value. Try parsing infile declare in function main() as a parameter in getdat(...). | |
I'm working on a bit vector class that I'm using in a current project. Basicly BitVector is a container class for storing and manipulating data a bit level. I have two member fuctions for "setting" and "getting" bits at a given index. // Returns the bit at the specified index. … | |
Re: try txtConvertedInches->Focus this should set focus to the textbox Cheers Milton | |
Re: hid_write(hid_device *device, const unsigned char *data, size_t length); the 2nd parameter is an unsigned char pointer, ie pointer to a byte array. Have you tried using a byte array to send you data rather than a string? | |
Re: In the case of testing for equality you would use OR ..... char sign; while(true) { ..... cin >> sign; if(sign == 'Q' || sign == 'q') break; // break from the loop. } | |
Re: The tax is a sliding scale, so what you have done needs to revised. Eg. if your income was $75,000, tax would be calculated as such. Total tax = $43,561 at 15% + (75,000 - 43,561) at 22% . Base your algorithm on this. Milton | |
Re: Hi AD, maybe something like this: // vargs.cpp : main project file. #include "stdafx.h" using namespace System; static void UseVariableParameters(... array<Object^>^ list) { for ( int i = 0 ; i < list->Length ; i++ ) { Console::WriteLine(list[i]); } Console::WriteLine(); } static void DemonstrateVariableParameters() { UseVariableParameters("Help",2,3,4,5, '%d'); } int main(array<System::String … | |
Re: http://www.daniweb.com/software-development/cpp/threads/5939/return-array-from-c | |
I'm re-kindling some of my C++ theory and was working through a C++ SringBuilder class I found on the net. I understand it all except the 2 operator methods. (See listing below). Can anyone explain what these operator methods are for and how and why you would impliment them. class … | |
Re: String^ indata is declared as public so it will be accessible from Form1 as long as your SerialCommunication class is included in you Form1 class. | |
Re: My question is! This assignment is beyond the scope of a "beginners" C++ progamming level. So how did you advance to this level and "not know where to begin" ? Ok Maybe start by creating a class .. call it StockItem In this class I would add fields like... itemCode … | |
Re: Hello Kamran Try this link http://www.cplusplus.com/reference/clibrary/cstdlib/strtod/ | |
Re: http://www.wisegeek.com/what-is-parksides-triangle.htm this should get you started Milton | |
Re: If you ignore it long enough .... it will go away :) | |
Re: Try this http://blogs.msdn.com/b/nativeconcurrency/archive/2011/12/28/high-resolution-timer-for-c.aspx Milton | |
Re: private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { FrenchFries ^ newfrm = gcnew FrenchFries(); if (comboBox1->Text == "French Fries") newfrm->ShowDialog(this); else this->Close(); } Milton | |
Re: If this is a one of exercise, then you can always use GDI+ which of course supports the .PNG image format. Milton | |
Re: Box B In your constructor X1, Y1, X2 & Y2 are initized to 0. H and W are also initalized to 0. After your call to GetWindowRect() X1, Y1, X2 & Y2 are assign the desktop coordinates but H & W are still 0. You should provide some member functions … | |
Re: For simple byte arrays it is not necessary to use 'Byte Pointers' on the managed heap. triumphost code, of course is correct and works but declaring a byte array like this is more efficient. #include "stdafx.h" using namespace System; array<Byte>^ StringToByteArray(String^ Str) { array<Byte>^ bytes = gcnew array<Byte>(Str->Length); for(int I … | |
Re: > but i dont understand how i would apply this to somthing like a panel So you know that a Windows::Form::Panel does not support double buffering. ie no DoubledBuffered property. There are serveral way you can do this and the way I prefer is to create my own doubled buffer … | |
Re: From you post I'm *guessing* that your app is a .NET winForms application. If so, have you tried enabling the double buffering property for the form. Milton | |
Re: smsPort->Write("Message" + Convert::ToChar(26).ToString()); Milton | |
Re: Check your ascii values. Digits are decimal 48 to 57. If the password contains alpha characters (a->z, A->Z)and numeric(0->9) characters it is then refered to as alphanumeric. Cheers Milton | |
Re: Once you right click on a textbox it has input focus. So you can use its focused property (returns a bool value) if(textbox1->Focused) { ...... } | |
Re: The problem is in these lines: MinTotal, MaxTotal & Avr_Of_Total are declare as doubles, but you are using these as fuctions. cout << MinTotal(A)<<endl; cout << MaxTotal(A)<<endl; cout << Avr_Of_Total(A)<< endl; Cheers Milton | |
Re: Your include header file should be preceded with a hash (#) | |
Re: Move line 10 - using namespace std; before the reafFile(.....) function declaration in line 5. and all should complie ok. | |
Re: Double buffering your form will not help you out with your tabcontrol. Can you give more detail, are the background images on the tabpages? some code will help. Milton | |
Re: Try here for some useful information. [url]http://www.lvr.com/serport.htm[/url] | |
Re: Check this is in your main() [code=c++] // Enabling Windows XP visual effects before any controls are created Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); [/code] I'm using 2008 and this is inserted automaticly when you create a new project. Maybe not so for 2010?? Milton | |
Re: Here is a link to the most commonly used built-in Exceptions. [URL="http://blogs.msdn.com/b/brada/archive/2005/03/27/402801.aspx"]http://blogs.msdn.com/b/brada/archive/2005/03/27/402801.aspx[/URL] There are several exceptions you can use for "Invalid Arguments". If nothing suitable follow Mike's post on creating your own exceptions:). Milton | |
Re: Set your pictureBox SizeMode property to AutoSize. [code=c++] this->pictureBox1->SizeMode = PictureBoxSizeMode::AutoSize; [/code] This will resize the pictureBox to the size of the image. Milton | |
Re: Firstly you need some way of setting your draw character (ch). Either by having a property to initialise it or use your constructor. Secondly your rectangle class should have a Draw() method. Call it from your main ie. myRectangle.Draw() If you like you can even specify your draw character in … | |
Re: In your "progam_name.RC" file you will find the line: [COLOR="Green"][/COLOR]IDR_MAINFRAME ICON "res\\mfc_test.ico" Cheers Milton | |
Re: This might help you get started [url]http://www.technofundo.com/tech/win/SNIcon.html[/url] Cheers Milton | |
Re: Hello I assume that you are drawing the shapes you want directly on the forms graphics surface during the form's paint event. This will not work because the form has no knowlege of what's been drawn there and therefore can not scroll over it. One way to over come this … | |
Hi All This is more a discussion than a problem. :) I’m working on a small project that needs to be done in C++. Part of it requires that I maintain an array of file streams so that I can open serveral files at one time, read, write exchange data … | |
Re: Hi Since moving from VB6 to C++ .Net I've ported a few of my VB apps to C++ .Net. The approach I usually take is to start from scatch! In your case if you haven't done so already is to download the VB.Net version from the site you linked and … | |
Re: Try [COLOR="Red"]Clean Solution [/COLOR]then re-build it. In VS2008 it is in the [COLOR="Green"]Build[/COLOR] menu but not sure if it is the same for VS2010. Milton | |
Re: [code=c++] int count = 0; while (count < 10) { . . . . . count++; } [/code] | |
Re: It appears you are using C#? It would be better to post your thread in this area. You will get more responces there Milton. | |
Re: Hello Jenifer88 Your code is full of mixed Managed and Unmanaged code:-/ If you are going to write code in the .NET environment it is best to stick to managed code where possible. I've commented out the unmanaged code in you program and given you something to get going with. … | |
Re: Hi From reading the theads to your post, I understand that you want access to a control on a form outside of the class the form is created in. If this is what you are trying to do then there two ways to do it. One way (the prefered and … | |
Re: Hi Need to add: [code=c++] return 0; [/code] at line 33 This will force a "return" from function "main" and terminate your program. Cheers Milton | |
Re: Hello array<Byte>^ is the correct syntax for a byte array in CLI/CLR. Trying to use to use it without the tophat "^" will generate a complier error. Syntax [code=c++] array<Byte>^ b = gcnew array<Byte>(1000); [/code] This tells the compiler to create a new array of a 1000 elements of the … | |
Re: Hi Moshe A) If the RichTextBox is filling the entire form you can set the Dock property of the RTB to "Fill" and the size of the RTB will risize with the form. B) Or you can resize it this way: Get the size of the form's window before the … | |
Re: Hi Have you tried using: [code=c++] System::Windows::Forms::ControlPaint::DrawReversibleFrame(rect, color, style) [/code] It draws a rectangle directly to the screen (no graphics surface is required). Note that the rect is in screen co-ordinates. It requires 2 calls, the first to draw the rectangle and the second call will erase it. Let me … | |
Re: Try something like this for your drawBlock method. [code=c++] void drawBlock (int p) { int width = p * 3; bool isodd = false; int oddrow = 0; int oddcol = 0; if(p % 2) // Test if odd; { isodd = true; oddrow = (p / 2); oddcol = … | |
Re: Hope this might clear this up for you. The notion of a [B][I]struct[/I][/B] in C++ goes far beyond the original consept of a [B][I]struct[/I][/B] in C. It incorporates the object-oriented notion of a [B]class[/B]. This idea of classes, from which you can create your own data types and use them … |
The End.