ActiveX-Dll cannot show non-modal forms 
Author Message
 ActiveX-Dll cannot show non-modal forms

Hello!

I have written an Active-X DLL in VB which opens a modeless form. The host
should use this ActiveX-Dll as Add-In and calls a certain procedure to open
the modeless form. But I get the error message, that non-modal forms cannot
be shown in the Host by an ActiveX-Dll. Why that?
Propably the ActiveX-Form has a problem because of the missing owner form,
which is the main form of the host. Can I set the host form a parent for the
ActiveX-Form? Or is there a chance to assign the application handle of the
host to the application handle of the ActiveX-dll (but app.hinstance is
readonly). In delphi there are no problems with modeless Dll-windows if you
set the application handle correctly.

Thanks in advance,
Robert



Mon, 06 Dec 2004 17:20:58 GMT  
 ActiveX-Dll cannot show non-modal forms
I have searched for several solutions on the microsoft homepage, but all
those solutions don't work in my case:
-) The Add-In must be created by the COM-server and not standalone.
-) The ActiveX-library must be compiled in a single-threaded mode (not in
apartment mode).

I don't wanna open my add-in window modal! Isn't there a solution that
works! Or is VB not the suitable language for writing add-ins?`

Robert



Mon, 06 Dec 2004 19:33:28 GMT  
 ActiveX-Dll cannot show non-modal forms
There is a solution.  In your code where you open it do it like this:

Private Declare Function ShowWindow Lib "User32" Alias "ShowWindow" (ByVal
hWnd As Long, _
    ByVal nCmdShow As Long) As Long
Private Const SW_SHOW=5
Public Sub Show()
    Dim frm As New frmMyForm
    Call ShowWindow(frm.hWnd,SW_SHOW)
End Sub

You can find this tip posted here:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3...
gWId=1

And other tips here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3...
gWId=1

Hope this helps.

--
----------------------------------------------------------------------------
-------------------
Clint LaFever
http://vbasic.iscool.net
Home of the Extended ListView (Free)
Edit any subitem with dropdown, textbox, command button, calendar or custom
entry field
Many other features
----------------------------------------------------------------------------
-------------------

Quote:
> I have searched for several solutions on the microsoft homepage, but all
> those solutions don't work in my case:
> -) The Add-In must be created by the COM-server and not standalone.
> -) The ActiveX-library must be compiled in a single-threaded mode (not in
> apartment mode).

> I don't wanna open my add-in window modal! Isn't there a solution that
> works! Or is VB not the suitable language for writing add-ins?`

> Robert



Tue, 07 Dec 2004 00:24:33 GMT  
 ActiveX-Dll cannot show non-modal forms

Quote:
> Private Declare Function ShowWindow Lib "User32" Alias "ShowWindow" (ByVal
> hWnd As Long, _
>     ByVal nCmdShow As Long) As Long
> Private Const SW_SHOW=5
> Public Sub Show()
>     Dim frm As New frmMyForm
>     Call ShowWindow(frm.hWnd,SW_SHOW)
> End Sub

Thank you for this working solution!

Robert



Tue, 07 Dec 2004 18:03:19 GMT  
 ActiveX-Dll cannot show non-modal forms
Your are very welcome.

--
----------------------------------------------------------------------------
-------------------
Clint LaFever
http://vbasic.iscool.net
Home of the Extended ListView (Free)
Edit any subitem with dropdown, textbox, command button, calendar or custom
entry field
Many other features
----------------------------------------------------------------------------
-------------------

Quote:

> > Private Declare Function ShowWindow Lib "User32" Alias "ShowWindow"
(ByVal
> > hWnd As Long, _
> >     ByVal nCmdShow As Long) As Long
> > Private Const SW_SHOW=5
> > Public Sub Show()
> >     Dim frm As New frmMyForm
> >     Call ShowWindow(frm.hWnd,SW_SHOW)
> > End Sub

> Thank you for this working solution!

> Robert



Fri, 10 Dec 2004 22:32:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ActiveX OCX cannot be open form non-modal.

2. ActiveX DLL events won't fire when DLL shows Modal Form

3. Calling non-modal ActiveX DLL form

4. ActiveX DLL and non-modal forms

5. ActiveX control on modal form give 'can't show non-modal form when modal form is displayed'

6. "Non-modal forms cannot be displayed..."

7. non-modal form cannot be displayed ..

8. Non-modal forms cannot be displayed in this host application

9. MODAL FORM & NON MODAL FORM

10. MODAL FORM & NON MODAL FORM

11. Showing non-modal form from within Windows Scripting Host

12. Show non-modal form

 

 
Powered by phpBB® Forum Software