Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   C++ und Delphi -> Rekursiv Problem (https://www.delphipraxis.net/53534-c-und-delphi-rekursiv-problem.html)

clues1 18. Sep 2005 18:31

Re: C++ und Delphi -> Rekursiv Problem
 
Liste der Anhänge anzeigen (Anzahl: 2)
HILFE ich blicke nicht mehr durch ???

Dieser Code bricht eher ab als der untere.
Im gegensatz zum oberen habe ich nur die printf Zeilen drin. Hier kommt aber die Meldung siehe "Fehler2.png"
Code:
int FLoadNodes(int id) { 
  int i;
  int c;
 
  i = -1;
  do { 
    i++; // inc
   
    c = LoadNodes(id, 1); // count of the Nodes
    printf("B:");
    printf(itoa(id));
    printf("|");
    printf(itoa(i));
    printf("|");
    printf(itoa(c));
    printf("|");

    if (i < c) { 
      if (ReadNode(i, &NavRes)) { 
         FLoadNodes(NavRes.ID);
         // Saving now the result in a treeview
         // NavRes.ID  <= ID of the entry in the DB (UNIQUE)
         // NavRes.txt  <= Text of the entry in the DB for the caption of the node in a treeview

      } 
    } 
   
    c = LoadNodes(id, 1); // count of the Nodes
    printf("R:");
    printf(itoa(id));
    printf("|");
    printf(itoa(i));
    printf("|");
    printf(itoa(c));
    printf("|");

  } while (! ((c == 0) || (i >= c-1)));
}
hier kommt "Fehler3.png"
Code:
int FLoadNodes(int id) { 
  int i;
  int c;
 
  i = -1;
  do { 
    i++; // inc
   
    c = LoadNodes(id, 1); // count of the Nodes

    if (i < c) { 
      if (ReadNode(i, &NavRes)) { 
         FLoadNodes(NavRes.ID);
         // Saving now the result in a treeview
         // NavRes.ID  <= ID of the entry in the DB (UNIQUE)
         // NavRes.txt  <= Text of the entry in the DB for the caption of the node in a treeview

      } 
    } 
   
    c = LoadNodes(id, 1); // count of the Nodes

  } while (! ((c == 0) || (i >= c-1)));
}

@Dax ; ist egal ob da oder nicht da.

clues1 18. Sep 2005 18:49

Re: C++ und Delphi -> Rekursiv Problem
 
Ich glaube aber diesmal ist das Problem gelöst.

// Declare all dll functions
typedef bool __stdcall (*POPENDB)(LPTSTR Filename);
typedef int __stdcall (*PLOADNODES)(int id, int ix);

typedef int __stdcall (*PNNN)(int id); number ID

typedef bool __stdcall (*PREADNODE)(int Nr, TNavRes* res); (entry)

hatte ich doch glatt __stdcall vergessen :)
Aber ich habe wieder einiges gelernt.

Wenn es noch nicht gelöst ist, werde ich mich nochmals melden.


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:51 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz