• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

COM In-process components and modal forms

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
armg
Asked:
armg
  • 2
  • 2
1 Solution
 
clifABBCommented:
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
 
armgAuthor Commented:
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
 
clifABBCommented:
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
 
armgAuthor Commented:
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
 
geiraCommented:
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now