Discussion Locked

Returning data from ActiveX DLL

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm trying to take an EXE that has approximatey 35 forms in it, and break it down into ActiveX DLLs and ActiveX EXEs.

As an example, the main app would sometimes show a form where the user sees 10 command buttons numbered 1 to 10 - like the keys on the right side of your keyboard. The main app would then take the number pressed and use it.

I have created a DLL using this Number form and created a clsClass1. The necessary properties are TTop and LLeft (to know where to move the form onthe screen - Me.move LLeft, TTop). These properties have to be set by the main EXE.

When the user finishes pressing on of the command buttons (numbers), the DLL must convey to the main EXE which button was pressed.

I know the main EXE must set a reference to the new DLL so as to expose the clsClass1. I've read a lot about 'RaiseEvent's, Defining objects 'WithEvents', and 'Implements clsClass1'. Putting everything together is my real problem.

Any ideas???

Thanx in advance.

Jerry K.

3 replies

by manoj

Hi Jerry

This is what you can do -
Create an event in the class. Whenever the user presses a button raise this eventin your DLL.
In the EXE create an object of the DLL WITHEVENTS. This will give your EXE access to the event from the DLL and the data can be passed to the EXE from the DLL. You are on the right track.
Also you can pass info by exposing public properties from the DLL. That way the GET method of the DLL will receive info back.

Thanks

Manoj

This discussion is closed to new replies.