C++ WinForms: Looping through directory of pictures with buttons

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 2198 Views - Last Post: 23 April 2018 - 12:25 PM

#16 victorque   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 21-April 18

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 11:28 AM

private: System::Void rightarrow_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 
			 
			 {
				 String^ index = GlobalClass::TextureFiles->Length+1;
				 textureBox->Image = Bitmap::FromFile(index);
			 }
		 }

Was This Post Helpful? 0
  • +
  • -

#17 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1556
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 12:23 PM

Not really what I said and there is no question...

so if you dont want my help I will bow out..
Was This Post Helpful? 0
  • +
  • -

#18 victorque   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 21-April 18

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 01:33 PM

View Postsnoopy11, on 22 April 2018 - 12:23 PM, said:

Not really what I said and there is no question...

so if you dont want my help I will bow out..


No no, if you could guide me into the right direction, I'd be pleased. I've been trying to increase the index, make the TextureFiles a different file name, no avail. What did you mean? Could you rephrase in psuedo code/ or better yet code?

Thank you in advance
Was This Post Helpful? 0
  • +
  • -

#19 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1556
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 01:42 PM

I think Ive given you enough 'free' code....

Time for you to do some work I think....
Was This Post Helpful? 0
  • +
  • -

#20 victorque   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 21-April 18

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 02:48 PM

View Postsnoopy11, on 22 April 2018 - 01:42 PM, said:

I think Ive given you enough 'free' code....

Time for you to do some work I think....


You gave me code correct, but I am genuinelly confused of what you meant by the length increasing. I have increased the length and the index? What are you even referring to?

 if(directory->ShowDialog() == System::Windows::Forms::DialogResult::OK)
				{ 
					files->InitialDirectory = directory->SelectedPath;

					if(files->ShowDialog() == System::Windows::Forms::DialogResult::OK)
					{
						GlobalClass::TextureFiles = files->FileNames;
						MessageBox::Show("loaded: " + GlobalClass::TextureFiles, "information");
						textureBox->Image = Bitmap::FromFile(GlobalClass::TextureFiles[GlobalClass::index]);
			
					}
				}
				
				
				

			 }
private: System::Void rightarrow_Click(System::Object^  sender, System::EventArgs^  e) 
		 {
			 
			 
			 GlobalClass::index += 1;
			 
		 }

Was This Post Helpful? 0
  • +
  • -

#21 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6875
  • View blog
  • Posts: 23,313
  • Joined: 05-May 12

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 05:52 PM

With your current approach to learning, I fear that doomsday clock will move forward a full minute when you get your certificate and start actually writing code for the reactor. As tempting as it is to help you, all that will do is help you get your certificate, instead of getting you to start doing some research and learning for yourself. snoopy11 has given you the direction that you need to take for your program. You just need to get out of spoon-feed mode, and get into try things out and think for yourself mode.

My understanding is that there is no big security hole in WinForms that is not present in any run of the mill Win32 API based Windows program. What security hole are you talking about?
Was This Post Helpful? 1
  • +
  • -

#22 victorque   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 21-April 18

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 07:35 PM

View PostSkydiver, on 22 April 2018 - 05:52 PM, said:

With your current approach to learning, I fear that doomsday clock will move forward a full minute when you get your certificate and start actually writing code for the reactor. As tempting as it is to help you, all that will do is help you get your certificate, instead of getting you to start doing some research and learning for yourself. snoopy11 has given you the direction that you need to take for your program. You just need to get out of spoon-feed mode, and get into try things out and think for yourself mode.

My understanding is that there is no big security hole in WinForms that is not present in any run of the mill Win32 API based Windows program. What security hole are you talking about?


I got the problem to work, I just having trouble understanding what he meant by length, his wording was a little bit awkward. Thanks for all your help.

And you're right, I should write more problems. My next program will be Ohm's Law or something like that. Thanks man
Was This Post Helpful? 0
  • +
  • -

#23 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1556
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 22 April 2018 - 11:56 PM

View PostSkydiver, on 23 April 2018 - 12:52 AM, said:

My understanding is that there is no big security hole in WinForms that is not present in any run of the mill Win32 API based Windows program. What security hole are you talking about?



No as you say there is no real security issue with winforms....

But you must remember that the way these controls are setup is that you have lots of little independent controllers dotted around the various pieces of plant.

They are all then hardwired by sheathed comms cable to a central 'hub' which disseminates the information to each of the pc's which are being used as a 'terminal' there is usually a separation between control information (such as temperature sensors etc) and graphical display information ie they are two separate programs in which the graphical display program (in this case winforms) gets access to the sensor info via either OLE or dedicated ActiveX controls.

Everything is on a LAN which means these pc's never get updated...

Apart from the Hub which has access to the internet via a dialup modem for remote alarms and remote dial-in access.

The OS's on these Power Stations can be 20 years old...

The maintenance staff are generally frightened of updating anything in case it breaks something..
Was This Post Helpful? 0
  • +
  • -

#24 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6875
  • View blog
  • Posts: 23,313
  • Joined: 05-May 12

Re: C++ WinForms: Looping through directory of pictures with buttons

Posted 23 April 2018 - 12:25 PM

Sounds almost like the oil refineries my Dad used to work on -- except not all of them are air gapped. Sounds like a hacker's haven: all these nice old vulnerable systems which have not been patched in years...
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2