Re: Get return from form in ActiveX dll

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



What's wrong with a UserForm

See my reply in vb.winapi.

RBS

"Karl E. Peterson" <karl@xxxxxxxx> wrote in message news:OB8dqhmLGHA.3196@xxxxxxxxxxxxxxxxxxxxxxx
RB Smissaert wrote:
Trying to make an ActiveX dll with VB6 to show a custom MsgBox. I
want to call a function with a number of arguments, such as the
prompt and the button captions and get a string return, which will be
the caption of the pressed button.

Sounds like way more work than necessary.

I will call this dll from Excel VBA.

What's wrong with a UserForm?

How do I now get the returned button?

Have the routine that displays the form query a property of the form before
unloading it, and returning that.

I could do it with a waiting loop, waiting till a button is pressed,
but this doesn't seem the right way.

Seems horrible, yes. Make the form modal.

I suppose I need to make an event class in the VBA code, but I am
trying to avoid this as I want to keep the number
of modules in this project down.

Could this be done with one simple function call?

I think you're looking at two modules. One with the function, and one being
the UserForm.
--
Working without a .NET?
http://classicvb.org/



.


Quantcast