[NeroCOM]Audio Burn Problem with VC as client

Hi,

I am using NeroCOM 6.3 and VC++ as the client application.

I am facing a problem after burning an Audio CD. It is burning all the Audio data but after burning when I try to close the application it is crashing…
The same piece of code is working fine for data cd(with change in parameters for burn API).
I am attaching the code snippet which we are using and also the log messages. Please see the attachments and any response is appreciated.

Thanx,
Ashok

There are a few issues in your code snippet that are not right but are not the cause of the problem.

First, you are calling AllocSysString on a CString object which generates a BSTR but which is never freed by anyone. This leaves you with memory leaks. The put_ methods expect a [in] BSTR which means the caller is the owner and should free it.

Second, passing L"string" where the function expects a BSTR is simply incorrect and while it may work in practice at times, it will also fail on some other occassions. You should similarly allocate a BSTR, but remember to free it later. To get rid of these two problems, you might want to use something like put_Filename (CComBSTR (strFilePath)). This will automatically convert to BSTR and free it after the call returns.

Also, using some form of smart pointers (_com_ptr_t, CComPtr, CComQIPtr) would greatly increase readability and decrease interface reference counting problems. Same for BSTRs (CComBSTR, _bstr_t).

As for the cause of crash, it is hard to tell just from the code snippet you sent. It doesn’t appear to be incorrect at first sight but many things could be wrong in the code you did not send.

It would be best if you could send all relevant portions of the code or even better, create a very simple project that reproduces the problem.

Hi Alex,

Thanks for your response. I am sending the sample application (4thAug.zip)

Here are the steps to build the application.

  1. Unzip the files.

  2. It will create EngineInterface and TestNero
    EngineInterface project will interface with the NeroSDK it is a COM dll
    TestNero is a sample client application.

  3. Please copy NeroCom.h file from EngineInface folder to TestNero folder ( as the attachment was limited to 97kb i deleted it).

  4. Use Batch build and select TestNero Debug and EngineIntFace Debug

  5. Now Set EngineIntFace as active project by right clicking on the EngineIntFace

  6. Execute — it will ask for the execution path…Please give the path of TestNero.exe

Please let me know if you need any more tips for buid.

PS: If you want to change the drive index please use GetDrives() and change
Idrives->Item(i,&Idrv); // viz i = 0 or 1 etc.

I am using 2 functions for burning audio

  1. Burn_AudioTrack()
  2. Burn_Audio()

In the TestNero Application the file paths are hardcoded. Please use the appropriate path from your harddisk.

Hoping for a solution.

Thanks in advance
Ashok

Don’t get me wrong, but the sample you sent is very messy with plenty of memory and interface leaks everywhere. Plus, you are doing the burning and yet handling no events in the process.

Sorry, but it would take too much time to find the NeroCOM interaction problem with so many own problems introduced by the sample application. Simply put, it is a rather incomplete application with bits and pieces missing. NHF.

Hi Alex,

This is only a sample application. In the actual software we are handling the call back events and we have taken care of memory leaks also. Since the attachment it limited to 97kb I had to remove the classes to handle call back events. But with all these in the actual software we are still getting the crashing problem. When we debug it says the problem is in “AudiPlugInMgr”(the same can be reproduced in the sample application which I have sent).
Hence the Memory and interface leaks in the sample application is not a hindrance to reproduce the above problem.

Hence the Memory and interface leaks in the sample application is not a hindrance to reproduce the above problem.
I beg to differ. I have fixed all your interface leaks and the crash does not happen.

Please learn about smart pointers as they are trivial to use, more convenient and rid of you the problems you now have.

Hi Alex,

Thanks for your response. I am new to COM domain. Will take your inputs. If possible can you please send me the code,wherein you have fixed the problem please.

Thanx,
Ashok

Find the code attached.

4th August MODIFIED.zip (97 KB)