Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, I tried to fill some dat

Status
Not open for further replies.

Bachatero

Programmer
Aug 30, 2006
36
NL
Hi All,

I tried to fill some data in my ListView, but I don't see anything. It adds the text to the colums but I dont see the items.

Any idea why ???

Thanks in advance.

Johan

Code:
void TUniformity::ShowTags()
{
Uint16     BeginAdres;
Uint16     groep[3000];
Uint16     element[3000];
Uint16     lengt[3000];
Uint16     lengte16;
AcrTag16   ptr16;
AcrTag32   ptr32;
AnsiString vr[3000];
AnsiString aVR;
AnsiString MsgStr;
String     aFileName;
char       *DataString [300];
char       *Data[500];
char       Lengte[30];
char       Group[300],Element[300];
int        tagCount = 1;

aFileName = "5FOV.IMA";

  Uniformity->OpenFile(aFileName);

  BeginAdres = 0x84;

   for(int i = 1; i < 3; ++i) {
              {

              ptr16 = Uniformity->LeesDicomTags16(BeginAdres);

              char* VR = new char[sizeof(unsigned short)+1];
              memcpy(VR, &ptr16.vr, sizeof(unsigned short)); // Bytes kopieren
              VR[sizeof(unsigned short)] = 0;                // String nul termineren
              aVR = (AnsiString)VR;

              groep[tagCount] = ptr16.group;
              element[tagCount] = ptr16.element;
              lengt[tagCount] = ptr16.length;
              vr[tagCount] = aVR;

              if(ptr16.length > 0) {

                  for(int x = 0; x < ptr16.length; ++x )
                  {
                     DataString[tagCount] = (char *)ptr16.data; // inhoud string
                  }
                }
              lengte16 = ptr16.length;
              BeginAdres  +=  lengte16 + MDC_ACR_TAG_SIZE;
              ++tagCount;
            }
          }  // end for

     for(int i = 1; i < 2; ++i){

     sprintf(Group,"0x%.4X",groep[i]);
     sprintf(Element,"0x%.4X",element[i]);
     sprintf(Lengte,"%d",lengt[i]);

     MsgStr = (AnsiString)Group   + "    " +
              (AnsiString)Element + "    " +
               vr[i]              + "         " +
               Lengte             + "         " +
               DataString[i];
    }

  ShowMessage(MsgStr);

TListColumn *ListCol;
TListItem   *ListIt;

MainForm->ListView1->Items->Clear();
MainForm->ListView1->Columns->Clear();
MainForm->ListView1->ViewStyle = vsReport;

ListCol = MainForm->ListView1->Columns->Add();
ListCol->Caption = "Groep";
ListCol->Width = 50;
ListCol->Alignment = taCenter;

ListCol = MainForm->ListView1->Columns->Add();
ListCol->Caption = "Element";
ListCol->Width = 50;
ListCol->Alignment = taCenter;

ListCol = MainForm->ListView1->Columns->Add();
ListCol->Caption = "VR";
ListCol->Width = 50;
ListCol->Alignment = taCenter;

ListIt = MainForm->ListView1->Items->Add();
ListIt->Caption = "Groep";
ListIt->SubItems->Add(Group);
}
 
I solved it.

I removed the TListView and inserted it again.

Maybe some of the properties were not set correctly.

Johan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top