Im trying to produce a small Visual Studio Addin. Taking the
OutlookAddin example and changing the registry place it installs too,
everything works ok.
Examples in C++ show that in the OnConnection method I have to registry
my commands and also pass an instance of my sub class of ICommands.
The C code looks like this:
IApplication* pApplication = NULL;
pApp->QueryInterface (IID_IApplicati on, (void**) &pApplicatio n)
CCommandsObj::C reateInstance(& m_pCommands);
m_pCommands->AddRef();
m_pCommands->SetApplication Object(pApplica tion);
pApplication->SetAddInInfo(( long) AfxGetInstanceH andle(),
(LPDISPATCH) m_pCommands, -1, -1, m_dwAddin));
So far Im trying something like this:
self._command = VCCmd(applicati on)
application.Set AddInInfo(AfxGe tInstanceHandle (), self._command, -
1, -1, addin )
with VCCmd defined like:
class VCCmd:
_com_interfaces _ = ['_ICommands']
_public_methods _ = []
_application = None
def __init__( self, app ):
self._applicati on = app
print "VCCmd __init__"
Needless to say, its not working, so questions.
1) AfxGetInstanceH andle dosent appear to exist in the win32api... so how
do I call it.
2) am I defining VCCmd correctly to be a subclass of ICommands
3) am I correct in thinking i dont have to explicitly 'cast' application
into an IApplication instance
Many thanks for any light you may be able to shed on the subject
Rich
OutlookAddin example and changing the registry place it installs too,
everything works ok.
Examples in C++ show that in the OnConnection method I have to registry
my commands and also pass an instance of my sub class of ICommands.
The C code looks like this:
IApplication* pApplication = NULL;
pApp->QueryInterface (IID_IApplicati on, (void**) &pApplicatio n)
CCommandsObj::C reateInstance(& m_pCommands);
m_pCommands->AddRef();
m_pCommands->SetApplication Object(pApplica tion);
pApplication->SetAddInInfo(( long) AfxGetInstanceH andle(),
(LPDISPATCH) m_pCommands, -1, -1, m_dwAddin));
So far Im trying something like this:
self._command = VCCmd(applicati on)
application.Set AddInInfo(AfxGe tInstanceHandle (), self._command, -
1, -1, addin )
with VCCmd defined like:
class VCCmd:
_com_interfaces _ = ['_ICommands']
_public_methods _ = []
_application = None
def __init__( self, app ):
self._applicati on = app
print "VCCmd __init__"
Needless to say, its not working, so questions.
1) AfxGetInstanceH andle dosent appear to exist in the win32api... so how
do I call it.
2) am I defining VCCmd correctly to be a subclass of ICommands
3) am I correct in thinking i dont have to explicitly 'cast' application
into an IApplication instance
Many thanks for any light you may be able to shed on the subject
Rich