Nero events

vbimport

#1

I have problem becouse events like OnDoneCDInfo() are called at the end of the function.
Exemple if i call cdinfo() and then have some more code in the same function, all the code is executed and then Nero calls OnDoneCDInfo() ;
But i need the informaton before.
Can i forse Nero to call OnDoneCDInfo() imidietly, and if how?

I am using NeroCom.

Thenx


#2

All events are asynchronous. You cannot expect OnDoneCDInfo() to fire before the code that executed CDInfo() returns. For instance, if CDInfo() is called as a results of a button click, OnDoneCDInfo() will be fired some time after your button click handler returns. Assuming you are using VB and you still want to receive the event before the handler returns (which is usually a bad design), you should call DoEvents() in a loop until some flag is set. This flag should be set by the OnDoneCDInfo() event handler.


#3

I got i little diper in to a problem and saw theat what i wrote at first is not fully true. Like you sead it seems thaet events just need sime time or, i dont know, something else to fire.

How can i be shoure to get information fast enough to go on with burning.

I dont like your preposition (like you sed, usually a bad design),becouse i lose control when code begins to grow.

My proble at first is thet my program now works in a whay you sugested.
I call cdinfo and in onDoneCdInfo i call next function.
The same with ImportISOTrack;
But some where , somehow the secend thred is started withdout any sence.
It messes avrery thing.

I whud like to make it simpler, to do averey thin in one thread, to gain control of my code.

i am usin c#
I will all so post my code just in case.
It is only code for one form and it starts burning with button1_clic.

CDPekacKoda.txt (19.1 KB)


#4

How can i be shoure to get information fast enough to go on with burning.
What do you mean exactly? The program flow usually needs the disc information before it will do any burning, so how can you be late?

I dont like your preposition (like you sed, usually a bad design),becouse i lose control when code begins to grow.
Sorry, but it is a bad design as it defeats the purpose of event-driven programming. Not that it cannot be done…

But some where , somehow the secend thred is started withdout any sence.
It messes avrery thing.
What second thread? Internally, NeroCOM uses worker threads but you should not know or care anything about that.

I whud like to make it simpler, to do averey thin in one thread, to gain control of my code.
You sure can do that but this is not meant by the design of either NeroCOM or similar components. The only way you can “simplify” things is by using DoEvents() and waiting on various flags for different events.

<!-- / message --><!-- attachments -->


#5

Thanx alexp i found solution with application.DoEvennts();