1,857 Posted Topics

Member Avatar for .millz.

One way is to store the number of the current question in the Tag property of the button. Then you can put it, cast to an integer, in a variable and use that instead of a literal number. Then increment it and replace the Tag value with that. button1.Tag = …

Member Avatar for tinstaafl
0
186
Member Avatar for Mr.M

Actually AllocSysString() returns a BSTR but it's a member of CString. Change the wchar_t to Cstring: Cstring str; return str.AllocSysString();

Member Avatar for tinstaafl
0
213
Member Avatar for LinaAshaji

For more flexibility, I would suggest WPF. There's a bit of a learning curve, but it allows you to have more options in transparency and animation.

Member Avatar for JOSheaIV
0
315
Member Avatar for mpdph09

Assuming that `tempdoc` is a string that represents a number and that the record loaded is always the most recent version, one way to do this would be to cast the string as an integer, increment it then cast it back to a string. The `Convert` class would work well …

Member Avatar for tinstaafl
0
339
Member Avatar for Ramarasan

`Console.WriteLine(ex.Message)` doesn't do anything in a form project, you should use MessageBox.Show(ex.Message, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error) instead. Also, since anyone else using this code isn't necessarily going to use the same query, it would make sense to pass, the query, the connection string and even the DataGridView, to allow using …

Member Avatar for tinstaafl
0
445
Member Avatar for negru

A helper function to choose the list will help cut down on duplicated code: LIST_NODE* ChooseList(ROOT_NODE * root, int data) { switch (data % 3) { case 0: return root->first; case 1: return root->middle; case 2: return root->last; default: printf("Invalid index"); break; } } Now to each function you pass …

Member Avatar for tinstaafl
0
351
Member Avatar for negru

Firstly, your struct needs some work. Since long-hand addition starts from the right not the left, it would make sense to keep track of where the right most digit is in the array. To accomplish this an additional field(size) will come in handy. Another thing to keep in mind, if …

Member Avatar for David W
0
2K
Member Avatar for negru

Firstly I would suggest a couple of helper functions: void PrintHeader() { printf("Producer\tModel\tChassis Number\n"); } void PrintVehicle(VEHICLE* ve) { printf("s%\ts%\ts%\n", ve->prod, ve->mod, ve->chs); } Now it's a matter of iterating through the tree and printing any vehicle matching that producer. Something like this should work: void FindVehicles(NODE* root, int field, …

Member Avatar for tinstaafl
0
241
Member Avatar for rose_2

It looks to me the problem is you're adding the burst time to the waiting time on the first iteration. You probably need to save the previous burst time then add it to the wait time. Something like this: int pbt = 0; for (j = 0; j < n; …

Member Avatar for tinstaafl
0
1K
Member Avatar for Medo_5

Using a string as the collection holding the digits will automatically reallocate memory and make the display() function much simpler, while providing you with an indexed collection that you can iterate through.

Member Avatar for rubberman
0
180
Member Avatar for Sameer_6

2 things to start with: * In the Expenditures class your functions are using a variable(sp) that isn't defined anywhere in the functions or the class. * You use this statement alot: `else {cerr<<"Wrong Choice!!"; exit(0)};`. The semi-colon goes inside the bracket: else { cerr<<"Wrong Choice!!"; exit(0); } Notice how …

Member Avatar for rubberman
0
425
Member Avatar for negru

Basically, remove the Address operators in line 140: print(arr+i,n,psurname,pname);

Member Avatar for rubberman
0
231
Member Avatar for legio13

I think you may be overthinking this a bit. A 5X5 array contains a 4X4 array in it, just use indexes 0-3. Leave the index 4 for the min and max values. Now everything, entering the data, finding the min values, and finding the max values, can be done in …

Member Avatar for tinstaafl
0
2K
Member Avatar for glao

One of the simplest ways to get the index of test is to use a counter: int index = 0; for ( int idx = 0; idx < N; idx++ ) { for ( int k = idx + 1; k < N; k ++ ) { if ( array[ …

Member Avatar for tinstaafl
0
577
Member Avatar for Alex_38

First off that's not complete code. You should submit the whole code. Secondly what doesn't work? What is it doing right? What is it doing wrong?

Member Avatar for tinstaafl
0
299
Member Avatar for Curious Gorge

Also with VS2015 the realtime syntax suggestion/checking(Intellisense) for c++ is quite good. Once you get used to it it's hard to go back.

Member Avatar for triumphost
0
392
Member Avatar for Skidoddity

What you need to do is handle the click event of the button, then check the current text of the button and act accordingly. To create the handler template, one of the easiest ways is to double-click the button and VS will automatically create the template, ready for you to …

Member Avatar for tinstaafl
0
192
Member Avatar for mpdph09

What you neded to do is use the `new` operator: DirectoryInfo dir = new DirectoryInfo(comboBox2.SelectedItem.ToString()); Just remember that the DirectoryInfo constructor requires the full path of the directory. The Path.Combine() method works well in combining the different parts of a path into one string. On a side note, the 2 …

Member Avatar for tinstaafl
0
230
Member Avatar for Damien_3

Assuming that the text file will never be a super huge file, you can read the whole file into memory and do multiple searches without reading the file each time.

Member Avatar for tinstaafl
0
214
Member Avatar for ARIGAR

Also only put one problem in a post. This way each can get the attention it deserves and also helps other people with the same problem find a solution.

Member Avatar for tinstaafl
0
270
Member Avatar for kulkarninitin77

Your question indicates you've tried things that don't work. To avoid duplicating this work, you should show the code you've tried and how it doesn't work. Also this [blog](http://www.sparxeng.com/blog/software/must-use-net-system-io-ports-serialport) discusses serial port communication in .net

Member Avatar for tinstaafl
0
41
Member Avatar for VIPER5646

One problem could be here `If Not IsDBNull(e.Value) Then` try checking for Nothing instead of DBNull `If e.Value IsNot Nothing Then`

Member Avatar for VIPER5646
0
863
Member Avatar for Max_14

One of your problems is here: scanf("%c%lf", &operation, &number2); Separate this into 2 scanf's and only do the second one if a r or R wasn't entered. Something like this: scanf("%c", &operation); if(operation != 'r' && operation != 'R') { scanf("%f", &number2); ... and so on On a side note …

Member Avatar for Max_14
0
212
Member Avatar for Dmitry1515

You might be better off using a .net wrapper for the libcurl library, of which google shows there are several, rather than trying to run a separate process.

Member Avatar for tinstaafl
0
64
Member Avatar for Dimitar_1

In looking at your code, it appears to me, that if p is NULL then there are no members and an error will result. I'm thinking that in the while statement, checking if `size != 0` would work better. On a side note having different nodes in the tree with …

Member Avatar for tinstaafl
0
197
Member Avatar for jlapdal

One way would be to handle the SelectedIndexChanged event of the second combobox. Inside the handler that you create, you can read the SelectedIndex property of each combobox to calculate the distance between stations.

Member Avatar for tinstaafl
0
96
Member Avatar for me vicky

First off in order to have Computer the base class for Laptop you need to declare it as such: class Laptop : Computer The problem you have now is naming the Laptop show function the same as the Computer show function. The compiler can't see past the Laptop show function. …

Member Avatar for David W
0
365
Member Avatar for nana_1

A couple of areas don't follow the flowchart: if (workNum % 2 == 0); { workNum += 1; } This checks if the number is even not odd. Try `if(workNum % 2 == 1)` sum = num1 + num2; Here you keep adding num1 to num2, but you want to …

Member Avatar for nana_1
-1
283
Member Avatar for kjblkblt

In here: x = p.x; y = p.y; The Point properties are `X` and `Y`, not `x` and `y`. In here: private Point FindClosest() { for (int x = LastMove.x - 1; x < x +1; x++) { if (x < 0 || x >= Board_Size) { continue; } if …

Member Avatar for JOSheaIV
0
281
Member Avatar for Leonard_3

It appears to me one of your problems is here: BOOL in_hand[NUM_SUITS],[NUM_RANKS] = {FALSE}; When you're declaring a multidimensional array there isn't supposed to be a comma separating the dimensions. Due to the nature of compiling c source code, this error right near the start could be creating the other …

Member Avatar for tinstaafl
0
3K
Member Avatar for tgreiner

It's pretty hard to say where the problem could be without seeing the code in question.

Member Avatar for David W
0
231
Member Avatar for LibraryCode

Just on the surface, it looks like `SearchBySurname` is expecting `TreeNode<T>` type but `ProcessMenu` is trying to pass `AVLType<T>`

Member Avatar for tinstaafl
0
2K
Member Avatar for toneranger

I don't see anything that could cause the problem you describe. I'm wondering though if `CumLoss` is represented as a positive integer and then added to `CumProfit`, could that be skewing your results to give the effect you observe? If not, you'll most likely have to submit enough of the …

Member Avatar for tinstaafl
0
191
Member Avatar for loldafuq

This function: bool operator ()(CSalary& obj) { m_ResSqrt += obj.GetSalary()*obj.GetSalary(); m_Res += obj.GetSalary(); } Doesn't appear to be complete. It doesn't use the parameter and there's no return statement

Member Avatar for tinstaafl
0
355
Member Avatar for Steven97.1

Basically inside the block for each package, check if the new checkbox is checked then see if the Hours is enough to warrant a savings in the other packages. For instance in package A if the Hours is 25 it would cost 39.95 but package B would only cost 19.95, …

Member Avatar for tinstaafl
0
636
Member Avatar for TheFearful

Here's a pretty good Article on how a [Double Transposition Cipher](http://www.pbs.org/wgbh/nova/decoding/doubtrans.html) works. The first thing you'll notice is that it requires 2 keys not just one.

Member Avatar for TheFearful
0
2K
Member Avatar for ogsirus

Your description is a bit vague. What would a sample of the starting data look like? What would a sample of the finished data to look like? What code are you using to reorginize the data?

Member Avatar for tinstaafl
0
184
Member Avatar for LibraryCode

One thing I noticed the `DeleteItem` function in the `TreeType` class is expecting a `ItemType` object but you're trying to pass an int.

Member Avatar for tinstaafl
0
431
Member Avatar for Matthew_12

The inputData function has no return type(it probably should be void, since the prototype is). Also the constructor is not a member of `this`. Rather than trying to call the constructor you should probably have that code in a private function and call that instead.

Member Avatar for tinstaafl
0
307
Member Avatar for papadakiss

Just from a quick glance I would suspect that the trailing `;` in the connection string is causing OleDbConnection to look for another value which isn't being supplied. I would suggest deleting that: Dim AccessConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=p:\inquiries.mdb")

Member Avatar for tinstaafl
0
340
Member Avatar for rony001

The Cells collection is a property of the Row class which is indexed in the Rows property of the DGV. You have to identify which row and which cell to insert the data.

Member Avatar for Santanu.Das
0
1K
Member Avatar for Mr.M

Alternatively reading the next line into a temporary variable will allow you to weed out any blank lines and only keep the last populated line: Using sr As New StreamReader(File.OpenRead("D:\test")) Dim LastLine As String, I, J As Integer, P As Long Do I = 0 J += 128 P = …

Member Avatar for Reverend Jim
0
1K
Member Avatar for lusito92

When you create your function try to use meaningful names for your variables. Imagine trying to decipher what they mean 2 or 3 years in the future.

Member Avatar for rubberman
0
209
Member Avatar for IconiCxPimp

Right after you assign the variables inside the loop, check if firstLetter is upper case. If it is make it lower case and make the first character in restOfWord upper case.

Member Avatar for IconiCxPimp
0
280
Member Avatar for James_43

Have you tried using one timer? With the interval set to the timer1 interval, you can use the modulus operator(modulo the interval) to fire the first window when it is 0 and fire the second window when it is 100. With an interval set to 1000 the timer will fire …

Member Avatar for James_43
0
268
Member Avatar for James_43

You're taking the selected index converting it to a string then trying to store it as an integer. C# doesn't allow this kind of implicit conversion. What you probably need to do is just store the selected index directly: int inx = ImageList.SelectedIndex;

Member Avatar for James_43
0
3K
Member Avatar for TheChessDoctor

I don't have much experience with Eclipse, but I've seen somne IDE's that don't pause the console after main is finished. On a small app like this, it will look like it didn't run at all. Basically though it has run and finished just too fast for you to see …

Member Avatar for syncster31
0
170
Member Avatar for anumash

Here's a pretty good [article](http://www.cplusplus.com/forum/articles/17108/) that discusses that

Member Avatar for tinstaafl
0
276
Member Avatar for ogsirus

You seem to be copying a lot of your data. Plus you have no code for `Combinations` and `Line`, which may do more copying, but without the code it's hard to say for sure. Just from a quick glance allNumbers is only used to pass to Combinations, passing the Keys …

Member Avatar for ogsirus
0
2K
Member Avatar for RH7MES

This would also be a good time to learn about classes and object oriented programming. These will not only streamline your code for this project but will be of great help to any future projects. In fact you will probably be better off forgetting most of what you learned using …

Member Avatar for JOSheaIV
0
219

The End.