cddbcontrol : edit / save ID3 tags

Joined
Jun 13, 2005
Messages
148
Reaction score
0
OK I need Help,

I use a reference to the cddbcontrol library in my .NET program.

The program renames the files aswell as updating the id3 info.

Once referenced the ID3 class has many methods, i have the basic functionality down, but 1 out of every 20 files still brings an errror.

individual file error comes up at line
.LoadFromFile(strfilename, false)

Presenting error
An unhandled exception of type 'System.NullReferenceException' occurred in HeavyTitle.exe
Additional information: Object reference not set to an instance of an object.



Also after closing program, i get a memory error;

"the instruction at "0x7c9111cd" referenced memory at "0xfffffffff". The memeory could not be "read".

"read" will sometimes say "write" and the addresses vary.

But the error only occurs when i append ID3 title to the file.


Basically
I would liek to know what methods i need;

whether io do in fact need to load, before i write.,,,,
do i need to clear, or commit rather then just saving,,,,
WHY does it say null reference at load line, variable is correct.



Any expirienced cddbcontrol users,,,please help!!!
Or anyone familar with meory errors.

Much Thanks to all who have read,
MasterKeedu

My entire appending sub-routine is below, with declaration listed first.



Dim ID3 AsNew CDDBCONTROLLibAOL.CddbID3Tag()


Private
Sub Appendid3Title()



btnRUN.Hide()

btnChange.Hide()

Dim blnError AsBoolean'did error occur in function?

'begin working with list of files

For intfilecount = 0 To OpenFileDialog1.FileNames.GetUpperBound(0)

strFilename = ""



IfNot (SourceFileExists(OpenFileDialog1.FileNames(intfilecount))) ThenExitSub

strFilename = OpenFileDialog1.FileNames(intfilecount)

retryID3:

OnErrorGoTo retryID3

blnError =
True'set to false by succesful sAVE

strFilename = OpenFileDialog1.FileNames(intfilecount)

GetParsedNames(strFilename)
'saves path, extension and relative name

ID3TITLE = GetID3Ready(strJustName)

lblcurrentfile.Text = strNameExt

Me.Refresh()

OnErrorGoTo retryID3

With ID3

.LoadFromFile(strFilename,
False)

.Title = ID3TITLE

.SaveToFile(strFilename)

' .Commit()

.Clear()

EndWith

blnError = False

Err101:

If blnError Then

With ID3

.Clear()

EndWith

Dim DIALOG As DialogResult

DIALOG = (MessageBox.Show("It appears some ID3 info is causing file naming difficulties." & Chr(10) _

& "please try checking ID3 info, and editing, in file: " & strFilename, "OH NO!", MessageBoxButtons.AbortRetryIgnore, _

MessageBoxIcon.Error, MessageBoxDefaultButton.Button1))

If DIALOG = DialogResult.Abort ThenEnd

If DIALOG = DialogResult.Retry ThenGoTo retryID3

If DIALOG = DialogResult.Ignore ThenGoTo Ignore

EndIf

ignore:

strFilename = ""

Next intfilecount

MessageBox.Show("Operation Completeled Successfully!!", "Congratulations")

btnChange.Show()

lblcurrentfile.Hide()

EndSub

 
Top