| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #2 (permalink) |
| New on Forum Join Date: Jan 2005
Posts: 7
| Re: NeroVisionAPI sample c# program Ok, So i've been playing a bit but not got too far and only have even more questions! I can see that I can the following statements to allow me to start using some of the API's using NeroVisionAPI; using NEROLib; and then NEROLib.NeroClass neroAPI = new NEROLib.NeroClass(); ...Do stuff with Nero... neroProj.SetXMLString("some xml"); NeroVisionAPI.INeroBurnContext context; neroProj.CreateNeroBurnContext(neroAPI,null,out context); The problem I have is that the CreateNeroBurnContext need a handle to the neroAPI dll! - in the old days this would have been a loadlibrary or something - but I am new to c# and don't know where to get this from. Also in the c++ example it tals about a glue library - do I need to use this?. Perhaps someone could get me started - please. Cheers Mick |
| | |
| | #3 (permalink) |
| New on Forum Join Date: Jan 2005
Posts: 8
| Re: NeroVisionAPI sample c# program Hey Mick, I've been doing a similar thing in trying to use Nero Vision from .net. The best way is to create a wrapper in c++ using Nero Vision/Nero API, then use that in c#. To use the NeroVision api, it needs to be linked with static libraries, which can only be done in c++. I dont think that Nero Vision COM library is meant to be used. |
| | |
| | #4 (permalink) |
| New on Forum Join Date: Jan 2005
Posts: 7
| Re: NeroVisionAPI sample c# program Thanks for the reply - I am OK at C++ but really new to this .NET stuff!, any chance you could post some or all of your 'wrapper' class file so I can see the sort of thing that needs to be done. Thanks Mick |
| | |
| | #8 (permalink) |
| New on Forum Join Date: Jan 2005
Posts: 8
| Re: NeroVisionAPI sample c# program Mick, There is a sample NeroVision c++ project in the SDK. All you need to do is use that as a starting point. Then you need to decide wether to do a Managed c++ dll or un-managed c++ dll to use in .net. I wasn't too familiar with the pro and cons of doing something like this in managed c++, so i went for the un-managed path. A managed c++ dll is a typicaly .net assembly which uses the .net framework and is used by adding a reference to it in c#. An un-managed c++ dll can only be used using the interop "DLLImport" attribute. Since you cannot use un-managed c++ classes (unless its a com object) using DllImport, you must create a c style function library and declare you functions with the "extern" keyword to use from .net, such as. Code: extern "C" __declspec(dllexport) void EjectDrive() Code:
[DllImport("your-unmanaged-library.dll")]
private static extern void EjectDrive(); |
| | |
| | #9 (permalink) |
| New on Forum Join Date: Jan 2005
Posts: 7
| Re: NeroVisionAPI sample c# program OK things are moving... I have the following code NeroVisionAPI.Project neroProj = new Project(); NeroVisionAPI.INeroBurnContext context; try { neroProj.SetXMLFile("c:\\nerotext.xml"); //Ok lets get a drive NEROLib.NeroDrives availDrives = neroAPI.GetDrives(NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_M); NEROLib.INeroDrive drive = availDrives.Item(1); // drive. long size=0; neroProj.EstimateDiskSize(out size); double seconds=0; neroProj.EstimateCreateNeroBurnContextTime(null, out seconds); System.IntPtr handle = getNeroModuleHandle(); if (neroProj.CreateNeroBurnContext(handle,null,out context)) { string strText = "Context created"; } This is all working!, I have created an un managed DLL that defines the getNeroModuleHandle and this is OK. As far as I can see I now need to call NeroBurn!, this does not seem to be available from a NEROLib.INeroDrive object. Am I completely off track here? Mick |
| | |
| | #10 (permalink) | |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Quote:
| |
| | |
| | #13 (permalink) | |
| New on Forum Join Date: Feb 2007
Posts: 11
| Re: NeroVisionAPI sample c# program Quote:
Can you share a little more light on the method getNeroModuleHandle(); | |
| | |
| |
| |
![]() |
| If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NeroVisionApi | mjmim | Nero SDK Discussion Forum | 1 | 17-08-2007 22:24 |
| NeroVisionApi | mjmim | Nero SDK Discussion Forum | 0 | 11-04-2007 13:22 |
| NeroVisionApi | mjmim | Nero SDK Discussion Forum | 3 | 01-04-2007 17:37 |
| NeroVisionApi.dll | Duke Nukem | Nero SDK Discussion Forum | 0 | 07-07-2006 16:06 |
| VB Sample Project for NeroVisionAPI | raghav2000 | Nero SDK Discussion Forum | 1 | 05-08-2004 16:45 |