What is Test.Connect, is that the VB6 addin?
In the VB6 addin do you have something like this in your startup code in
OnConnection:
AddInInst.Object = Me
Your CalledFromOutside() procedure in the VB6 code would also be declared as
Public.
Then in managed code I'd call the unmanaged code using this:
oAddin.Object.CalledFromOutside()
See if that works for you.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"YM" wrote in message
...
Hi Ken,
What I'm trying to do is accessing some public functions in com add-in
created with vb6 from my add-in created using vs2005. Both of them are
shared add-ins.
My code looks like following:
Dim oAddin As Microsoft.Office.Core.COMAddIn
Dim addins As Microsoft.Office.Core.COMAddIns
addins = m_olApp.COMAddIns
oAddin = addins.Item("Test.Connect")
Or
oAddin = m_olApp.COMAddIns.Item("Test.Connect")
Above works, but when I try to access oAddin.Object, it returns 'nothing'.
I have added public function in vb6 addin like following:
Public Sub CalledFromOutside()
MsgBox "This is called from outside"
End Sub
Am I missing something?
Thanks in advance.
Y