Re: Using the Exchange Backup API
- From: "Viraj" <Viraj@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 22 Jul 2005 07:46:04 -0700
Hello Scott,
My reply to your questions:
You have presented us with some assumptions you have made, but not justified:
Q * Just because the LoadLibrary succeeded, how can you assume that the
function call should succeed?
Answer: The function is a standard function in the Microsoft Exchange Backup
and Restore API. Per API instructions I am using the function on the machine
with the Exchange Server installed and running. The LodLibrary for loading
the dll is successful and the function called is a standard API function
hence I assume that the function should succeed. If it does not then the only
possible error could be in the way I invoke it or any mismatch in parameters.
Q * You called GetProcAddress, but made no attempt to confirm that it
actually succeeded in getting a pointer to that function.
Answer: I had checked whether GetProcAddress returns a valid pointer, but to
reduce the sixe of the post I removed the line as I knew that the application
was not failing at that point. While debugging I see that GetProcAddress
returns a valid pointer.
Q * 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"?
Answer: As I said in my earlier answers I am trying to call a standard API
function in the relevent environment. I see that the dll is loading properly
using the LoadLibrary and also see that I am able to get valid address for
the function using GetProcAddress. I also see in step by step debuggging that
the application crashes in the very next step where I try to invoke the
function using the address obtained using GetProcAddress. Based on all the
above factors I cannot think of any other step failing but the step where I
invoke the function.
Q * You refer to a "crash", but you don't explain how that is manifested.
Error message? Exception? Program Termination?
Answer: The error I am getting is Unhandled exception in
MNUExchangeBackup.exe (ESEBCLI2.DLL): 0xC0000005: Access Violation.
Thanks,
Viraj
a.viraj@xxxxxxxxxxxx
http://www.mobiliti.com
"Scot T Brennecke" wrote:
> 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
> >
> >
>
>
>
.
- Follow-Ups:
- Re: Using the Exchange Backup API
- From: Scot T Brennecke
- Re: Using the Exchange Backup API
- References:
- Using the Exchange Backup API
- From: Viraj
- Re: Using the Exchange Backup API
- From: Scot T Brennecke
- Using the Exchange Backup API
- Prev by Date: Re: Right aligning CListBox on Win 98 does not work
- Next by Date: Re: How to write OnOk()
- Previous by thread: Re: Using the Exchange Backup API
- Next by thread: Re: Using the Exchange Backup API
- Index(es):
Relevant Pages
|