Problem with dialog box inside of COM object

I have an OLE automation server dll that opens a modal dialog box.  When I
attach to the server from my main application and it opens the dialog box,
the dialog "gains the focus" but stays in the background, behind my main
application's form.  Calling "SetForegroundWindow(Handle)" in the dialog's
FormShow event causes the icon on the task bar to blink, but the dialog stays
in the background.  I've tried a number of different things, but nothing
seems to work.  Can anyone show me how to correct this behavior?