Msgbox causes OnDoneCDInfo to be called again and again

Hallo

When a Messagebox is place in OnDoneCDInfo, it causes this sub to be called again and again until the last opened message box is closed. I think this is because the OnDoneCDInfo -Sub doesn’t come to the end as the program waits until the messagebox is closed. The program therefore doesn’t know that CDInfo was called already.

Hope, this is understandable. Otherwiese just try it. You’ll see immediatly what I mean.

Regards
Raffael Walther

Just tried it, and the message box only appears once!

Are you sure you are not repeatedly calling the drive.cdinfo method, this seems the most likely cause.

Mike

Hello

Yes, I am VERY sure because I don’t even call it one time. The event is automatically called if for example a media is inserted or (I suppose the NeroDrive…) -Object is loaded.

Messagebox is opened again and again…


Private Sub A_OnDoneCDInfo
    Msgbox "Test"
End Sub

In the following example, that Text “Test” is only writen once.


Private Sub A_OnDoneCDInfo
    txtA = txtA & "test"  'NOT txtA = "test" !!!!
End sub

Anyway, I’ll take the Messagebox out of the Sub and do it in another way.

Hello again

I also DON’T set txtA="" somewhere in the code. OnDoneCDInfo is really just called one time in the 2nd example. It’s really clear for me. I tried serveral examples. As long as the last opened Messagebox is not closed, new Messageboxes are opened again and again… As soon as the last called Box was closed, they stopped poping up.

Regards
Raffael

OnDoneCDInfo is NOT called automatically when media is inserted, that event is the OnDriveStatusChanged event. OnDoneCDInfo is only called in response to the CDinfo method.

You MUST be calling CDinfo somewhere.

Mike

Hello

You are right, I appologice.
There is a timer in the programm that calles the event repeadedly as soon as DeviceReady has changed. There is also a variable that is set to the current status to prevent repeated calling of the even again and again… Fact: My error and it works now!