I added 8 methods to an existing .idl. When I tried to debug the COM
using a DELPHI app, the VC++ .Net de{*word*81} never broke at the correct
method. I added the following methods:
SetAuditConfigure
GetAuditConfigure
SetAuditView
GetAuditView
SetAccessControl
GetAccessControl
SetRestartSensor
GetRestartSensor
After building the COM dll, it was registered. The type library was
added to Delphi via the Import feature. I'm using Delphi 5 Enterprise
and VC++ .Net. I made sure that the COM dll that I modified was the
one in memory. Also, the .tlb that was generated via VC++ was the one
registered. I used the OLEViewer to verify that the tlb existed and
was the correct one. Why would the de{*word*81} not stop at the correct
method? It looks as if the old COM DLL is still loaded in memory. I
did a regsvr32 /u and regsvr32 to uninstall and install the COM Dll.
Is it possible that DELPHI has info cached somewhere? Below are
snippets of code added to .idl.
//-------------------------------------------------------------------
//
// INFRUser
//
[
uuid(C66DA2E0-E628-11d2-8A92-00105ACE767A),
dual,
oleautomation
]
interface INFRUser: IDispatch
{
[
propget,
id(0)
]
HRESULT Name([out, retval] BSTR *pbstrName);
[
propget,
id(1)
]
HRESULT LongName([out, retval] BSTR *pbstrName);
[
propput,
id(1)
]
HRESULT LongName([in] BSTR bstrName);
[
propget,
id(2)
]
HRESULT Description([out, retval] BSTR *pbstrDesc);
[
propput,
id(2)
]
HRESULT Description([in] BSTR bstrName);
[
propget,
id(3)
]
HRESULT NFRList([out, retval] BSTR *pbstrList);
[
propput,
id(3)
]
HRESULT NFRList([in] BSTR bstrList);
[
propget,
id(4)
]
HRESULT Password([out, retval] BSTR *pbstrPasswd);
[
propput,
id(4)
]
HRESULT Password([in] BSTR bstrPasswd);
[
propget,
id(5)
]
HRESULT Configure([out, retval] BOOL *pbValue);
[
propput,
id(5)
]
HRESULT Configure([in] BOOL bValue);
[
propget,
id(6)
]
HRESULT Query([out, retval] BOOL *pbValue);
[
propput,
id(6)
]
HRESULT Query([in] BOOL bValue);
[
propget,
id(7)
]
HRESULT Diagnostic([out, retval] BOOL *pbValue);
[
propput,
id(7)
]
HRESULT Diagnostic([in] BOOL bValue);
[
propget,
id(8)
]
HRESULT ViewAlerts([out, retval] BOOL *pbValue);
[
propput,
id(8)
]
HRESULT ViewAlerts([in] BOOL bValue);
[
propget,
id(9)
]
HRESULT AckAlerts([out, retval] BOOL *pbValue);
[
propput,
id(9)
]
HRESULT AckAlerts([in] BOOL bValue);
[
propget,
id(10)
]
HRESULT CommentOnAlerts([out, retval] BOOL *pbValue);
[
propput,
id(10)
]
HRESULT CommentOnAlerts([in] BOOL bValue);
[
propget,
id(11)
]
HRESULT AuditConfigure([out, retval] BOOL *pbValue);
[
propput,
id(11)
]
HRESULT AuditConfigure([in] BOOL bValue);
[
propget,
id(12)
]
HRESULT AuditView([out, retval] BOOL *pbValue);
[
propput,
id(12)
]
HRESULT AuditView([in] BOOL bValue);
[
propget,
id(13)
]
HRESULT AccessControl([out, retval] BOOL *pbValue);
[
propput,
id(13)
]
HRESULT AccessControl([in] BOOL bValue);
[
propget,
id(14)
]
HRESULT RestartSensor([out, retval] BOOL *pbValue);
[
propput,
id(14)
]
HRESULT RestartSensor([in] BOOL bValue);
[
id(15)
]
HRESULT Save();
[
id(16)
]
HRESULT Delete();
Coded added to header file...
//-------------------------------------------------------------------
//
// CNFRUserA
//
class CNFRUserA : public TDispatch<INFRUser, &IID_INFRUser, &TLID_NFR>
{
public:
STDMETHODIMP get_Name(BSTR *pbstrName);
STDMETHODIMP get_LongName(BSTR *pbstrName);
STDMETHODIMP put_LongName(BSTR bstrName);
STDMETHODIMP get_Description(BSTR *pbstrDesc);
STDMETHODIMP put_Description(BSTR bstrName);
STDMETHODIMP get_NFRList(BSTR *pbstrList);
STDMETHODIMP put_NFRList(BSTR bstrList);
STDMETHODIMP get_Password(BSTR *pbstrPasswd);
STDMETHODIMP put_Password(BSTR bstrPasswd);
STDMETHODIMP get_Configure(BOOL *pbValue);
STDMETHODIMP put_Configure(BOOL bValue);
STDMETHODIMP get_Query(BOOL *pbValue);
STDMETHODIMP put_Query(BOOL bValue);
STDMETHODIMP get_Diagnostic(BOOL *pbValue);
STDMETHODIMP put_Diagnostic(BOOL bValue);
STDMETHODIMP get_ViewAlerts(BOOL *pbValue);
STDMETHODIMP put_ViewAlerts(BOOL bValue);
STDMETHODIMP get_AckAlerts(BOOL *pbValue);
STDMETHODIMP put_AckAlerts(BOOL bValue);
STDMETHODIMP get_CommentOnAlerts(BOOL *pbValue);
STDMETHODIMP put_CommentOnAlerts(BOOL bValue);
STDMETHODIMP get_AuditConfigure(BOOL *pbValue);
STDMETHODIMP put_AuditConfigure(BOOL bValue);
STDMETHODIMP get_AuditView(BOOL *pbValue);
STDMETHODIMP put_AuditView(BOOL bValue);
STDMETHODIMP get_AccessControl(BOOL *pbValue);
STDMETHODIMP put_AccessControl(BOOL bValue);
STDMETHODIMP get_RestartSensor(BOOL *pbValue);
STDMETHODIMP put_RestartSensor(BOOL bValue);
STDMETHODIMP Save(void);
STDMETHODIMP Delete(void);
public:
CNFRUserA(char *pszName, IUser *pIUser) :
TDispatch<INFRUser, &IID_INFRUser, &TLID_NFR>()
{
lstrcpyn(m_szName, pszName, sizeof(m_szName));
pIUser->AddRef();
m_pIUser = pIUser;
}
~CNFRUserA(void)
{
m_pIUser->Release();
}
private:
char m_szName[64];
IUser *m_pIUser;
Code added to source...
//-------------------------------------------------------------------
//
// get_AuditConfigure
//
STDMETHODIMP
CNFRUserA::get_AuditConfigure(BOOL *pbValue)
{
return m_pIUser->GetAuditConfigure(pbValue);
//-------------------------------------------------------------------
//
// put_AuditConfigure
//
STDMETHODIMP
CNFRUserA::put_AuditConfigure(BOOL bValue)
{
return m_pIUser->SetAuditConfigure(bValue);
//-------------------------------------------------------------------
//
// get_AuditView
//
STDMETHODIMP
CNFRUserA::get_AuditView(BOOL *pbValue)
{
return m_pIUser->GetAuditView(pbValue);
//-------------------------------------------------------------------
//
// put_AuditView
//
STDMETHODIMP
CNFRUserA::put_AuditView(BOOL bValue)
{
return m_pIUser->SetAuditView(bValue);
//-------------------------------------------------------------------
//
// get_AccessControl
//
STDMETHODIMP
CNFRUserA::get_AccessControl(BOOL *pbValue)
{
return m_pIUser->GetAccessControl(pbValue);
//-------------------------------------------------------------------
//
// put_AccessControl
//
STDMETHODIMP
CNFRUserA::put_AccessControl(BOOL bValue)
{
return m_pIUser->SetAccessControl(bValue);
//-------------------------------------------------------------------
//
// get_RestartSensor
//
STDMETHODIMP
CNFRUserA::get_RestartSensor(BOOL *pbValue)
{
return m_pIUser->GetRestartSensor(pbValue);
//-------------------------------------------------------------------
//
// put_RestartSensor
//
STDMETHODIMP
CNFRUserA::put_RestartSensor(BOOL bValue)
{
return m_pIUser->SetRestartSensor(bValue);
The OLE Viewer displays this info for the generated .tlb...
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: nfrclient.dll
[
uuid(6B7D2A78-DA68-11D2-8A80-00105ACE767A),
version(1.0),
helpstring("NFR 1.0 Type Library"),
custom(DE77BA64-517C-11D1-A2DA-0000F8773CE9, 100663643),
custom(DE77BA63-517C-11D1-A2DA-0000F8773CE9, 1053966720),
custom(DE77BA65-517C-11D1-A2DA-0000F8773CE9, Created by MIDL version
6.00.0347 at Mon May 26 12:32:00 2003
)
]
library NFR
{
// TLib : // TLib : OLE Automation :
{00020430-0000-0000-C000-000000000046}
importlib("StdOle2.tlb");
// Forward declare all types defined in this typelib
interface INFRLogon;
interface INFR;
interface INFRPackageList;
interface INFRPackage;
interface INFRBackend;
interface INFRColumn;
interface INFRQuery;
interface INFRUser;
interface INFRUserList;
interface INFRUserInfo;
[
uuid(6B7D2A77-DA68-11D2-8A80-00105ACE767A)
]
coclass NFRLogon {
[default] interface INFRLogon;
};
[
odl,
uuid(6B7D2A75-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRLogon : IDispatch {
[id(0x00000001)]
HRESULT Logon(
[in] BSTR bstrHost,
[in] BSTR bstrUsrName,
[in] BSTR bstrPasswd,
[out, retval] INFR** ppINFR);
};
[
odl,
uuid(6B7D2A74-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFR : IDispatch {
[id(00000000)]
HRESULT GetPackageList([out, retval] INFRPackageList**
ppINFRPackageList);
[id(0x60020001)]
HRESULT GetBackend(
[in] BSTR bstrName,
[out, retval] INFRBackend** ppINFRBackend);
[id(0x60020002)]
HRESULT GetQuery(
[in] BSTR bstrName,
[out, retval] INFRQuery** ppINFRQuery);
[id(0x60020003)]
HRESULT GetUser(
[in] BSTR bstrName,
[out, retval] INFRUser** ppINFRUser);
[id(0x60020004)]
HRESULT CreateUser(
[in] BSTR bstrName,
[out, retval] INFRUser** ppINFRUser);
[id(0x60020005)]
HRESULT GetUserList([out, retval] INFRUserList**
ppINFRUserList);
[id(0x60020006)]
HRESULT GetAlertRecorderList([out, retval] BSTR* pbstrList);
};
[
odl,
uuid(6B7D2A73-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRPackageList : IDispatch {
[id(0x00000001)]
HRESULT GetNextPackage([out, retval] INFRPackage**
ppINFRPackage);
};
[
odl,
uuid(6B7D2A72-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRPackage : IDispatch {
[id(0x00000001), propget]
HRESULT Type([out, retval] tagPKGTYPE* pType);
[id(0x00000002), propget]
HRESULT IsInstalled([out, retval] long* pbIsInstalled);
[id(0x00000003), propget]
HRESULT IsEnabled([out, retval] long* pbIsEnabled);
[id(0x00000004), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x00000005), propget]
HRESULT Title([out, retval] BSTR* pbstrTitle);
};
typedef enum {
PKGT_STANDALONE = 1,
PKGT_CENTRAL = 2,
PKGT_REMOTE = 3,
PKGT_PACKAGE = 4,
PKGT_HISTOGRAM = 5,
PKGT_LIST = 6
} tagPKGTYPE;
[
odl,
uuid(6B7D2A71-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRBackend : IDispatch {
[id(0x00000001), propget]
HRESULT Version([out, retval] long* plVersion);
[id(0x00000002), propget]
HRESULT Type([out, retval] tagPKGTYPE* pType);
[id(0x00000003), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x00000004), propget]
HRESULT Title([out, retval] BSTR* pbstrTitle);
[id(0x00000005), propget]
HRESULT NukeCountLabel([out, retval] BSTR* pbstrLabel);
[id(0x00000006), propget]
HRESULT NukeDataLabel([out, retval] BSTR* pbstrLabel);
[id(0x00000007), propget]
HRESULT ColumnCount([out, retval] int* pnCount);
[id(0x00000008)]
HRESULT GetColumn(
[in] int nIndex,
[out, retval] INFRColumn** ppINFRColumn);
[id(0x00000009)]
HRESULT GetQueryObject([out, retval] INFRQuery** ppINFRQuery);
};
[
odl,
uuid(6B7D2A70-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRColumn : IDispatch {
[id(0x00000001), propget]
HRESULT Type([out, retval] BSTR* pbstrType);
[id(0x00000002), propget]
HRESULT Label([out, retval] BSTR* pbstrLabel);
};
[
odl,
uuid(6B7D2A79-DA68-11D2-8A80-00105ACE767A),
dual,
oleautomation
]
interface INFRQuery : IDispatch {
[id(0x00000001), propget, helpstring("Backend name.")]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x00000002), propput, helpstring("Query type.")]
HRESULT Type([in] int rhs);
[id(0x00000003), propput, helpstring("Cut off below this
percent of the count.")]
HRESULT NukeCount([in] int rhs);
[id(0x00000004), propput, helpstring("Cut off below this
percent of the sum.")]
HRESULT NukeSum([in] int rhs);
[id(0x00000005), propput, helpstring("Comma delimited list of
remotes to apply the query to.")]
HRESULT RemoteList([in] BSTR rhs);
[id(0x00000006), propput, helpstring("Sets whether to return
the remote name as a column.")]
HRESULT DisplayHostColumn([in] long rhs);
[id(0x00000007), propput, helpstring("Sets whether to return
the time as a column.")]
HRESULT DisplayTimeColumn([in] long rhs);
[id(0x00000008), helpstring("Set the pattern used to query on
a column.")]
HRESULT SetPattern(
[in] int nIndex,
[in] BSTR bstrPattern);
[id(0x00000009), helpstring("Sets whether to return the column
in the query result.")]
HRESULT Collapse(
[in] int nIndex,
[in] long bCollapse);
[id(0x0000000a), helpstring("Add a query filter.")]
HRESULT AddFilter(
[in] BSTR bstrName,
[in] BSTR bstrValue);
[id(0x0000000b), helpstring("Execute the query.")]
HRESULT Execute();
[id(0x0000000c), helpstring("Reset all settings to their
default.")]
HRESULT Reset();
[id(0x0000000d), propget, helpstring("The number of columns in
a query result.")]
HRESULT ColumnCount([out, retval] int* pnCount);
[id(0x0000000e), propget, helpstring("The comma separated
column headers.")]
HRESULT ColumnHeaders([out, retval] BSTR* pbstrHeaders);
[id(0x0000000f), propget, helpstring("One comma separated
record from the query result.")]
HRESULT NextRecord([out, retval] BSTR* pbstrRecord);
[id(0x00000010), propput, helpstring("Displays the maximum
records.")]
HRESULT MaxRecords([in] int rhs);
[id(0x00000011), propput, helpstring("Sets the alert order.")]
HRESULT Order([in] BSTR rhs);
};
[
odl,
uuid(C66DA2E0-E628-11D2-8A92-00105ACE767A),
dual,
oleautomation
]
interface INFRUser : IDispatch {
[id(00000000), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x00000001), propget]
HRESULT LongName([out, retval] BSTR* pbstrName);
[id(0x00000001), propput]
HRESULT LongName([in] BSTR pbstrName);
[id(0x00000002), propget]
HRESULT Description([out, retval] BSTR* pbstrDesc);
[id(0x00000002), propput]
HRESULT Description([in] BSTR pbstrDesc);
[id(0x00000003), propget]
HRESULT NFRList([out, retval] BSTR* pbstrList);
[id(0x00000003), propput]
HRESULT NFRList([in] BSTR pbstrList);
[id(0x00000004), propget]
HRESULT Password([out, retval] BSTR* pbstrPasswd);
[id(0x00000004), propput]
HRESULT Password([in] BSTR pbstrPasswd);
[id(0x00000005), propget]
HRESULT Configure([out, retval] long* pbValue);
[id(0x00000005), propput]
HRESULT Configure([in] long pbValue);
[id(0x00000006), propget]
HRESULT Query([out, retval] long* pbValue);
[id(0x00000006), propput]
HRESULT Query([in] long pbValue);
[id(0x00000007), propget]
HRESULT Diagnostic([out, retval] long* pbValue);
[id(0x00000007), propput]
HRESULT Diagnostic([in] long pbValue);
[id(0x00000008), propget]
HRESULT ViewAlerts([out, retval] long* pbValue);
[id(0x00000008), propput]
HRESULT ViewAlerts([in] long pbValue);
[id(0x00000009), propget]
HRESULT AckAlerts([out, retval] long* pbValue);
[id(0x00000009), propput]
HRESULT AckAlerts([in] long pbValue);
[id(0x0000000a), propget]
HRESULT CommentOnAlerts([out, retval] long* pbValue);
[id(0x0000000a), propput]
HRESULT CommentOnAlerts([in] long pbValue);
[id(0x0000000b), propget]
HRESULT AuditConfigure([out, retval] long* pbValue);
[id(0x0000000b), propput]
HRESULT AuditConfigure([in] long pbValue);
[id(0x0000000c), propget]
HRESULT AuditView([out, retval] long* pbValue);
[id(0x0000000c), propput]
HRESULT AuditView([in] long pbValue);
[id(0x0000000d), propget]
HRESULT AccessControl([out, retval] long* pbValue);
[id(0x0000000d), propput]
HRESULT AccessControl([in] long pbValue);
[id(0x0000000e), propget]
HRESULT RestartSensor([out, retval] long* pbValue);
[id(0x0000000e), propput]
HRESULT RestartSensor([in] long pbValue);
[id(0x0000000f)]
HRESULT Save();
[id(0x00000010)]
HRESULT Delete();
};
[
odl,
uuid(72EBCF90-6C62-11D3-8B41-00105ACE767A),
dual,
oleautomation
]
interface INFRUserList : IDispatch {
[id(0x00000001)]
HRESULT GetNextUser([out, retval] INFRUserInfo**
ppINFRUserInfo);
};
[
odl,
uuid(72EBCF91-6C62-11D3-8B41-00105ACE767A),
dual,
oleautomation
]
interface INFRUserInfo : IDispatch {
[id(00000000), propget]
HRESULT Name([out, retval] BSTR* pbstrName);
[id(0x60020001), propget]
HRESULT LongName([out, retval] BSTR* pbstrName);
[id(0x60020002), propget]
HRESULT Description([out, retval] BSTR* pbstrDesc);
};