Re: Using the Exchange Backup API

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You have presented us with some assumptions you have made, but not justified:
* Just because the LoadLibrary succeeded, how can you assume that the function call should succeed?
* You called GetProcAddress, but made no attempt to confirm that it actually succeeded in getting a
pointer to that function.
* Even if the function pointer is valid, how can we assume that it isn't the function which you are
calling that causes the "crash"?
* You refer to a "crash", but you don't explain how that is manifested. Error message? Exception?
Program Termination?

"Viraj" <Viraj@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:565C6614-35F1-406E-9FEB-D651653C64E6@xxxxxxxxxxxxxxxx
> Hello All,
>
> I am trying to write an application to backup Exchange server. Below is the
> function I have written for it. I am using VC++ 6.0 and M.S. Exchange server
> 2003. My application crashes when I invoke the function
> HrESEBackupRestoreGetNodes.
>
> BOOL BackupExchangeServer(HINSTANCE g_hESEDll)
> {
> BACKUP_NODE_TREE *pMNUBackupNodeTree;
> typedef HRESULT (* HrESEBackupRestoreGetNodes) (IN WCHAR*
> wszComputerName,OUT BACKUP_NODE_TREE* pBackupNodeTree);
> HrESEBackupRestoreGetNodes fnMNUBackupRestoreGetNodes = NULL;
> fnMNUBackupRestoreGetNodes = (HrESEBackupRestoreGetNodes) GetProcAddress
> (g_hESEDll,"HrESEBackupRestoreGetNodes");
> //my program crashes in the next line.
> HRESULT hr = (fnMNUBackupRestoreGetNodes) (NULL, pMNUBackupNodeTree);
> if(hr == S_OK)
> return MNU_EXCHANGE_BKP_SUCCESS;
> else
> return MNU_EXCHANGE_BKP_FAILURE;
> }
>
> The Lod Library successfully loads the dll "esebcli2.dll". Hence the
> function HrESEBackupRestoreGetNodes should return success, but it fails.
>
> Can anyone please point the mistake in my code or give me sample code for
> Backup Functions.
>
> Thanks,
> Viraj
> a.viraj@xxxxxxxxxxxx
> http://www.mobiliti.com
>
>


.