AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Exceptions

Ein Thema von Pseudemys Nelsoni · begonnen am 19. Mai 2004 · letzter Beitrag vom 19. Mai 2004
 
MathiasSimmack
(Gast)

n/a Beiträge
 
#5

Re: Exceptions

  Alt 19. Mai 2004, 07:27
Ich persönlich habe Bedenken deswegen:
Zitat von Pseudemys Nelsoni:
Delphi-Quellcode:
      if RegQueryValueEx(KeyH, PAnsiChar(Key), nil, nil, nil, @dwLen) = ERROR_SUCCESS then
      begin
        Setlength(value, dwLen - 1);
Im PSDK wird gesagt, dass die benötigte Puffergröße in die dword-Variable geschrieben wird, wenn diese vorher mit einem Wert belegt war. Ob nun 0 oder 1, spielt keine Rolle. Das "NULL" im Text des PSDK entspricht ja dem "NIL" von Delphi:
Zitat:
If lpData is NULL, and lpcbData is non-NULL, the function returns ERROR_SUCCESS and stores the size of the data, in bytes, in the variable pointed to by lpcbData. This enables an application to determine the best way to allocate a buffer for the value's data.
Da steht aber nicht so was wie
Zitat:
... and stores the size of the data, in bytes, in the variable [...] not including the last character
Ich würde den Puffer daher so lassen und bei Strings erst nach dem erfolgreichen Auslesen das letzte Zeichen entfernen. Oder evtl. prüfen ob das letzte Zeichen auch wirklich #0 ist.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:18 Uhr.
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