delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

But it gave me error pointing on 'strPointer' that it is not compatible. How can i display this address.
P.S:
I just want to know how can i display the address, don't want ideas that i can watch the address while debugging or something else. Thnks


Hi,
I have memory address of some PChar string in PChar pointer
Delphi Code:
[url=#top]
[/url]Original
                - Delphi Code
strPointer : ^PChar;
strPointer := @somePCharVariable;
  1. strPointer : ^
  2. PChar
  3. ;
  4. strPointer := @somePCharVariable;
Copy Code
I want to display this value in message box, I tried this
Delphi Code:
[url=#top]
[/url]Original
                - Delphi Code
MessageDlg (strPointer, mtError, mbOkCancel, 0);
  1. MessageDlg
  2. (
  3. strPointer, mtError, mbOkCancel,
  4. 0
  5. )
  6. ;
Copy Code
But it gave me error pointing on 'strPointer' that it is not compatible. How can i display this address.
P.S:
I just want to know how can i display the address, don't want ideas that i can watch the address while debugging or something else. Thnks

TOP


Originally Posted by alee
Hi,
I have memory address of some PChar string in PChar pointer
Delphi Code:
[url=#top]
[/url]Original
                - Delphi Code
strPointer : ^PChar;
strPointer := @somePCharVariable;
  1. strPointer : ^
  2. PChar
  3. ;
  4. strPointer := @somePCharVariable;
Copy Code
I want to display this value in message box, I tried this
Delphi Code:
[url=#top]
[/url]Original
                - Delphi Code
MessageDlg (strPointer, mtError, mbOkCancel, 0);
  1. MessageDlg
  2. (
  3. strPointer, mtError, mbOkCancel,
  4. 0
  5. )
  6. ;
Copy Code
But it gave me error pointing on 'strPointer' that it is not compatible. How can i display this address.
P.S:
I just want to know how can i display the address, don't want ideas that i can watch the address while debugging or something else. Thnks
A pointer is a 32 bit integer.
MessageDlg expects a string.
Clive

TOP

yeah i know .. that's y i was asking.
I used the following thing to display the address
Delphi Code:
[url=#top]
[/url]Original
                - Delphi Code
var
    ptrMailId : ^PChar;
    ptrPassword : ^PChar;
begin
    ptrMailId := @mailId;
    ptrPassword := @mailPass;

    MessageDlg ('Email = ' +IntToStr(Integer(ptrMailId)), mtCustom, mbOKCancel, 0);
    MessageDlg ('Password = ' +IntToStr(Integer(ptrPassword)), mtCustom, mbOKCancel, 0);
  1. var
  2.     ptrMailId : ^
  3. PChar
  4. ;
  5.     ptrPassword : ^
  6. PChar
  7. ;
  8. begin
  9.     ptrMailId := @mailId;
  10.     ptrPassword := @mailPass;
  11. MessageDlg
  12. (
  13. 'Email = '
  14. +
  15. IntToStr
  16. (
  17. Integer
  18. (
  19. ptrMailId
  20. )
  21. )
  22. , mtCustom, mbOKCancel,
  23. 0
  24. )
  25. ;
  26. MessageDlg
  27. (
  28. 'Password = '
  29. +
  30. IntToStr
  31. (
  32. Integer
  33. (
  34. ptrPassword
  35. )
  36. )
  37. , mtCustom, mbOKCancel,
  38. 0
  39. )
  40. ;
Copy Code




But it gave me error pointing on 'strPointer' that it is not compatible. How can i display this address.
P.S:
I just want to know how can i display the address, don't want ideas that i can watch the address while debugging or something else. Thnks

TOP

Back Forum