Solved

COM In-process components and modal forms

Posted on 1998-09-19
5
192 Views
Last Modified: 2008-02-26
VB5/Win98

I have written an in-process component in VB that displays both modal and non-modal forms based on actions in the client app (also written in VB.) The problem is, when I display a modal form in my component and then click on the client apps form I get a strange message that reads: "Component Request Pending"
"An action can't be completed because component (Project1) is not responding. Choose switch-to to activate the component and correct the problem."  I have to buttons to choose, "Switch-to..." and "Retry". The "Switch-to" button gives the focus back to the component modal form. What is this message about and how can I prevent it from being displayed to the end user.
0
Comment
Question by:armg
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1435696
I've never seen this error with an in-process component, only an out-of-process component.
Basically and in-process is just that.  It's running in the same process space as the application that's calling it.  There can be nothing to "switch to".  Perhaps you have compiled it incorrectly?
0
 

Author Comment

by:armg
ID: 1435697
One very important thing I failed to mention is that my client app is itself compiled as an ActiveX EXE. The reason is that my server component needs to make callbacks to the client app.
0
 
LVL 6

Accepted Solution

by:
clifABB earned 200 total points
ID: 1435698
Strictly speaking, your in-process is actually out-of-process.
While VB5 now allows you to use Modal dialogs in out-of-process, you are seeing the prime caveat to using them.
I would suggest, and indeed am going to answer, that you display your dialogs as non-modal.

0
 

Author Comment

by:armg
ID: 1435699
Do I understand you correctly to say that when a standalone ActiveX EXE instantiates an in-process ActiveX DLL component, that it actually is equivalent to and out-of-process component? This seems to be a significant weakness of COM or VB's implementation of it. From what I can tell, if I were able to invoke the components modal form .Show method like this, Form1.Show 1, ClientForm , then the client apps form could not be activated while the components modal form is displayed. The only problem is, I can't pass a Form reference from the client app to my server component because Form objects are built from a private class that can't be declared as parameters or return values from methods/properties of public class modules. My client app and server component can only communicate via public class interfaces. This seems to be a flaw in VB to me, is this still the way it works in VB6?
0
 

Expert Comment

by:geira
ID: 1435700
I have had the same problem, the only way I have found out to solve this problem is to implement async. callback, - cut the connection between the calling app. and you COM-module with the settimer function, and give notification back to the calling app. via a raiseevent.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now