Re: Using the Exchange Backup API



Hello Scot,

Thanks a lot. It worked. Is there a .h or a .lib file available which has
the functions of the Exchange Backup and Restore API ?

Thanks,
Viraj
Mobiliti Inc.
a.viraj@xxxxxxxxxxxx
http://www.mobiliti.com
732-248-8300 ext 234


"Scot T Brennecke" wrote:

> My GUESS is that ESEBACK_API is simply a typedef or #define for __stdcall. Try using __stdcall in
> its place.
>
> "Viraj" <Viraj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:C7C75310-CF0D-41AA-B3BA-322EE0166DC0@xxxxxxxxxxxxxxxx
> > Hello Jeff,
> >
> > Thanks for the reply.
> > I made the changes as suggested by you. My final code is
> > ---------------------------------------------------
> > BOOL BackupExchangeServer(HINSTANCE g_hESEDll)
> > {
> > BACKUP_NODE_TREE* pMNUBackupNodeTree = NULL;
> > typedef HRESULT (ESEBACK_API *HrESEBackupRestoreGetNodes) (IN WCHAR*
> > wszComputerName,OUT PBACKUP_NODE_TREE *ppBackupNodeTree);
> >
> > HrESEBackupRestoreGetNodes fnMNUBackupRestoreGetNodes = NULL;
> > fnMNUBackupRestoreGetNodes = (HrESEBackupRestoreGetNodes) GetProcAddress
> > (g_hESEDll,"HrESEBackupRestoreGetNodes");
> > HRESULT hr;
> > if(fnMNUBackupRestoreGetNodes)
> > hr = (fnMNUBackupRestoreGetNodes) (NULL, &pMNUBackupNodeTree);
> > if(hr == S_OK)
> > return MNU_EXCHANGE_BKP_SUCCESS;
> > else
> > return MNU_EXCHANGE_BKP_FAILURE;
> > }
> > ---------------------------------------------------
> >
> > This code does not compile. I think it cannot get ESEBACK_API which has been
> > added to the typedef of the function.
> > The compilation errors with line numbers as well as with the original line
> > is copied below.
> > ---------------------------------------------------
> > Compiling...
> > MNUExchangeBkpUtils.cpp
> > //Line 14 typedef HRESULT (ESEBACK_API *HrESEBackupRestoreGetNodes) (IN
> > // WCHAR* wszComputerName,OUT PBACKUP_NODE_TREE *ppBackupNodeTree);
> > MNUExchangeBkpUtils.cpp(14) : error C2143: syntax error : missing ')' before
> > '*'
> > MNUExchangeBkpUtils.cpp(14) : error C2143: syntax error : missing ';' before
> > '*'
> > MNUExchangeBkpUtils.cpp(14) : error C2065: 'HrESEBackupRestoreGetNodes' :
> > undeclared identifier
> > MNUExchangeBkpUtils.cpp(14) : error C2059: syntax error : ')'
> > MNUExchangeBkpUtils.cpp(14) : error C2065: 'wszComputerName' : undeclared
> > identifier
> > MNUExchangeBkpUtils.cpp(14) : error C2275: 'WCHAR' : illegal use of this
> > type as an expression c:\program files\microsoft visual
> > studio\vc98\include\winnt.h(144) : see declaration of 'WCHAR'
> > MNUExchangeBkpUtils.cpp(14) : error C2065: 'ppBackupNodeTree' : undeclared
> > identifier
> > MNUExchangeBkpUtils.cpp(14) : error C2275: 'PBACKUP_NODE_TREE' : illegal use
> > of this type as an expression
> > mnuexchangebkpstructs.h(106) : see declaration of 'PBACKUP_NODE_TREE'
> > MNUExchangeBkpUtils.cpp(14) : error C2100: illegal indirection
> >
> > //Line 16 HrESEBackupRestoreGetNodes fnMNUBackupRestoreGetNodes = NULL;
> > MNUExchangeBkpUtils.cpp(16) : error C2146: syntax error : missing ';' before
> > identifier 'fnMNUBackupRestoreGetNodes'
> > MNUExchangeBkpUtils.cpp(16) : error C2065: 'fnMNUBackupRestoreGetNodes' :
> > undeclared identifier
> >
> > //Line 17 fnMNUBackupRestoreGetNodes = (HrESEBackupRestoreGetNodes)
> > GetProcAddress (g_hESEDll,"HrESEBackupRestoreGetNodes");
> > MNUExchangeBkpUtils.cpp(17) : error C2146: syntax error : missing ';' before
> > identifier 'GetProcAddress'
> > Error executing cl.exe.
> > MNUExchangeBackup.exe - 12 error(s), 0 warning(s)
> > ---------------------------------------------------
> >
> > What could possibly be reason the error ? and what could be the fix ?
> >
> > Also is there a .h or a .lib file available which has functions of the
> > Exchange Backup and Restore API ?
> >
> > Thanks in advance,
> > Viraj
> > Mobiliti Inc.
> > a.viraj@xxxxxxxxxxxx
> > http://www.mobiliti.com
> > 732-248-8300 ext 234
> >
> >
> > "Jeff Partch [MVP]" wrote:
> >
> >> "Viraj" <Viraj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:022E6942-85CC-464C-9040-CAEDA84ECE77@xxxxxxxxxxxxxxxx
> >> > Hello Scot,
> >> >
> >> > Thanks for the reply. I made the correction as directed by you. Also I
> >> > created PBACKUP_NODE_TREE as typedef struct BACKUP_NODE_TREE
> >> > *PBACKUP_NODE_TREE ;
> >> >
> >> > Now the final code is:
> >> > --------------------------------------------------------------------------
> >> ----
> >> > BOOL BackupExchangeServer(HINSTANCE g_hESEDll)
> >> > {
> >> > BACKUP_NODE_TREE* pMNUBackupNodeTree = NULL;
> >> > typedef HRESULT (* HrESEBackupRestoreGetNodes) (IN WCHAR*
> >> > wszComputerName,OUT PBACKUP_NODE_TREE *ppBackupNodeTree);
> >> > HrESEBackupRestoreGetNodes fnMNUBackupRestoreGetNodes = NULL;
> >> > fnMNUBackupRestoreGetNodes = (HrESEBackupRestoreGetNodes) GetProcAddress
> >> > (g_hESEDll,"HrESEBackupRestoreGetNodes");
> >> > HRESULT hr;
> >> > if(fnMNUBackupRestoreGetNodes)
> >> > hr = (fnMNUBackupRestoreGetNodes) (NULL, &pMNUBackupNodeTree);
> >> > if(hr == S_OK)
> >> > return MNU_EXCHANGE_BKP_SUCCESS;
> >> > else
> >> > return MNU_EXCHANGE_BKP_FAILURE;
> >> > }
> >> > --------------------------------------------------------------------------
> >> ----
> >> >
> >> > This code compiles properly, but the application fails during execution of
> >> > HrESEBackupRestoreGetNodes. The error message I get is
> >> > --------------------------------------------------------------
> >> > Debug Error!
> >> > Program: C:\ ...\MNUExchangeBackup.exe
> >> > Module:
> >> > File: i386\chkesp.c
> >> > Line: 42
> >> > Ther value of ESP was not properly saved across a function call. This is
> >> > usually a result of calling a function declared with one calling
> >> convention
> >> > with a function pointer declared with a different calling convention.
> >> > --------------------------------------------------------------
> >> >
> >> > What could possibly be the error ?
> >>
> >> typedef HRESULT (ESEBACK_API* HrESEBackupRestoreGetNodes) (IN WCHAR*
> >> wszComputerName,OUT PBACKUP_NODE_TREE *ppBackupNodeTree);
> >>
> >> --
> >> Jeff Partch [VC++ MVP]
> >>
> >>
> >>
>
>
>
.



Relevant Pages

  • Re: ANNOUNCE ggets revised
    ... that might cause trouble is the definition of EOF in the return ... stdin, because it's an undeclared identifier. ...
    (comp.lang.c)
  • Re: Using the Exchange Backup API
    ... >>> The compilation errors with line numbers as well as with the original line ... >>> undeclared identifier ... >>> Mobiliti Inc. ...
    (microsoft.public.vc.mfc)
  • BYTE
    ... int main ... missing ';' before identifier 'm_bReceiveBuffer' ...
    (microsoft.public.vc.language)

Quantcast