This project has moved and is read-only. For the latest updates, please go here.

SetCap throw error

Sep 4, 2013 at 4:22 PM
Hello.
Help me please.
I have some code

...
if(this.OpenDSM()) {
            if(this.OpenDataSource()) {
                this._EnableDataSource();

                SetResolutions((float)200);

                if(!Application.MessageLoop) {
                    Application.Run(this._context=new ApplicationContext());
                }
            }
...

SetResolutions((float)200); - throw error DG DAT MSG out of expected sequence

Scanner have 200 dpi.
Your test application, which in source code, working fine. But my code crash.

What I do wrong???

Thx!
Sep 5, 2013 at 7:51 AM
Hello, NoNameManah.
See [discussion:448886]
Marked as answer by SARAFF on 6/23/2014 at 12:42 PM
Sep 24, 2013 at 8:56 PM
Thx, Saraff.
I have some another problems.
I'm using your project into my com library (c#). I was rebuilded Your project in VS2012 (dotNet 3.5 and CPU x86).
  1. The com-library is crashing when I try get supported resolutions. I think error into GetCap method. What can be wrong?
  2. The Com-library freez when any exception is throwing in your project. I'm trying wrap all critical sections into try/catch and fire event in cath-section, but it's not help.
Sep 25, 2013 at 4:44 PM
Hello, NoNameManah.
See the message of exception and the StackTrace. I want to also say that the public methods of the com library should contain exception handlers.
public void MyMethod(...){
    try{
        ... // <<< any code
    }catch(Exception){
    }
}
See patterns of exception handling.
Sep 25, 2013 at 9:21 PM
Hello, Saraff.
Thx. I'll try your answer.
But... What about getCap and supported resolutions?
Sep 26, 2013 at 9:14 AM
Hello, NoNameManah.
I repeat, see the exception message and stack trace to understand what the problem arises when calling Getcap and GetResolutions.
Sep 26, 2013 at 9:54 AM
Ooops ;)
Sorry.
Thx.