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

Automation

I am sorry that the following problem may not have enough information but I will try my best to explain my situation.

I have written an automation object by Visual C++ 5.0 using its Class Wizard.  Then, the object is used in Visual Basic.  This object has several mehtods.  The methods are computational type and very TIME-CONSUMING but have been tested in the Windows Console mode and can be assumed that they are error-free.  

1) Now, the problem is when these methods are called by VB, it may sometimes pop out the Error Message Box "Automation Error".  

2) However, sometimes it works without any error but the result is different from what I obtained in the Windows Console mode.

 I'd like to know what's going on.  I really have no idea and if anybofy has appropriate suggestion given, I would grant the marks.
0
Harvey
Asked:
Harvey
  • 2
1 Solution
 
HarveyAuthor Commented:
Edited text of question
0
 
HarveyAuthor Commented:
Adjusted points to 200
0
 
Tommy HuiCommented:
The problem is that most OLE automation controllers have a timeout that when the time expires, it displays an error message saying that the server failed. You should look into breaking up your computation into smaller parts if possible. If it isn't possible, then you probably would want to change your mechanism from an RPC to a callback scheme.

That is instead of calling a function directly, you should call the server to set up some variables, set a callback function and call a function. The function should start a thread and the computation. When the computation is done, the server will call the callback with the results. This way, the actual connection time between the controller and the server is kept to a minimum.

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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