Programación General > C++ Builder
Error Desconocido
(1/1)
saulillo:
Hola,
estaba con mi proyecto tranquilamente despues de resolver el problema anterior cuando vuelvo a ejecutar el programa y me salta el siguiente error (fichero adjunto) mientras se esta ejecutando. Tengo el siguiente codigo:
--- Código: Text --- #include <vcl.h>#include<math.h>#include<iostream.h>#include<fstream.h>#include<cstring.h>#include<stdlib.h>#include<stdio.h>#pragma hdrstop#include "Unit1.h"#include "Unit2.h"//---------------------------------------------------------------------------#pragma package(smart_init)#pragma resource "*.dfm"TForm2 *Form2;int aux=0,aux1=0, aux3;AnsiString *cfechas;//---------------------------------------------------------------------------__fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner){}//---------------------------------------------------------------------------void __fastcall TForm2::Button2Click(TObject *Sender) //AQUI ESTA EL ERROR{ int p=0;//auxiliar aux3=aux-1; cfechas = new AnsiString[aux3]; for (p=0; p<=aux3; p++) { cfechas[p]="pepe";//ListBox2->Items->Strings[p]; } Form2->Hide(); Form1->Show();}//---------------------------------------------------------------------------void __fastcall TForm2::Button1Click(TObject *Sender){ int j=1, p; int ncolum = Form1->ncolum; for(p=0; p<=ncolum-1; p++) { ListBox1->Items->Strings[p] = Form1->StringGrid1->Cells[j][0]; j++; aux1++; }}//---------------------------------------------------------------------------void __fastcall TForm2::Button3Click(TObject *Sender){ String cambio1; try { cambio1 = ListBox1->Items->Strings[ListBox1->ItemIndex]; ListBox1->Items->Delete(ListBox1->ItemIndex); ListBox2->Items->Strings[aux]= cambio1; aux++; aux1--; } catch(...) { ShowMessage("Elige un componente"); }}//---------------------------------------------------------------------------void __fastcall TForm2::Button4Click(TObject *Sender){ String cambio2; try { cambio2 = ListBox2->Items->Strings[ListBox2->ItemIndex]; ListBox2->Items->Delete(ListBox2->ItemIndex); ListBox1->Items->Strings[aux1]=cambio2; aux--; aux1++; } catch(...) { ShowMessage("Elige un componente"); }}
Pues bien, si en el listbox2 hay cosas, al pulsar el button2, me da el error del archivo adjunto, sino hay nada, no da ningun error. He puesto un stop en la primera instruccion del button2, pero sigue saliendo, asi q no se q hacer, espero q me ayudeis.
Gracias
Navegación
Ir a la versión completa