Problem getting string from memory address

Startbeitrag von Gary Williams am 06.02.2016 11:56

I am using Event() to capture a Windows API message sent to my WinDev (20) application.

The event capture works well, I get the MessageID and the HWnd id but I can't retrieve the message string.

In my test I am simply sending "Hello" as UniCode terminated with character 0.


PROCEDURE EventDataCapture(nMessageID is int, nHWnd is system int , nMessagePointer is system int)

sMessage is string on 6

sMessage = StringRetrieve(nMessagePointer,srUNICODEAddress) // Crashes WinDev - Unexpected internal error
sMessage = StringRetrieve(&nMessagePointer,srUNICODEAddress) // Returns "??????"

Transfer(&sMessage,nMessagePointer,5) // Says Bad Source It does not match a valid memory address in read mode.
Transfer(&sMessage,&nMessagePointer,5) // Produces "Á‡"


I know that nMessagePointer is the same value as when it left the sending application, so it seems to be an issue with WinDev accessing the memory address.

Any ideas?


Gary

Antworten:

Hi, there's the concept of "protected memory" which ensures that an application can only access memory which belongs to that application. A GPF (general protection failure) is usually given back. Is that the case?

von GuenterP - am 06.02.2016 16:56
Quote
GuenterP
Hi, there's the concept of "protected memory" which ensures that an application can only access memory which belongs to that application. A GPF (general protection failure) is usually given back. Is that the case?


Don't think this is the case here, Error in WinDev is not that clear, but I can read the memory from another FoxPro programme.

von Gary Williams - am 08.02.2016 10:04
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.