Solved

COM In-process components and modal forms

Posted on 1998-09-19
5
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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