delphi - Event when postmessage() receives c# -
i have unmanaged dll delphi , integrated there events fire @ points on runtime. on manual says calls win32 api postmessage()
.
when event fired text message sent , wparam , iparam have other information.
how can fire event c# application when message dll posted , ofcourse information?
update:
trying describe manual saying: have function called init() accepts handle parameter passing follows:
wr.init((intptr)this.handle);
from c# winform application unmanaged dll returns true if fine , seeing.
now manual says:
when event (from dll) fired sends windows message window handle supplied init function, infact postmessage() win32 api called.
and have list of messages sent on postmessage() example:
textmessage: wm_tech_brokenline wparam: point (which number displaying example broken) iparam: 0
now explained want when message 1 above posted dll fire event c# , ofcourse text message , params
the steps necessary follows:
- obtain window handle window in c# program.
- pass window handle unmanaged dll knows send messages.
- in c# code, add code receive , respond message arriving.
as alternative above might prefer keep gui windows of program separate message passing mechanism. in case following:
- create subclass of
nativewindow
handle incoming messages. - create instance of class , pass window handle unmanaged dll.
- override
wndproc
in window class , handle message there. @ point can surface event.
this latter approach gives better separation of interop code gui, , allow make wrapper less tangled gui.
in order describe of in more detail, 1 need know details of program. instance, winforms or wpf? program have window @ hand receive messages? how string encoded? in message arg arrive? how memory string deallocated if message delivered asynchronously?
i suspect you'll have answers of these questions, perhaps not all. know @ high level need do, need find out more details own program.
Comments
Post a Comment