Best way for inter-process communication

Just starting out? Need help? Post your questions and find answers here.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

I think in the first code I got me brains stuck between the structures and I made a huge mess there. The correctly initialized descriptor is made like in the second code.

I'm trying now to see if you can OpenFileMapping_() and use it. If not, everything is in vain.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Oh my God!

It works!

Man I'm soooo happy I could kiss you all! :lol:

Code: Select all

Structure StringIPC
 s.s{#MAX_PATH}
EndStructure

;*m_MapHandle = CreateFileMapping_(#INVALID_HANDLE_VALUE, @sa, #PAGE_READWRITE, 0, SizeOf(StringIPC),"map")
;*ptr.StringIPC = MapViewOfFile_(*m_MapHandle,#FILE_MAP_ALL_ACCESS,0,0,0)

*m_MapHandle = OpenFileMapping_($FFFFFF, 0,"map")
*ptr.StringIPC = MapViewOfFile_(*m_MapHandle,#FILE_MAP_ALL_ACCESS,0,0,0)

Debug GetLastError_() ;will say '0' - ok

*ptr\s = "Alex" 
Tested with XP sp2 home edition. I ran the service from an admin account, logged off and ran the other user mode app on a limited acc. and it worked. The message was sent. I don't have Vista and I won't bother to get a pirated copy :lol: . It doesn't deserve to run my code, so if anyone would please test it and tell me if it works i'd be very greatfull.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Inf0Byt3 wrote:Oh my God!

It works!

Man I'm soooo happy I could kiss you all! :lol:
Uhm, srod doesn't swing that way I'm afraid!

You could try Dare, I hear he fields for both sides! :twisted:

(That's it, I'm toast!)
I may look like a mule, but I'm not a complete ass.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

:lol:

I don't swing no way lately...

PB * is my girlfriend and I think it'll stay that way for a long time...

With jokes aside, I'm as straight as a man can be. But today it's been a great day for me. Every little thing went just fine and that's really odd :lol: . Wonder what tomorrow will be, you might have to visit me at the hospital.

* Disambiguation: PB = PureBasic
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply