| |
|
|
Julian Schmidt | Hi, I Search example to communication between two XProfan-Programs.
to that a bräuchte I an example, with which one from a ongoing XProfan-Program one other XProfan-Program with different Parameters aufruft, which The Parameter auffängt and weiterverarbeitet.
to that second an example, with which one from a ongoing XProfan-Program Strings to another current XProfan-Program Send can, which then processing go. at that second example should The Strings eindeutig only on the a Program gesendet go can. speak no Dopplungen with others Windows possible his, as about with FindWindow the case is.
LG
Julian57 |
|
|
| |
|
|
|
Jörg Sellmeyer | look time in the Help under "Multiprozessing with XProfan" to. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/15/12 ▲ |
|
|
|
|
Julian Schmidt | Wow, there shining it already well Opportunities To give.
nevertheless would find I it well, if time someone a View source to one verfasst. |
|
|
| |
|
|
|
Andreas Miethe
| OK, here time one small example :
The Server reads a String of Client and changes it.
Client Please first started
'CLIENT
'Client
$H windows.ph
Var IsActive& = 0
Var InMemory& = 4000
Var Ende& = 0
'1024 Bytes memory
Var SizeOfMem& = 1024
'Speicherbereich lay out
Var hmap& = ~CreateFileMapping(-1,0,~PAGE_READWRITE,0,SizeOfMem&,"MeinSpeicher")
'Zeiger on Speicherbereich detect
Var hMapView& = ~MapViewOfFile(hMap&,$000F001F, 0, 0, 0)
'so is the Speicherbereich laid out
Cls
'the first 4 Bytes receive the Fensterhandle
Long hMapView&,0 = %hwnd
'The next 4 Bytes stay spare for the Fensterhandle of Program 2
'I question but ex, whether Program2 already runs
If Long(hMapView&,4) <> 0' if the worth filled is, then runs Program2
IsActive& = 1
else
'with ShellExecute() can I Program2 here by hand started
Endif
String hMapView&,8 = "String of Program1"+Chr$(0)'Strings always with a Nullbyte abschliessen
'is Program2 active, mail I The Message, the itself something in memory befindet
If IsActive&
SendMessage(Long(hMapView&,4),InMemory&,0,0)
Endif
'of Program becomes a Message get back
User Messages InMemory&
whilenot Ende&
Waitinput
If %UMessage = InMemory&
Locate 0,0
Print String $(hMapview&,8)
Endif
EndWhile
~UnmapViewOfFile(hMapView&)
~CloseHandle(hMapView&)
End
'SERVER
'Server
$H windows.ph
Var IsActive& = 0
Var InMemory& = 4000
Var Ende& = 0
'1024 Bytes memory
Var SizeOfMem& = 1024
'Speicherbereich lay out
Var hmap& = ~CreateFileMapping(-1,0,~PAGE_READWRITE,0,SizeOfMem&,"MeinSpeicher")
'Zeiger on Speicherbereich detect
Var hMapView& = ~MapViewOfFile(hMap&,$000F001F, 0, 0, 0)
'so is the Speicherbereich laid out
Cls
'The second 4 Bytes receive the Fensterhandle
Long hMapView&,4 = %hwnd
Print String $(hMapView&,8)
String hMapView&,8 = "Programm 2 : have whom String red and geändert"+Chr$(0)'Strings always with a Nullbyte abschliessen
SendMessage(Long(hMapView&,0),InMemory&,0,0)
User Messages InMemory&
whilenot Ende&
Waitinput
If %UMessage = InMemory&
Locate 0,0
Print String $(hMapview&,8)
Endif
EndWhile
~UnmapViewOfFile(hMapView&)
~CloseHandle(hMapView&)
End
|
|
|
| Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 03/15/12 ▲ |
|
|
|
|
Julian Schmidt | Jup, the shining quite well with functions.
only I had me rather an example To of my first question erhofft. you have but one To of my second question prepares. |
|
|
| |
|
|
|
Dieter Zornow | so ought to The Parameterübernahme klappen, with ProfanX2 tested
|
|
|
| XProfan X2Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 03/16/12 ▲ |
|
|
|
|
RGH | to question 1: in the first Program launch You, the second Program integrally simply with WinExec() and hang The Parameter simply on whom appeal dran. If the Parameter Sonder- and/or space include, setting You tappt im dunkeln in quotation marks. in the second Program can You these Parameter over %ParCount, and Par$() inquire (see Help).
to question 2: too the goes integrally without API with Create("FileMap",...) and MapFile(). One example find You in the Help under "28.13 - File-Mapping - Speicherdateien".
Greeting Roland |
|
|
| XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/16/12 ▲ |
|
|
|
|
Julian Schmidt | OK, be then first with enough Info bedient. thanks you all. |
|
|
| |
|
|
|
| RGH (16.03.12)
to question 1: in the first Program launch You, the second Program integrally simply with WinExec() and hang The Parameter simply on whom appeal dran. If the Parameter Sonder- and/or space include, setting You tappt im dunkeln in quotation marks. in the second Program can You these Parameter over %ParCount, and Par$() inquire (see Help).
MAX_PATH = 260 and the are not so dolle many characters especially since there the Programmpfad and Dateiname already include is.
from the reason can recommend solely a handle as Parameter To transfer -
z.B. the hWnd-lever so the aufgerufene Program white where it Messages Send should.
the communicate is against by wm_copyData ( [...] ) very simply too without Speicherdatei. XProfan-example: [...]
i'd presumably but differently as in this XProfan-example so named SubClassProc benefit -
User Messages are against for a secure processing this wm_copyData-Message not suitable. |
|
|
| |
|
|
|
Jörg Sellmeyer | I faith not, that the length the Programmpfades what with the length the Parameter To do has. Angehängtes Program velvet Ordner time into directory on eurem Desktop pack and started.
its this code:
|
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/16/12 ▲ |
|
|
|
|
| too interestingly:
crashes by me ex.
here CreateProcess ( [...] ):
The command line to be executed. The maximum length of this string is 32,768 characters, including the Unicode terminating zero character. If lpApplicationName is NULL, the module name portion of lpCommandLine is limited to MAX_PATH characters. |
|
|
| |
|
|
|
Jörg Sellmeyer |
lpApplicationName is NULL
no idea, what the hot should. which ApplicationName is because NULL? |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/16/12 ▲ |
|
|
|