Solved

COM In-process components and modal forms

Posted on 1998-09-19
5
194 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

910 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

22 Experts available now in Live!

Get 1:1 Help Now