IMAPI AddData error

  • Thread starter Thread starter Satyeshwar Singh
  • Start date Start date
S

Satyeshwar Singh

Hi,
I am on the second last step of burning a CD with IMAPI
interface --- The step to AddData using
IJolietDiscMaster. For some reason, no matter what I do,
I get an STG_E_ACCESSDENIED error back, and I am
wondering if anyone has tried AddData and it has worked
successfully. If so, can they please guide me how did
they set up their main storage pointer (flags etc.). Any
ideas on how to solved this problem will be greatly
appreciated.

Thanks,
Satyeshwar
 
While you are developing, you should stop IMAPI service before testing
program. This should rid you of STG_E_ACCESSDENIED error.
IMAPI service will be automatically started when you first use it, but it
will be in known default state.

nLength=(int)wcslen(pFS->FileName)*2+2;

rgelt[m_nIndex].pwcsName = (LPOLESTR)CoTaskMemAlloc( nLength );

memcpy( rgelt[m_nIndex].pwcsName, pFS->FileName, nLength );

rgelt[m_nIndex].type = STGTY_STREAM;

rgelt[m_nIndex].cbSize.QuadPart = p->GetFileSize();

rgelt[m_nIndex].mtime=pFS->CreationTime;

rgelt[m_nIndex].ctime=pFS->CreationTime;

rgelt[m_nIndex].atime=pFS->CreationTime;

rgelt[m_nIndex].grfMode = 0;

rgelt[m_nIndex].grfLocksSupported = 0;

rgelt[m_nIndex].clsid = CLSID_NULL;

rgelt[m_nIndex].grfStateBits = 0;

I hope that this will help

Best regards,
Slobodan
 
Thanks for the suggestion, but that was not the problem.
The problem was that I wasn't releasing each stream and
substorage pointers before I tried the add operation. An
analogy would be if you try to delete a directory when
there are some files underneath that directory that are
still open. You will get an access denied error. I think
that it wasn't obvious from reading the MSDN help on
IMAPI and I earnestly hope that the MSDN writers would
take note of the fact and add this to in the help.
Anyways, I got it to work, and I have IMAPI service
running all the time. I don't think I should stop it
since it is essential for me to burn the CD.

-Satyeshwar
-----Original Message-----
While you are developing, you should stop IMAPI service before testing
program. This should rid you of STG_E_ACCESSDENIED error.
IMAPI service will be automatically started when you first use it, but it
will be in known default state.

nLength=(int)wcslen(pFS->FileName)*2+2;

rgelt[m_nIndex].pwcsName = (LPOLESTR)CoTaskMemAlloc( nLength );

memcpy( rgelt[m_nIndex].pwcsName, pFS->FileName, nLength );

rgelt[m_nIndex].type = STGTY_STREAM;

rgelt[m_nIndex].cbSize.QuadPart = p->GetFileSize();

rgelt[m_nIndex].mtime=pFS->CreationTime;

rgelt[m_nIndex].ctime=pFS->CreationTime;

rgelt[m_nIndex].atime=pFS->CreationTime;

rgelt[m_nIndex].grfMode = 0;

rgelt[m_nIndex].grfLocksSupported = 0;

rgelt[m_nIndex].clsid = CLSID_NULL;

rgelt[m_nIndex].grfStateBits = 0;

I hope that this will help

Best regards,
Slobodan


Hi,
I am on the second last step of burning a CD with IMAPI
interface --- The step to AddData using
IJolietDiscMaster. For some reason, no matter what I do,
I get an STG_E_ACCESSDENIED error back, and I am
wondering if anyone has tried AddData and it has worked
successfully. If so, can they please guide me how did
they set up their main storage pointer (flags etc.). Any
ideas on how to solved this problem will be greatly
appreciated.

Thanks,
Satyeshwar


.
 
I was seeing that problem as well... and had implemented
the same solution that you are suggesting. The first
thing I did in my program was to stop IMAPI so that
functions like SetActiveDiskRecorder will pass. I
realized that IMAPI service is automatically started upon
the first call to one of the IDiscMaster interface.

-Satyeshwar
-----Original Message-----
I had a slightly different problem in the early phases of development.
Sometimes when I closed my application I have not deallocated IMAPI
properly. So IMAPI service was initialized with some data. And when I tried
later to start again application I had a similar error.

So I made function to stop the service when I enter the burning application.
Stopping is not same as disabling, so when you try to use IMAPI, service
will be stated automatically.

Now I find it useful when I don't longer need IMAPI just to free few extra
megabytes of RAM after the burning is done.

Best regards,
Slobodan Brcin

Thanks for the suggestion, but that was not the problem.
The problem was that I wasn't releasing each stream and
substorage pointers before I tried the add operation. An
analogy would be if you try to delete a directory when
there are some files underneath that directory that are
still open. You will get an access denied error. I think
that it wasn't obvious from reading the MSDN help on
IMAPI and I earnestly hope that the MSDN writers would
take note of the fact and add this to in the help.
Anyways, I got it to work, and I have IMAPI service
running all the time. I don't think I should stop it
since it is essential for me to burn the CD.

-Satyeshwar
-----Original Message-----
While you are developing, you should stop IMAPI
service
before testing
program. This should rid you of STG_E_ACCESSDENIED error.
IMAPI service will be automatically started when you first use it, but it
will be in known default state.

nLength=(int)wcslen(pFS->FileName)*2+2;

rgelt[m_nIndex].pwcsName = (LPOLESTR)CoTaskMemAlloc( nLength );

memcpy( rgelt[m_nIndex].pwcsName, pFS->FileName, nLength );

rgelt[m_nIndex].type = STGTY_STREAM;

rgelt[m_nIndex].cbSize.QuadPart = p->GetFileSize();

rgelt[m_nIndex].mtime=pFS->CreationTime;

rgelt[m_nIndex].ctime=pFS->CreationTime;

rgelt[m_nIndex].atime=pFS->CreationTime;

rgelt[m_nIndex].grfMode = 0;

rgelt[m_nIndex].grfLocksSupported = 0;

rgelt[m_nIndex].clsid = CLSID_NULL;

rgelt[m_nIndex].grfStateBits = 0;

I hope that this will help

Best regards,
Slobodan


"Satyeshwar Singh" <[email protected]> wrote
in
message
Hi,
I am on the second last step of burning a CD with IMAPI
interface --- The step to AddData using
IJolietDiscMaster. For some reason, no matter what I do,
I get an STG_E_ACCESSDENIED error back, and I am
wondering if anyone has tried AddData and it has worked
successfully. If so, can they please guide me how did
they set up their main storage pointer (flags etc.). Any
ideas on how to solved this problem will be greatly
appreciated.

Thanks,
Satyeshwar



.
 
I'm glad that you have made it work :)

Satyeshwar Singh said:
I was seeing that problem as well... and had implemented
the same solution that you are suggesting. The first
thing I did in my program was to stop IMAPI so that
functions like SetActiveDiskRecorder will pass. I
realized that IMAPI service is automatically started upon
the first call to one of the IDiscMaster interface.

-Satyeshwar
-----Original Message-----
I had a slightly different problem in the early phases of development.
Sometimes when I closed my application I have not deallocated IMAPI
properly. So IMAPI service was initialized with some data. And when I tried
later to start again application I had a similar error.

So I made function to stop the service when I enter the burning application.
Stopping is not same as disabling, so when you try to use IMAPI, service
will be stated automatically.

Now I find it useful when I don't longer need IMAPI just to free few extra
megabytes of RAM after the burning is done.

Best regards,
Slobodan Brcin

Thanks for the suggestion, but that was not the problem.
The problem was that I wasn't releasing each stream and
substorage pointers before I tried the add operation. An
analogy would be if you try to delete a directory when
there are some files underneath that directory that are
still open. You will get an access denied error. I think
that it wasn't obvious from reading the MSDN help on
IMAPI and I earnestly hope that the MSDN writers would
take note of the fact and add this to in the help.
Anyways, I got it to work, and I have IMAPI service
running all the time. I don't think I should stop it
since it is essential for me to burn the CD.

-Satyeshwar

-----Original Message-----
While you are developing, you should stop IMAPI service
before testing
program. This should rid you of STG_E_ACCESSDENIED error.
IMAPI service will be automatically started when you
first use it, but it
will be in known default state.

nLength=(int)wcslen(pFS->FileName)*2+2;

rgelt[m_nIndex].pwcsName = (LPOLESTR)CoTaskMemAlloc(
nLength );

memcpy( rgelt[m_nIndex].pwcsName, pFS->FileName,
nLength );

rgelt[m_nIndex].type = STGTY_STREAM;

rgelt[m_nIndex].cbSize.QuadPart = p->GetFileSize();

rgelt[m_nIndex].mtime=pFS->CreationTime;

rgelt[m_nIndex].ctime=pFS->CreationTime;

rgelt[m_nIndex].atime=pFS->CreationTime;

rgelt[m_nIndex].grfMode = 0;

rgelt[m_nIndex].grfLocksSupported = 0;

rgelt[m_nIndex].clsid = CLSID_NULL;

rgelt[m_nIndex].grfStateBits = 0;

I hope that this will help

Best regards,
Slobodan


message
Hi,
I am on the second last step of burning a CD with IMAPI
interface --- The step to AddData using
IJolietDiscMaster. For some reason, no matter what I
do,
I get an STG_E_ACCESSDENIED error back, and I am
wondering if anyone has tried AddData and it has worked
successfully. If so, can they please guide me how did
they set up their main storage pointer (flags etc.).
Any
ideas on how to solved this problem will be greatly
appreciated.

Thanks,
Satyeshwar



.
 
Back
Top