Re: getting an event handler from a active-x dll dispinterface



On 26 Dec 2006 06:13:47 -0800, "Marc Rohloff"
<marcrohloff_ng@xxxxxxxxxxx> wrote:


I have imported a active-x dll into delphi for communicating with a
device trough com-port.

I managed to create an object with a sendmessage procedure and used it
succesfully. I now want to create events to receive messages but since
I only know for about 10% what i'm doing I don't know where to start.
Also I signed a non-disclosure contract with the firm of the device so
I can't be too specific I guess.

When you import the ActiveX select the option to create a component,
the resulting component should have the events.

However why don't you try and find a native Delphi component, there are
many good ones available. (Try looking at somewhere like www.torry.net
or http://delphi.icm.edu.pl )

I have used 2 different serial components to communicate to the device
..
All works perfectly with a program SIMULATING the blood test machine
(made by the manufacterer) on another pc connected trough a 0-modem.
All goes almost perfect with the machine itself but for one simple
detail.
The machine wants to have an acknowledgement message after each
message it sends itself.
The machine recognizes this acknowlegdement when i send it after a
port or status inquiery.
It simply won't recognize this acknowledgement when i send it to the
device after blood test results have been sent.
I get the results fine, but the machine thinks I didn't.
Consequence 1 is it keeps resending old results over and over again at
machine start and port inquiery
Consequence 2 is it will not send a subsequent set of results from
another blood analyzer that is connected to the main machine.

I mailed with the manufacterer but they don't understand it at all.

The acknowledgement should be sent within 3 seconds of getting the
result.
I have tried tons of different timings all with no result. I even made
a test program in which i send all messages manually operating buttons
in response to a terminal memo. Recognizing the PC goes well this way
(an icon shows on the blood analyzer) and the machine sends back an
acknowledgement to me. Transeferring the results remains unsuccesfull.

One of the things they suggested is try the dll
I now have created a situation where I receive messasges through a
serial component and send acknowledgements through the com object from
the dll (activating one and the other alternatively).
On a terminal on another pc I can see my program is sending exactly
rhe right string for acknowledgement as verified by the manufacterer
of the device. Status/port acknowledgent again goes well. Problem
remains

Yes, I am getting very frustrated.
.


Quantcast