Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get VFP OLE Server to use error procedure
Message
De
06/05/1998 11:39:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00097111
Message ID:
00097365
Vues:
25
>I'm not sure if it's even safe to launch MessageBox() from the server.

Really? Why?


>The server I'm working on hse to sit there 24x7 logging realtime data so it has to do all it can survive errors. I think you'll just have to seed conditional code around the parts that can error out to skip the rest of the processing. The Error method can set a nLastError property that could be tested after each line that can give you errors and conditionally return the error to the client. I don't really know of a way to rollback the entire callstack from inside the error method. There isn't really a MASTER to return to since you are just running the method the client requested. I've got code like this in my server.

I think you may be right here. It is unfortunate though. The last thing I want to do is test for an error every other line.

What I ended up doing was using 'try...except' handler in Delphi. Like this. It actually works pretty well.

try
      // Call the Method
      //
      s := oDataDll.GetARDataByDate(StartDate,EndDate);
    except  
      // Method was canceled
      //     
      on E: Exception do
      begin
        ShowMessage('An error occurred!');
        exit;
      end;
    end;


If the method in the server gets CANCELled, the 'on E' code fires and I probably can write some code that explains a bit more about what had happened.

This has been an experience. Thanks to all you guys for all your help.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform