Re: Re[2]: how to pass PChar (or any pointer) from Delphi to FPC ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: how to pass PChar (or any pointer) from Delphi to FPC ?

Jonas Maebe-2

On 4 apr 2006, at 11:14, Пётр Косаревский wrote:

>> How do you transfer these pointers and what are you trying to
>> accomplish? You generally cannot transfer pointers from one running
>> program to another. It may work by accident in some cases, but it is
>> not something you can rely on (even if both programs are compiled by
>> the same version of the same compiler on the same OS and are running
>> on the same machine).
>> Jonas
>
> I transfer them as numbers. I work under win32. I transfer them as  
> LParam-s with PostMessage() WinAPI function. Numbers are  
> transferred correctly (I checked it with .messagebox/writeln).
>
> I try to have access to the same physical memory (I want to have  
> common read-write variable).

Each and every process has its own virtual memory space under win32  
(and most other operating systems). You cannot access the same  
physical memory this way (not in Delphi either), you must use some  
Win32-specific functions to setup a shared memory area and request  
the OS to map it in both processes. I don't know how to do this on  
win32.


Jonas

PS: in general always reply to the mailing list, unless people  
explicitly ask not to do that._______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re[4]: how to pass PChar (or any pointer) fromDelphi to FPC ?

Пётр Косаревский
-----Original Message-----
From: Jonas Maebe <[hidden email]>

> On 4 apr 2006, at 11:14, Пётр Косаревский wrote:
> >> How do you transfer these pointers and what are you trying to
> >> accomplish? You generally cannot transfer pointers from one running
> >> program to another. It may work by accident in some cases, but it is
> >> not something you can rely on (even if both programs are compiled by
> >> the same version of the same compiler on the same OS and are running
> >> on the same machine).
> >> Jonas
> > I transfer them as numbers. I work under win32. I transfer them as  
> > LParam-s with PostMessage() WinAPI function. Numbers are  
> > transferred correctly (I checked it with .messagebox/writeln).
> > I try to have access to the same physical memory (I want to have  
> > common read-write variable).
> Each and every process has its own virtual memory space under win32  
> (and most other operating systems). You cannot access the same  
> physical memory this way (not in Delphi either), you must use some  
> Win32-specific functions to setup a shared memory area and request  
> the OS to map it in both processes. I don't know how to do this on  
> win32.
> Jonas
> PS: in general always reply to the mailing list, unless people  
> explicitly ask not to do that._______________________________________________

1. Thank you, I was aware of something like that, but I was really looking for a way to setup that shared memory area.

2. I try to reply to the mailing list, but do not always check the "To:" field with autoreply (it's like posting the same bug report twice: just press refresh and you send new report instead of looking at the status of the previously posted).
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Re[4]: how to pass PChar (or any pointer) fromDelphi to FPC ?

Jonas Maebe-2

On 4 apr 2006, at 11:28, Пётр Косаревский wrote:

> 2. I try to reply to the mailing list, but do not always check the  
> "To:" field with autoreply (it's like posting the same bug report  
> twice: just press refresh and you send new report instead of  
> looking at the status of the previously posted).

The problem is that you set the reply-to field to your own mail  
address. The mailing list adds its own address to the reply-to field  
and when replying, mail clients therefore will send a mail both  
directly to you and to the list.

However, the list is configured to try to avoid sending duplicate  
mails, so the copy sent to the list does not get sent to you since  
you are already in the to-field.

The consequence is that the copy you get does not have the reply-to  
field set to go to the list, and therefore by default you will only  
send a mail to the person who answered you (unless you choose "reply  
all").

The easiest solution is probably to turn off the setting which adds a  
"reply-to" field for your own address to all mails you send.


Jonas_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal