English
Forum

communication between XProfan-Programs

 
- Page 1 -



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
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
03/15/12  
 



 
- Page 1 -



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.
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
03/15/12  
 




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.
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
03/15/12  
 




Dieter
Zornow
so ought to The Parameterübernahme klappen, with ProfanX2 tested
Proc incoming

    var mem& = External("kernel32","GetCommandLineA")
    var in$ = string $(mem&,0)
    var p&= External("shlwapi.dll","PathGetArgsA",addr(in $))
    var para$ = string $(p&,0)

    if left$(para$,1) = "\q"

        External("shlwapi.dll","PathUnquoteSpacesA",addr(para$))
        para$ = left$(para$,len(para$)-2)

    endif

    return para$

endproc

cls
Print incoming()
waitinput
 
XProfan X2
Er 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 X2
Intel 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.
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
03/16/12  
 



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.
 
03/16/12  
 




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:
Print "Anzahl the Parameter:",%parcount
Declare s$
Print "Länge the Programmpfades:",Len(Par$(0))

WhileLoop 0,%parcount

    s$ = s$ + " \q" + Par$(&Loop) + "\q"

Wend

Print s$
Print "Länge the Parameter:",Len(s$)
WaitInput
Case %parcount < 6:Run Par$(0) + " " + " " + s$

451 kB
Kurzbeschreibung: Program in deeper Ordnerstruktur
Hochgeladen:03/16/12
Downloadcounter101
Download
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/16/12  
 



too interestingly:
 {$cleq}

if parCount==1

    print len(par$(1))
    waitInput

else

    shell par$(0)+" \q"+mkstr$("1234567890",30)+"\q"

endif

end

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.
 
03/16/12  
 




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  
 



 
- Page 2 -


well if one for first Parameter 0 einsetzt:  [...] 

tappt im dunkeln write of course "the module name portion of lpCommandLine is limited to MAX_PATH characters" and even not the The Parameter not longer his can but with XProfan krachts Yes nevertheless.

therefore my hint only a handle as Param To transfer because I with the the dahingehenden Kracherei hold already know.
 
03/16/12  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

20.493 Views

Untitledvor 0 min.
iF12/05/18
p.specht04/03/16
Georg Teles05/20/14
Ernst05/12/14
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie