Win 2000 and Win XP compatibility with COM AddIn - Help needed

  • Thread starter Ricardo Pereira
  • Start date
R

Ricardo Pereira

Hi everybody!

I am developing a COM AddIn in Visual Basic 6.0 for Outlook 2000 which
is supposed to work in Outlook 2000 with the Windows 2000 operating
system.

The main thing that the AddIn does is to create a button
(Office.CommandBarButton) in the email reading window (on its
Inspector) and do some work when that button is clicked.

The problem is: the Addin works fine in Outlook 2000, under Windows
XP, but it doesn't work at all in Outlook 2000 under Windows 2000!
Under Win 2000, although the COM AddIn can be seen registered on the
COM AddIns dialog box, in Outlook 2000, the button never shows up.

I have tried it in all these different situations:
- compiling the dll and registering it straight from Visual Studio
(under Win XP): it works.
- using the setup package, created with the Package and Development
Wizard, creating it under Win XP: works when installed in Win XP but
doesn't work when installed in Win 2000.
- compiling the dll and registering it straight from Visual Studio
(under Win 2000): it doesn't work.
- using the setup package, created with the Package and Development
Wizard, creating it under Win 2000: doesn't work when installed in Win
2000 and also doesn't work when installed in Win XP.

The references I am using in this VB project are:
- Visual Basic for Applications (msvbvm60.dll)
- Visual Basic runtime objects and procedures (msvbvm60.dll\3)
- Visual Basic objects and procedures (VB6.OLB)
- OLE Automation (stdole2.tlb)
- Microsoft Add-In Designer (MSADDNDR.DLL)
- Microsoft Outlook 9.0 Object Library (MSOUTL9.OLB)
- Microsoft Office 9.0 Object Library (MSO9.DLL)
- Microsoft CDO 1.21 Library (CDO.DLL)
- Microsoft Scripting Runtime (scrrun.dll)

All the above system files that are needed to be referenced are found
both in Windows 2000 and XP, so I really don't understand why it is
working in Outlook 2000, under Windos XP, but not in outlook 2000
under Windows 2000. It also works in Outlook XP, under Windows XP.

Note, I am using:
- the Outlook COM AddIn template, by MicroEye.
- Windows 2000 Professional and Windows XP Professional.
- Microsoft Visual Studio 6.0, with Service Pack 4 installed.

Thanks in advance, for all your help.
 
K

Ken Slovak - [MVP - Outlook]

There really is no reason an addin would work for WinXP and not for
Win2K, I haven't seen that problem with Outlook 2000, 2002 or 2003.

If you have VB on a Win2K system why not load the addin project into
VB and start it up and set the debugger to break on any errors. Then
start Outlook and see if your On_Connection event is firing and if you
get any errors and where.
 
R

Ricardo Pereira

Hi again and thanks for your quick reply.

What I have just noticed, a few minutes ago, is that the InitHandler
is getting stuck in the Set gobjCDO = CreateObject("MAPI.Session")
instruction, it won't show up the MessageBox next to it, so it is
normal that the addin won't work because none of the remaining
intruction on InitHandler are beeing called. If I call a MsgBox
intruction, before the CreateObject("Mapi.Session") instruction, that
MsgBox will be shown correctly. So I am begining to believe that this
might have something to do with MAPI issues, which are working
correctly in Win XP but are not in Win 2K. I do have CDO 1.21
registered.

What do you think about this?

Thanks again.


Here's my InitHandler:

"Friend Sub InitHandler(olApp As Outlook.Application, strProgID As
String)
'Declared WithEvents
Set objOutlook = olApp 'Application Object
'Instantiate a public module-level Outlook application variable
Set golApp = olApp
'CDO Session if required
'Uncomment for CDO
Set gobjCDO = CreateObject("MAPI.Session")
MsgBox "inithandler"
gobjCDO.Logon "", "", False, False
'ProgID string required for CommandBarControls
gstrProgID = strProgID
'Declared WithEvents
Set objNS = objOutlook.GetNamespace("MAPI") 'NameSpace Object
'Set colReminders = objOutlook.Reminders 'Reminders Object
Set colExpl = objOutlook.Explorers 'Explorers Object
Set colInsp = objOutlook.Inspectors 'Inspectors Object
Set objExpl = objOutlook.ActiveExplorer 'Explorer Object

was_created = False
End Sub"
 
K

Ken Slovak - [MVP - Outlook]

See if re-registering CDO on that machine manually using regsrvr32
makes it work. Maybe CDO was installed and not registered correctly?
 
R

Ricardo Pereira

Hi again.

Yes, you were absolutely right. With an incorrect installation of CDO,
I had managed to have CDO.DLL in the system32\ but it hadn't been well
registered and it wasn't in the correct path. What caused this was a
previous installation of the Add-In (the one that worked in Windows
XP) with the package and development wizard, which copied the CDO.DLL
to the Windows 2000 machine (which didn't have CDO installed yet) but
not to the correct path and not registering it correctly. But the
AddIn wouldn't complain itself because there was a CDO.DLL in
system32\, but it wasn't doing a single thing with it.

Thanks for your help

Regards,
Ricardo Pereira
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top