Solved

Component Request Pending

Posted on 1998-11-09
4
288 Views
Last Modified: 2008-02-20
I have an ActiveX EXE and and ActiveX Dll and from within the EXE I call a standard form from inside the Dll. This form uses the EXE as the background and the standard form from the Dll is shown in the foreground. At this point if I was to click on the EXE in the background I get an Ole Component Request Pending message that I would like to capture and do away with. The VB help file doesn't seem to give that much information on this topic. Is it even possible?

Thanks for any help you may have.
Matthew
0
Comment
Question by:Profund
  • 2
  • 2
4 Comments
 

Author Comment

by:Profund
ID: 1443945
Thanks
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 200 total points
ID: 1443946
I can tell you what is happening.

An ActiveX exe is a process on its own. It gets its own processor time. When you call an ActiveX exe, the caller has to wait for the answer of the ActiveX exe. This means that the application need to be synchronized. Your calling EXE is not disabled but only waiting. That means that when you click on a form of the calling process (EXE) that windows has to remove this message since your EXE is waiting. At this moment the dialog box comes up.
What can you do to solve it? Not much.
First of all. Don't make the caller wait. With that I mean that the ActiveX exe should return with an answer as quick as possible but this is ofcourse not always possible.
Another solution is to make the ActiveX exe a DLL, which is also not always possible.
The third solution is to make the calls asynchronious. The ActiveX exe receives the call, marks it self as busy (and thereby ignoring all other calls, you have to make sure of that yourself) and return immediatelly. When it is finished it can notify the parent that it is finished. The most easiest way to do it is using a timer. The best way to do it is to start another thread, which is not easy is VB (very difficult).

Here is some psuedo code. This code is controlling the state of the EXE in stead of letting windows do it. Like you have seen with the window. It makes it sometimes a littlebit harder.

---Caller EXE---
sub command1_onClick
     ActiveXExe.DoitAsync
end sub      

sub ActiveXExe_Done
    msgbox "ActiveX EXE is finished"
end sub

---ActiveX EXE---
event Finished
Dim withevents form1timer1 as timer

public Sub DoitAsync
    if (busy) then err.raise -1, "Server is busy"
    busy = true
    form1timer1.enabled = true
end sub

private sub form1timer_tick
    form1timer1.enabled = false
    <Do your stuff here>
    busy = false
    raiseevent Finished
end sub

private sub class_initialize
   load form1
   set form1timer1 = form1.timer1
end sub

private sub class_terminate
   set form1timer1 = nothing
   unload form1
end sub
0
 

Author Comment

by:Profund
ID: 1443947
Thanks for the input but I think we are not quite on the same page. I only have an ActiveX EXE which is my caller and the ActiveX Dll is what I am calling. The ActiveX Exe opens a form, in my case an MDI, and then at some later time the user can call a form from within the ActiveX Dll which I make the foreground window through an API call. Now I have the small Dll form in the front and the MDI form from the ActiveX Dll behind it. It is when I click on the MDI that I get this Request Pending message saying a request to the Dll is still waiting. I do not want to end the connection to the Dll, however, until the user closes out the small form. Will your code and use of a timer still work? You also mentioned that making one of my apps a Dll would be a solution. If so, does this change or give you some new ideas?

Thanks
Matthew
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1443948
Who calls the activeX executable?
If nobody calls your activex executable, change it to a standard exe.
BTW: Microsoft warns for loading forms from another DLL.

You can also make one form the owner or parent of the other form and start the form modal. This way the user will not be able to close the other form until the topmost one is closed.

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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.
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…
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…

744 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

11 Experts available now in Live!

Get 1:1 Help Now