Jim,
The reason you were not able to use FindWindow is because your Active-X DLL
is running "Off" the desktop. This is because IIS (the Web server) runs as
a service and by default, it does not have access to the desktop. So, all
window operations will either fail or fail to work properly. Interestingly
enough, if the EXE was run off the desktop, FindWindow will find it. In any
case, if you want to use OLE automation, you do not need the HWND. You can
always try to obtain an IDispatch pointer to your EXE and if that fails, you
start it up, then try again.
Regards,
Dennis.
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Jim Zheng
> Sent: Tuesday, 31 August 1999 13:47
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: How to communicate to program running on NT WEB
> server?
>
>
> Hi, Dennis,
>
> Thanks for your ideal.
>
> I am writing both ActiveX DLL client used for a WEB page and
> the EXE server
> as an OLE automation server and using FindWindow to restrict
> only one copy
> of EXE sever running. But ActiveX doesn't talk to the one
> already running,
> it always fires another copy of EXE running in different
> memory space when
> browse the WEB page with the ActiveX. I have a form in the
> EXE. I could
> never see the form for that one fired by ActiveX, while I can
> see the manual
> running one.
>
> Now I am trying to use socket to solve the problem.
>
> Jim
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]] On
> Behalf Of Dennis Chuah
> Sent: Tuesday, August 31, 1999 9:47
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: How to communicate to program
> running on NT WEB server?
>
>
> Jim,
>
> Hi. It really depends on the ActiveX and EXE. If you are
> writing both,
> then you have a variety of methods (from the simplest):
>
> 1. If both are database driven, you can write stuff into a
> table and have
> both poll the table. If they are not, you can use a disk file.
> 2. Use WM_COPYDATA messages / named shared memory.
> 3. Use DDE
> 4. Use Mailslots, named pipes
> 5. Use TCP / UDP sockets
> 6. Design the EXE as an OLE automation server, with the
> ActiveX DLL the
> client.
>
> Now, to talk to the EXE, you will need to determine whether
> it is running or
> not. You can use EnumProcesses / FindWindow API calls for this.
>
> Hope this helps.
> Dennis.
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
> Behalf Of Jim Zheng
> Sent: Monday, 30 August 1999 11:28
> To: Multiple recipients of list delphi
> Subject: [DUG]: How to communicate to program running on NT
> WEB server?
>
>
> Hi all,
>
> Has anyone any ideal for how an ActiveX OCX communicate to a
> program already
> running on the NT Web server?
> I don't want the OCX launching another copy of the program.
>
> Kindest Regards
>
> Jim
>
>
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz