Forum | | | |  funkheld | Hello, good day. I have this program for XPSE something changed. and it comes still a Error Message. I find whom type of Error not:

where stick the ? row 88 is in the XProfEd empty. CompileMarkSeparation {$cleq}
Def CopyMemory(3) !"KERNEL32","RtlMoveMemory"
Declare Ende%, SendeBtn&, EndeBtn&, Edit&
Declare Groesse&, Text$, ProgHndl&, AltProc&
Declare CopyData#, EigeneDaten#
Struct SCopyData = ~COPYDATASTRUCT
Dim CopyData#, SCopyData
Window 20,20-400,400
WindowTitle "Programm2"
EndeBtn& = Create(Button,%hWnd,Beenden,105,50,70,20)
SendeBtn& = Create(Button,%hWnd,Senden,15,50,70,20)
Edit& = Create(Edit, %hWnd, , 10, 15, 170, 24)
Proc Senden
Parameters Nachricht$
With CopyData#
.dwData& = 0
.cbData& = SizeOf(Nachricht$)
.lpData& = Addr(Nachricht$)
EndWith
Sendmessage(ProgHndl&,~WM_COPYDATA,%hWnd,Addr(CopyData#))
EndProc
Proc WndProc
parameters wnd&, msg&, wparam&, lparam&
If msg&=~WM_COPYDATA
CopyMemory(CopyData#,lparam&,12)
Groesse& = CopyData#.cbData&
Dim EigeneDaten#, Groesse&
CopyMemory(EigeneDaten#,CopyData#.lpData&,Groesse&)
Text$ = String$(EigeneDaten#,0)
Dispose EigeneDaten#
EndIf
return call(AltProc&,wnd&,msg&,wparam&,lparam&)
Endproc
AltProc&=~SetWindowLong(%hwnd,~GWL_WNDPROC,ProcAddr(WndProc,4))
While 1
ProgHndl&=FindWindow("Programm2")
Case ProgHndl&: Break
Sleep 100
EndWhile
Usermessages ~WM_COPYDATA
WhileNot Ende%
WaitInput
If %Key = 2
Ende% = 1
ElseIf GetFocus(EndeBtn&)
Ende% = 1
ElseIf GetFocus(SendeBtn&)
Senden GetText$(Edit&)
ElseIf %umessage=~WM_COPYDATA
SetText Edit&, Text$
Endif
EndWhile
Dispo CopyData#
End
Thank you.
greeting peter |
 | | | | |
| |  | type % So one Int -
presumably expects XProfan on the place no Int -
presumably with instructions How this: CompileMarkSeparation Dürfte so functions: CompileMarkSeparation Nochwas: CompileMarkSeparation You show for a wProc on a interpretierte Proc -
go thereby of Programmabstürzen from, time here time there. for something like with ProcAddr
absolutely on a nProc show there these nativen functions APC- & threadsicher
are. |
| | | | |
| |  | Mainwindow Subclassing z.B. so: CompileMarkSeparationdeclare owp&
cls
owp&=setWindowLong(hWnd,gwl_wndProc,procaddr(hWnd.wndProc,4))
waitinput
end
nProc hWnd.wndProc
Parameters wnd&,msg&,wp&,lp&
global owp&
return callWindowProc(owp&,wnd&,msg&,wp&,lp&)
oc
or without globale Variable: CompileMarkSeparationcls
setWindowLong(hWnd,gwl_userData,setWindowLong(hWnd,gwl_wndProc,procaddr(hWnd.wndProc,4)))
while 1
waitinput
wend
end
nProc hWnd.wndProc
Parameters wnd&,msg&,wp&,lp&
if msg&=wm_lButtonDown
exitProcess(22)
endif
return callWindowProc(getWindowLong(wnd&,gwl_userData),wnd&,msg&,wp&,lp&)
endproc
guaranteeing absturzsicher.
Related Examples end this Dokumentes: [...] 
Note:
XProfan-Fehlermeldungen-Fehlerzeile-indicated at employment with XPSE should the Line in the dateiname.ENH-File correspond to. |
| | | | |
| |  funkheld | Jup, thanks. have I now changed. it launch, but freeze then one. somehow is the program not whom latest stood.
Why the because now? or have you got somewhere one Program , where one data from a window to that . Develop Send can ?
Thank you.
greeting peter |
| | | | |
| |  | For this is the function sendMessage Yes there, circa data on Controls/ Window To Send.
so can integrally useful 3 ganzzahlige values übermitteln: CompileMarkSeparation |
| | | | |
| |  | Nachtrag:
I see the You wm_copyData use want -
power eig. only sense if one More as 3 values übermitteln would like How z.B.
a Stringinhalt. wm_copyData as UserMessage can but not reliably
functions there to that Time the Auslesens of WP and LP The data not
More available stand (must) since the data normal only such a long time consist
To The Message The wProc access has. You can however wm_copyData-
übermittelte data in the wProc receive and from there weiterverwenden. |
| | | | |
| |  funkheld | I have here something found. functions to my imaginations..
herewith send I now : CompileMarkSeparation {$cleq}
Declare Ende&, senden&, Dlg&,wert&
declare IsActive&, InMemory&, SizeOfMem&, hmap&, hMapView&
Dlg& = Create("Dialog", %hwnd, "Senden", 220, 190, 410, 280)
senden& = Create("Button", Dlg&, "Senden", 110, 220, 80, 30)
Ende& = Create("Button", Dlg&, "Ende", 210, 220, 80, 30)
IsActive& = 0
InMemory& = 4000
'1024 Bytes Speicher
SizeOfMem& = 1024
'Speicherbereich anlegen
hmap& = ~CreateFileMapping(-1,0,~PAGE_READWRITE,0,SizeOfMem&,"MeinSpeicher")
'Zeiger auf Speicherbereich ermitteln
hMapView& = ~MapViewOfFile(hMap&,$000F001F, 0, 0, 0)
'die ersten 4 Bytes erhalten das Fensterhandle
Long hMapView&,0 = %hwnd
'die nächsten 4 Bytes bleiben frei für das Fensterhandle von Programm 2
wert&=0
WhileNot @Clicked(Ende&)
WaitInput
If @Clicked(senden&)
If Long(hMapView&,4) <> 0
IsActive& = 1
Endif
dat_send
EndIf
EndWhile
End
proc dat_send
wert&=wert&+1
long hMapView&,8 = wert&
If IsActive&
sendMessage(Long(hMapView&,4),InMemory&,0,0)
endif
endproc
herewith becomes receive: CompileMarkSeparation {$cleq}
Declare IsActive&, InMemory& , Ende&, SizeOfMem&, hmap&, hMapView&
IsActive& = 0
InMemory& = 4000
Ende& = 0
'1024 Bytes memory
SizeOfMem& = 1024
'Speicherbereich lay out
hmap& = ~CreateFileMapping(-1,0,~PAGE_READWRITE,0,SizeOfMem&,"MeinSpeicher")
'Zeiger on Speicherbereich detect
hMapView& = ~MapViewOfFile(hMap&,$000F001F, 0, 0, 0)
Cls
'The second 4 Bytes receive the Fensterhandle
Long hMapView&,4 = %hwnd
User Messages InMemory&
whilenot Ende&
Waitinput
If %UMessage = InMemory&
Print long(hMapview&,8)
Endif
EndWhile
~UnmapViewOfFile(hMapView&)
~CloseHandle(hMapView&)
End
becomes these : %UMessage jedesmal to the durchlauf on "0" staid and new described with of/ one new Übertragung or remaining with the first link %UMessage on the worth InMemory& ?
Thank you.
greeting peter |
| | | | |
| |  | | | | | |
| |  funkheld | Jup, thanks. now can I The Sendmessage discern or sort.
greeting peter |
| | | | |
|
AnswerThemeninformationenthis Topic has 2 subscriber: |