Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, User Dialog Callback not called at International Chat: Software related forum; Hello... I hope somebody can help out. My customer needs to burn DVD disks from MPEG2 files that will play in a household DVD player. I tested this functionality using the sample provided for the NeroVisionAPI and it works perfectly for what we need. I need to provide this functionality


Reply
 
Thread Tools
Old 19-03-2005   #1 (permalink)
New on Forum
 
Join Date: Mar 2005
Posts: 5
User Dialog Callback not called

Hello... I hope somebody can help out.

My customer needs to burn DVD disks from MPEG2 files that will play in a household DVD player. I tested this functionality using the sample provided for the NeroVisionAPI and it works perfectly for what we need.

I need to provide this functionality for Visual Basic so, taking the NeroVisionAPI sample as a guide, I started writing an ATL COM dll that would take all required information from Visual Basic and burn the DVD.

So far I am able to add videos, get a list of recording devices and assign the recording device I want to use to burn the DVD.

The problem I am having is that my User Dialog Callback function is not being called by the Nero API. I make a call to NeroBur() and, through DLL events, I get progress reports on transcoding. When the NeroAPI reports to me that it is generating, it gets up to 80%.
I get reports form the NeroIdleCall back several times, and then a LogLine report that says “User Abort”. I call some messaging events from my Nero User Callback to see where it is failing or if it is entering the callback function at all, but these events are not being raised.

Here is how I am setting things up:

--My user call back function is declared as follows:
static NeroUserDlgInOut NERO_CALLBACK_ATTR NeroDialogCallback(void *pUserData, NeroUserDlgInOut type, void *data);

--and it is defined like this:

NeroUserDlgInOut NERO_CALLBACK_ATTR CDVDProject::NeroDialogCallback(void *pUserData, NeroUserDlgInOut type, void *data)
{
CDVDProject * pThis = (CDVDProject *) pUserData;
CStdString msg("Nero Dialog is being Called!");
pThis->DVDMessage(msg.AllocSysString());
switch (type)
{
case DLG_AUTO_INSERT:
{
CStdString msg("DLG_AUTO_INSERT");
pThis->DVDMessage(msg.AllocSysString());
return DLG_RETURN_CONTINUE;
}
case DLG_DISCONNECT_RESTART:
{
CStdString msg("DLG_DISCONNECT_RESTART");
pThis->DVDMessage(msg.AllocSysString());
return DLG_RETURN_ON_RESTART;
}
.... more case statments go here
case DLG_WAITCD_DONE:
{
CStdString msg("DLG_WAITCD_DONE");
pThis->DVDMessage(msg.AllocSysString());
return DLG_RETURN_EXIT;
}
case DLG_FILESEL_IMAGE:
{
CStdString msg("DLG_FILESEL_IMAGE");
pThis->DVDMessage(msg.AllocSysString());
return DLG_RETURN_CONTINUE;
}
}
return DLG_RETURN_EXIT;
}

--I am setting up the NEO_SETTINGS structure like this:

NERO_SETTINGS CDVDProject::ns =
{
NULL,
"Ahead",
"Nero Burning ROM",
"Nero.txt",
{NeroIdleCallback, 0},
{NeroDialogCallback, 0},
FALSE,
0
};

--and when I am about to initialize the NeroAPI I do this:


ns.nstIdle.ncUserData = this;
ns.nstUserDialog.ncUserData = this;

BOOL bSuccess = NeroAPIGlueConnect (NULL);
if (!bSuccess)
{
return Error(L"Cannot open NeroAPI.dll!");
}

NEROAPI_INIT_ERROR err = NeroInit (&ns, NULL);
if (err != NEROAPI_INIT_OK)
{
return Error(L"Fail to initialize NeroAPI.dll!");
}


--This is what I do to burn the DVD:

//Build project configuration XML info
IXMLDOMDocumentPtr pDocument = BuildXML ();
if (pDocument != NULL)
{
USES_CONVERSION;
try
{
// Create an instance of NeroVisionAPI's Project object
EVAL_HR (m_pProject.CreateInstance (__uuidof (Project)));
INeroBurnContextPtr pBurnContext;
BOOL blnSuccess =
m_pProject->SetXMLString((LPSTR)(LPCSTR)W2CA(pDocument->xml));
if (blnSuccess)
{
VARIANT_BOOL bSuccess = m_pProject->CreateNeroBurnContext(
NeroAPIGlueGetModuleHandle (), this, &pBurnContext);
if (bSuccess)
{
// Ok, now do the burning...
LPCOLESTR errMsg;
NEROAPI_BURN_ERROR err;
// Open the device...
NERO_DEVICEHANDLE hDevice = NeroOpenDevice (GetSelectedRecorder());
if (hDevice != NULL)
{
NERO_PROGRESS * pNeroProgress;
// Create NERO_PROGRESS structure using API.
pNeroProgress = NeroCreateProgress ();
if (pNeroProgress != NULL)
{
// Fill-in the NERO_PROGRESS structure wiht our own callbacks.
pNeroProgress->npAbortedCallback = NeroAbortedCallback;
Progress->npAddLogLineCallback = NeroAddLogLineCallback;
pNeroProgress->npProgressCallback = NeroProgressCallback;
pNeroProgress->npUserData = this;
// Now, finally start burning using the NERO_CD_FORMAT
// and NERO_WRITE_CD as returned from NeroVisionAPI.
//Set it to Maximum speed
m_dwBurnSpeed = 0;
err = NeroBurn (

hDevice,
NERO_CD_FORMAT) pBurnContext->NERO_CD_FORMAT,
pBurnContext->NERO_WRITE_CD,
NBF_WRITE|NBF_DAO,
m_dwBurnSpeed, pNeroProgress;
)
bBurnError = err != NEROAPI_BURN_OK;
NeroFreeMem (pNeroProgress);
}
NeroCloseDevice (hDevice);
if (bBurnError)
{
switch (err)
{
case NEROAPI_BURN_UNKNOWN_CD_FORMAT:
return Error(L"Unknown CD Format");
case NEROAPI_BURN_INVALID_DRIVE:
return Error(L"Invalid Drive");
case NEROAPI_BURN_FAILED:
return Error(L"Burn Failed");
case NEROAPI_BURN_FUNCTION_NOT_ALLOWED:
return Error(L"Burn Function Not Allowed");
case NEROAPI_BURN_DRIVE_NOT_ALLOWED:
return Error(L"Drive Not Allowed");
case NEROAPI_BURN_USER_ABORT:
return Error(L"User Abort");
case NEROAPI_BURN_BAD_MESSAGE_FILE :
return Error(L"Bad Message File");
}
}
}

As I said…all other callback function are being called, except the User Dialog call back function.

Can anybody give me a hand with this?

Thanks, thanks, thanks!
jecx2 is offline   Reply With Quote
Old 19-03-2005   #2 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
There is a number of reasons why the burn process might abort. Some callbacks such as progress, aborted and idle callback return a BOOL value which tells NeroAPI if it should abort. You should check your return values for those callbacks. Additionally, if your userdialog callback is never called, you may check the error log or last error to see if this sheds any light on the issue.

You say you get reports of transconding after calling NeroBurn() with idle callback being called several times. Are you sure transcoding happens during NeroBurn(), not before during CreateNeroBurnContext()?
alexp is offline   Reply With Quote
Old 19-03-2005   #3 (permalink)
New on Forum
 
Join Date: Mar 2005
Posts: 5
Re: User Dialog Callback not called

Hi Alex...
First of all..thanks a lot for your prompt reply.

I put some code to raise an event before calling the NeroBurn() method.
I just ran the program and you are absolutely right...the transcoding happens before the call to the NeroBurn() method.
Any ideas what could be causing the method to fail? I was carefull to be as close as possible to the NeroVisionAPI sample.
I will follow your advice and check the return values for the callbacks that are being called.

Jorge
jecx2 is offline   Reply With Quote
Old 19-03-2005   #4 (permalink)
New on Forum
 
Join Date: Mar 2005
Posts: 5
Re: User Dialog Callback not called

ALEX!!!!!
You were absolutely right!!!!
The problem was exactly the values being returned by the other callbacks.

Thansk a million man...Had been messing with this for a couple of days.
Now...life is good again!

Jorge
jecx2 is offline   Reply With Quote
Old 19-03-2005   #5 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
I am also glad it was that simple :-)
alexp is offline   Reply With Quote
Old 03-02-2007   #6 (permalink)
New on Forum
 
Join Date: Feb 2007
Posts: 11
Re: User Dialog Callback not called

Quote:
Originally Posted by jecx2
ALEX!!!!!
You were absolutely right!!!!
The problem was exactly the values being returned by the other callbacks.

Thansk a million man...Had been messing with this for a couple of days.
Now...life is good again!

Jorge
What Version of nero are you runing and what version of the sdk?
I have problems running the sample applications they keep failing when you ask to get the transcoding estamating time.
devconx is offline   Reply With Quote
Old 03-02-2007   #7 (permalink)
New on Forum
 
Join Date: Feb 2007
Posts: 11
Re: User Dialog Callback not called

Quote:
Originally Posted by alexp
I am also glad it was that simple :-)

I keep getting errors when running the sample applications.
Error code: 9,XMLID:,Error text: CNeroConvertManager::CreateConverter(): unknown application (21). It looks like the error is return when you try to get estamated transcoding time. I am using the latest nero 7.7.5.1 and the 1.08sdk
devconx is offline   Reply With Quote
 
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
A TAGES dialog spath Optical Storage Technical Discussions 264 03-05-2007 00:44
Returning TRUE to Abort callback causes hang Eigeneer Nero SDK Discussion Forum 0 18-12-2006 22:38
NeroAPI does not call NeroUserDialog-Callback obsÿence Nero SDK Discussion Forum 0 03-04-2006 16:43
Nero CALLBACK function stanely5 Nero SDK Discussion Forum 1 12-07-2005 08:27
UserDialog callback simwall Nero SDK Discussion Forum 3 09-02-2004 08:49


All times are GMT +2. The time now is 08:34.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0