This project has moved. For the latest updates, please go here.

DG DAT MSG out of expected sequence when trying to set capability (SUPPORTEDSIZES)

Aug 26, 2014 at 4:24 PM
hi if i try to set a capability i receive the following message: DG DAT MSG out of expected sequence i already tried all methods available and receive the same message

Aug 26, 2014 at 7:32 PM
Edited Aug 26, 2014 at 7:33 PM
Hello, vnsbr.
See documentation. Also, show your code and exception stack trace.
Aug 26, 2014 at 8:08 PM
Hi! Thanks for the reply, i just found i was foing it wrong, i was doing tests inside the acquire method:
        if(this.OpenDSM()) {
            if(this.OpenDataSource()) {
                if(this._EnableDataSource()) {
                    this.SetCap(TwCap.SupportedSizes, TwSS.A5);
                    if(!Application.MessageLoop) {
                        Application.Run(this._context=new ApplicationContext());
doing this way works without issues:
            this._twain.SetCap(TwCap.SupportedSizes, TwSS.A5);
i didnt understood twain life cycle very well
Aug 26, 2014 at 8:22 PM
Marked as answer by SARAFF on 8/31/2014 at 1:20 PM