Discussion:
OCX problem in VB Outlook AddIn
(too old to reply)
Rui Oliveira
2006-03-31 15:41:03 UTC
Permalink
We have developed an Outlook AddIn and we what use an OCX on it. But when we
use an OCX on it, appears an error after we close the Outlook.

The OCX works like we desire. But when we close the Outlook appears a DDE
Server Window error related with memory.

We are using OCX like in following lines.
Dim ocxVar As ClassOCX
Set ocxVar = New ClassOCX

Set ocxVar = Nothing

What could be?
Tks,
Rui Oliveira
Jan Hyde
2006-04-04 08:49:04 UTC
Permalink
Rui Oliveira <***@discussions.microsoft.com>'s wild
thoughts were released on Fri, 31 Mar 2006 07:41:03 -0800
Post by Rui Oliveira
We have developed an Outlook AddIn and we what use an OCX on it. But when we
use an OCX on it, appears an error after we close the Outlook.
The OCX works like we desire. But when we close the Outlook appears a DDE
Server Window error related with memory.
We are using OCX like in following lines.
Dim ocxVar As ClassOCX
Set ocxVar = New ClassOCX
…
Set ocxVar = Nothing
What could be?
Tks,
Rui Oliveira
Well since you don't tell us what the error is then we have
almost no chance of helping you.



Jan Hyde (VB MVP)
--
Debris: A foreskin restoration program for Jewish men. (Robert E. Lewis)
Mark J. McGinty
2006-04-22 10:06:47 UTC
Permalink
Post by Rui Oliveira
We have developed an Outlook AddIn and we what use an OCX on it. But when we
use an OCX on it, appears an error after we close the Outlook.
The OCX works like we desire. But when we close the Outlook appears a DDE
Server Window error related with memory.
We are using OCX like in following lines.
Dim ocxVar As ClassOCX
Set ocxVar = New ClassOCX
.
Set ocxVar = Nothing
Most likely something inside of the OCX code is preventing it from
unloading, like it has created an object but not destroyed it.

Too look into it further, add a Debug.Print "some descriptive text"
statement to the OCX's Class/UserControl Terminate event, and observe the
Immediate window when you set the object to Nothing. If Terminate doesn't
fire, it means that VB has deferred destrustion of the object, because
either it is keeping a reference to some other object, or some other
reference to it is being kept.

If a component used in your AddIn fails to unload, then your AddIn itself
will not unload when Outlook closes, and thus causes a crash.


-Mark
Post by Rui Oliveira
What could be?
Tks,
Rui Oliveira
Loading...