Newbie APIVersion Question

vbimport

#1

Sorry for such a newbie question but I have trying to get a simple label to display the API version. I am working with the VB6 NeroFiddlesCOM example. Can anybody help me with the correct syntax? This is what I have been doing:

Label1.Caption = nero.APIVersion()

I think there are some parameters I need to pass but not sure.
I’m also try to get disc info as well. Such as if disc is blank, how much space is on the disc.

Thank you for any help. :slight_smile:


#2

for some reason they made this a method instead of a property that can be obtained. the only way i have been able to use the line itself is by using

nero.APIVersion vbNull, vbNull, vbNull, vbNull

if you step through teh code in vb it will step through the abov ejust fine. however once i try to get it to return a value it acts like the method doest exsist

such as label5.caption = nero.APIVersion (vbNull, vbNull, vbNull, vbNull)

i get the error expected funtion or variable and the apiversion is highlited.
im not sure why they made this as a method that you have to pass information to since you have no idea what version will show up on other computers so why would you have to pass anything along they should have simply dont it an easier way :slight_smile: they should have used it as a string

maybe somthing like this

//Init Nero’s API’s… Meaning Load The Nero Aspi Layer DLL :wink:
long CNeroBurnCtrl::LoadNeroAPI()
{
signal (SIGINT, SigCtrlC);

if (!NeroAPIGlueConnect(NULL)) 
{
	puts ("Cannot connect to NeroAPI");
	Exit (10);
}

DWORD version = NeroGetAPIVersion();

m_aPIVersion = version; //version;

NEROAPI_INIT_ERROR initErr=NeroInit (&NeroSettings,NULL);
switch (initErr) 
{
case NEROAPI_INIT_OK:
	break;
case NEROAPI_INIT_INVALID_ARGS:
	NeroError ("NeroInit() : invalid args");
	break;
case NEROAPI_INIT_INVALID_SERIAL_NUM:
	NeroError ("NeroInit() : invalid serial number");
	break;
case NEROAPI_INIT_DEMOVERSION_EXPIRED:
	NeroError ("NeroInit() : demo version has expired");
	break;
case NEROAPI_INIT_CANNOT_LOCK:
	NeroError ("NeroInit() : cannot lock");
	break;
default:
case NEROAPI_INIT_UNSPECIFIED_ERROR:
	NeroError ("NeroInit() : unspecified error");
}


if (writebuffersize!=0)
{
	NeroSetOption(NEROAPI_OPTION_WRITE_BUFFER_SIZE,&writebuffersize);
}

NeroDeviceInfos = NeroGetAvailableDrivesEx (dvd ? MEDIA_DVD_ANY : MEDIA_CD,NULL);

m_numberOfDevices = NeroDeviceInfos->nsdisNumDevInfos;

if (!NeroDeviceInfos) 
{
	NeroError ("NeroGetAvailableDrives()");
}

NERO_SCSI_DEVICE_INFO *pSelectedDeviceInfo;

return m_aP

}

thats how you obtain it outside of teh com object in c++ but they should have made this into a property so you can obtain the information rather then have you pass values to it that you wouldnt know anyways. and passing integers to is doesnt work anyways the only thing in vb i could pass was vbnull. which is nothing.


#3

//Init Nero’s API’s… Meaning Load The Nero Aspi Layer DLL :wink:
long CNeroBurnCtrl::LoadNeroAPI()
{
signal (SIGINT, SigCtrlC);

if (!NeroAPIGlueConnect(NULL)) 
{
	puts ("Cannot connect to NeroAPI");
	Exit (10);
}

DWORD version = NeroGetAPIVersion();

m_aPIVersion = version; //version;

NEROAPI_INIT_ERROR initErr=NeroInit (&NeroSettings,NULL);
switch (initErr) 
{
case NEROAPI_INIT_OK:
	break;
case NEROAPI_INIT_INVALID_ARGS:
	NeroError ("NeroInit() : invalid args");
	break;
case NEROAPI_INIT_INVALID_SERIAL_NUM:
	NeroError ("NeroInit() : invalid serial number");
	break;
case NEROAPI_INIT_DEMOVERSION_EXPIRED:
	NeroError ("NeroInit() : demo version has expired");
	break;
case NEROAPI_INIT_CANNOT_LOCK:
	NeroError ("NeroInit() : cannot lock");
	break;
default:
case NEROAPI_INIT_UNSPECIFIED_ERROR:
	NeroError ("NeroInit() : unspecified error");
}


if (writebuffersize!=0)
{
	NeroSetOption(NEROAPI_OPTION_WRITE_BUFFER_SIZE,&writebuffersize);
}

NeroDeviceInfos = NeroGetAvailableDrivesEx (dvd ? MEDIA_DVD_ANY : MEDIA_CD,NULL);

m_numberOfDevices = NeroDeviceInfos->nsdisNumDevInfos;

if (!NeroDeviceInfos) 
{
	NeroError ("NeroGetAvailableDrives()");
}

NERO_SCSI_DEVICE_INFO *pSelectedDeviceInfo;

return m_aPIVersion;

}


#4

Originally posted by laracroft
[B]Sorry for such a newbie question but I have trying to get a simple label to display the API version. I am working with the VB6 NeroFiddlesCOM example. Can anybody help me with the correct syntax? This is what I have been doing:

Label1.Caption = nero.APIVersion()

I think there are some parameters I need to pass but not sure.
[/B]

Hi,

You can get the API version using the following:


    Dim verMajHi As Integer
    Dim verMajLo As Integer
    Dim verMinHi As Integer
    Dim verMinLo As Integer
    nero.APIVersion verMajHi, verMajLo, verMinH , verMinLo
    MsgBox verMajHi & "." & verMajLo & "." & verMinHi & "." & verMinLo