Help ! ActiveX Dll Gurus 
Author Message
 Help ! ActiveX Dll Gurus

Hi,

I try to build an ActiveX Dll to create a connection to a database. This Dll
allows the user to enter a login and a password to establish a connection to
the database.

My VB program runs like that :

1. I start the VB application showing MDI Form

2. I create an instance of my Connection object, call the method to
establish the connection. This method opens a modal form with textbox
(Username, Password) and buttons.

If I click on my MDI Form when the Modal Connection form is opened, the
Modal form for the connection disappears behind the MDI, a dialog box with 2
command buttons "Switch to" and "Retry" appears with the following message :

    "This action cannot be completed because the other application is busy.
Choose "switch to" to activate the busy application and correct the
problem."

I can click on "Switch" or "Retry", but I never go back to my Connection
form and I have to kill  my application.

How can I fix this problem ?

Thank you for yours answers.

Philippe Fornaciari
Summit Technologies International



Sun, 22 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

Hi,

I try to build an ActiveX Dll to create a connection to a database. This Dll
allows the user to enter a login and a password to establish a connection to
the database.

My VB program runs like that :

1. I start the VB application showing MDI Form

2. I create an instance of my Connection object, call the method to
establish the connection. This method opens a modal form with textbox
(Username, Password) and buttons.

If I click on my MDI Form when the Modal Connection form is opened, the
Modal form for the connection disappears behind the MDI, a dialog box with 2
command buttons "Switch to" and "Retry" appears with the following message :

    "This action cannot be completed because the other application is busy.
Choose "switch to" to activate the busy application and correct the
problem."

I can click on "Switch" or "Retry", but I never go back to my Connection
form and I have to kill  my application.

How can I fix this problem ?

Thank you for yours answers.

Philippe Fornaciari
Summit Technologies International



Tue, 24 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

In my DLL, I call a Login method that will make the connection (or return
false).  I have a separate property that is of type rdoConnection that I use
to return the connection.

What I think is happening is that the DLL is waiting for the modal form to
be dismissed, and the MDI form is waiting for the DLL method to return.



Tue, 24 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

Use the SetWindowPos API call to set your login form to be topmost when you
show it.
Use the OLEServerBusyMsgText property of the App object to change the
"Switch To" message.

SimonJ
PC Pro Magazine



Tue, 24 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

This is a result of IMessageFilter processing by VB, and
occurs usually for one of two primary reasons....

1.  Your control is taking a long time to initialize, or
2.  Your factory in your control is not being registered

In your control, make sure you are registering your factory
with CoRegisterClassObject (and for you MFC people,
COleObjectFactory::RegisterAll).

If your factory is being registered okay, then just wait for
a while (don't kill the application) VB will eventually come
back with an automation error.

Hope this helps

Andrew A. Andrews

Quote:

>Hi,

>I try to build an ActiveX Dll to create a connection to a database. This
Dll
>allows the user to enter a login and a password to establish a connection
to
>the database.

>My VB program runs like that :

>1. I start the VB application showing MDI Form

>2. I create an instance of my Connection object, call the method to
>establish the connection. This method opens a modal form with textbox
>(Username, Password) and buttons.

>If I click on my MDI Form when the Modal Connection form is opened, the
>Modal form for the connection disappears behind the MDI, a dialog box with
2
>command buttons "Switch to" and "Retry" appears with the following message
:

>    "This action cannot be completed because the other application is busy.
>Choose "switch to" to activate the busy application and correct the
>problem."

>I can click on "Switch" or "Retry", but I never go back to my Connection
>form and I have to kill  my application.

>How can I fix this problem ?

>Thank you for yours answers.

>Philippe Fornaciari
>Summit Technologies International




Fri, 27 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

I had a problem exactly like that when I tried to use thread pool. When a
switch to one thread per object the problem was gone.
Threads pool is implemented in a specific way in VB. You should read this
chapter in VB Books On-line.

--
Cludio Avolio Rodrigues
IBM Global Services
Systems Specialist

http://www.c-avolio.com/vb

Quote:

>Hi,

>I try to build an ActiveX Dll to create a connection to a database. This
Dll
>allows the user to enter a login and a password to establish a connection
to
>the database.

>My VB program runs like that :

>1. I start the VB application showing MDI Form

>2. I create an instance of my Connection object, call the method to
>establish the connection. This method opens a modal form with textbox
>(Username, Password) and buttons.

>If I click on my MDI Form when the Modal Connection form is opened, the
>Modal form for the connection disappears behind the MDI, a dialog box with
2
>command buttons "Switch to" and "Retry" appears with the following message
:

>    "This action cannot be completed because the other application is busy.
>Choose "switch to" to activate the busy application and correct the
>problem."

>I can click on "Switch" or "Retry", but I never go back to my Connection
>form and I have to kill  my application.

>How can I fix this problem ?

>Thank you for yours answers.

>Philippe Fornaciari
>Summit Technologies International




Fri, 27 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

Philippe Fornaciari schrieb in Nachricht ...

Quote:
>Hi,

>I try to build an ActiveX Dll to create a connection to a database. This
Dll
>allows the user to enter a login and a password to establish a connection
to
>the database.

>My VB program runs like that :

>1. I start the VB application showing MDI Form

>2. I create an instance of my Connection object, call the method to
>establish the connection. This method opens a modal form with textbox
>(Username, Password) and buttons.

try open the modal form from within the MDI-app and pass the values for
UserName and Password to your DLL to validate the provided information..
Your DLL could now return a value to your app like "authorized" or "OK" ,
etc..

hope this helps...

rising

--
-------------------------------------------------------------------------
-------------------- http://rising.dyn.ml.org ---------------------
------- http://privat.schlund.de/R/RisingsSoftware -------
-------------------------------------------------------------------------

- Show quoted text -

Quote:

>If I click on my MDI Form when the Modal Connection form is opened, the
>Modal form for the connection disappears behind the MDI, a dialog box with
2
>command buttons "Switch to" and "Retry" appears with the following message
:

>    "This action cannot be completed because the other application is busy.
>Choose "switch to" to activate the busy application and correct the
>problem."

>I can click on "Switch" or "Retry", but I never go back to my Connection
>form and I have to kill  my application.

>How can I fix this problem ?

>Thank you for yours answers.

>Philippe Fornaciari
>Summit Technologies International




Fri, 27 Oct 2000 03:00:00 GMT  
 Help ! ActiveX Dll Gurus

Phillippe / Claudio,

As far as I know, the operation of ActiveX DLL and EXEs is very different.
I doubt your problem is related. The problem with using thread pooling with
EXEs is that multiple clients may be executing within the same thread and
so block each other - obviously switching to thread-per-object removes this
problem (since then the clients will have their own thread to themselves).
This is explained well in the docs.

With DLLs, the threads used are dependent on the container (the app
'housing' the DLL) - it can't really 'create' threads in the same way as an
EXE. The problem you are having (where two clients are in the same thread
in the EXE and blocking each other) simply can't happen with a DLL, because
each separate instance of the client will have a separate instance of the
DLL.

The problem here is that within the DLL code it is showing a form. Then,
when you click the original app it realises the DLL code is still executing
so tells you to wait - effectively blocking you from using the DLL form
(and therefore getting anything done). End result - deadlock.

Phillipe - my simplest suggestion (may not be viable) is to hide the MDI
app while the form is being shown. That way the user is forced to interact
with the DLL form.

Matthew



Quote:
> I had a problem exactly like that when I tried to use thread pool. When a
> switch to one thread per object the problem was gone.
> Threads pool is implemented in a specific way in VB. You should read this
> chapter in VB Books On-line.

> --
> Cludio Avolio Rodrigues
> IBM Global Services
> Systems Specialist

> http://www.c-avolio.com/vb

> >Hi,

> >I try to build an ActiveX Dll to create a connection to a database. This
> Dll
> >allows the user to enter a login and a password to establish a
connection
> to
> >the database.

> >My VB program runs like that :

> >1. I start the VB application showing MDI Form

> >2. I create an instance of my Connection object, call the method to
> >establish the connection. This method opens a modal form with textbox
> >(Username, Password) and buttons.

> >If I click on my MDI Form when the Modal Connection form is opened, the
> >Modal form for the connection disappears behind the MDI, a dialog box
with
> 2
> >command buttons "Switch to" and "Retry" appears with the following
message
> :

> >    "This action cannot be completed because the other application is
busy.
> >Choose "switch to" to activate the busy application and correct the
> >problem."

> >I can click on "Switch" or "Retry", but I never go back to my Connection
> >form and I have to kill  my application.

> >How can I fix this problem ?

> >Thank you for yours answers.

> >Philippe Fornaciari
> >Summit Technologies International




Fri, 27 Oct 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Help ! ActiveX Dll Gurus

2. Help ! ActiveX Dll Gurus

3. GURU/SEMI-GURU please help with ActiveX DLL threading question

4. Dll Gurus: Help with oc25.dll error

5. HELP! ActiveX Gurus

6. ActiveX/VB gurus - desparately need help

7. Need help from VB and DLL guru

8. Need a DLL guru to help me.

9. I Need superior Guru help with C DLL for VB.

10. Need superior Guru help with C DLL for VB

11. Need Guru Help With C DLL for VB

12. ActiveX.exe or ActiveX DLL or ActiveX Control?????????????

 

 
Powered by phpBB® Forum Software