Office XP COM addin woes (VB6)

A

Andrew M

Hello

I am developing an addin for office XP & 2003. I have the code working
great for 2003, however, Word is having a problem loading the application
object in my OnConnection Event. When I set my callback Event to the
application object, I receive an Error #48, Cannot Load DLL. Can anyone tell
me if there is a specific hoop I have to jump through, or perhaps a trick I
can use to get this to work. Below is a snippet of my routine

'Another thing... VB6 crashes every time I exit VB when editing this code.
Any Idea why? Also I get an occaisional BSOD when running in the IDE. (XP
pro w/ all the SP's & latest drivers)

Thanks - Andrew


'*****************
'Module Decs
'********************
Private WithEvents oApp As Word.Application

Private Sub AddinInstance_OnConnection(ByVal Application As Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)

Dim oPic As StdPicture

On Error GoTo ErrorHandler

'Keep earlier than Office XP versions from loading this
If Val(Application.Version) < WORDXP Then Exit Sub

'Instantiate Core
Set g_objFMCore = CreateCoreObject
If g_objFMCore Is Nothing Then Exit Sub

'Read Reg Keys
InitSettings WORDSETTINGS, m_blnIntegrate, m_blnSA_Int, m_blnDOF,
m_strDefProfile, m_blnSP, m_blnSC

'**** DIES RIGHT HERE ***|
Set oApp = Application '<**


'***************************************************************
 
M

Mark Bower [MSFT]

One thing to check is to make sure you are compiling against the Office XP
type libraries. This should ensure the addin works with both versions of
Office.
 
A

Andrew M

Mark

Thanks for your reply, One question remains though, if for example, I
wanted my addin to work for Office 2000, would I need to compile againt its
type libraries, and furthermore, can I compile against those typelibs
without having them installed on the machine(simply reference them, not
register them)

P.S. Alot of my problems seemed to have gone away with SP6 (go figure)

Thanks

Andrew
 
K

Ken Slovak - [MVP - Outlook]

Always develop using the oldest version of Outlook you want to support and
it will run on later versions. If you need to use some property or method
that's in a later version use late binding on an Outlook object and after
checking the user's version of Outlook use the later method or property from
the late bound object if the version is appropriate.

You would have Outlook 2000 installed on the development machine to be able
to reference it.
 
A

Andrew M

Ken

I took your advice and set up a development machine with Office 2K, and
VB6

i compiled it (making sure the refs were to the ver 9 type libs)

Then, I packed it up and deployed on another machine running Office XP -
hung all Programs
Then, being the eternal optimist, tried it on an Office 2003 machine - ditto

Does this mean I have to make a spearate build for every version? {ugh}

Thanks

Andrew
 
K

Ken Slovak - [MVP - Outlook]

No, it means you need to start debugging to see where the code is hanging. I
always develop using an Outlook 2000 machine and the code runs without
errors or changes or repackaging in Outlook 2002 and 2003.
 

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