[progress Communities] [progress Openedge Abl] Forum Post: Re: .net Form Once Worked, Next...

Status
Not open for further replies.
M

Mike Fechner

Guest
The usual WAIT-FOR challenge J One-world-one-wait-for. Still valid. So whatever is the first WAIT-FOR in your application (typically in the first .w run) more start a .NET WAIT-FOR: ON CLOSE OF {&WINDOW-NAME}: System.Windows.Forms.Application:Exit() . END. WAIT-FOR System.Windows.Forms.Application:Run() . // no form reference. And in your procedure MuestraAvance, you just call oForm:Show() . instead of the WAIT-FOR Von: OctavioOlguin [mailto:bounce-OctavioOlguin@community.progress.com] Gesendet: Dienstag, 20. September 2016 01:32 An: TU.OE.General@community.progress.com Betreff: [Technical Users - OE General] .NET form once worked, next time it won't.... Update from Progress Community OctavioOlguin Help.. as I'm really lost.... Had an abl window that called a .net class, next time I recompilled, It won't run... reverted to stored versions, but to no avail... Calling program makes this: USING Procs.Ven.ven06100 FROM PROPATH. .... PROCEDURE MuestraAvance : DEFINE INPUT PARAMETER pVendedor AS INTEGER NO-UNDO. DEFINE INPUT PARAMETER pNumVenta AS INTEGER NO-UNDO. DEFINE VARIABLE oForm AS procs.ven.ven06100 NO-UNDO . oForm = NEW procs.ven.ven06100(pVendedor, pNumVenta) . WAIT-FOR System.Windows.Forms.Application:Run (oForm) . CATCH err AS Progress.Lang.Error: MESSAGE err:GetMessage (1) VIEW-AS ALERT-BOX . END CATCH. END PROCEDURE. On called Class, got this... USING Progress.Windows.Form. USING system.Drawing.*. BLOCK-LEVEL ON ERROR UNDO, THROW. CLASS Procs.Ven.ven06100 INHERITS Form : DEFINE PRIVATE VARIABLE components AS System.ComponentModel.IContainer NO-UNDO. DEFINE PRIVATE VARIABLE buttonOk AS System.Windows.Forms.Button NO-UNDO. DEFINE PRIVATE VARIABLE fNombreEmpleado AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE fTickets AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE LabelKilos AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE LAbelTicket AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE LAvance AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE LNumeroTickets AS System.Windows.Forms.Label NO-UNDO. DEFINE PRIVATE VARIABLE progressBar1 AS System.Windows.Forms.ProgressBar NO-UNDO. DEFINE PRIVATE VARIABLE textBox1 AS System.Windows.Forms.TextBox NO-UNDO. DEFINE PRIVATE VARIABLE textKilos AS System.Windows.Forms.TextBox NO-UNDO. CONSTRUCTOR PUBLIC ven06100( xVendedor AS INTEGER, xVenta AS INTEGER): SUPER(). InitializeComponent ( ). CargaDatos(xVenta, xVendedor). CATCH e AS Progress.Lang.Error: UNDO, THROW e. END CATCH. END CONSTRUCTOR. DESTRUCTOR PUBLIC ven06100( ): IF VALID-OBJECT(components) THEN DO: CAST(components, System.IDisposable):Dispose(). END. END DESTRUCTOR. METHOD PROTECTED VOID CargaDatos (INPUT pVenta AS INTEGER, INPUT pVendedor AS INTEGER): DEFINE VARIABLE ValMax AS CHARACTER NO-UNDO. RUN func\GetCFG.p("Meta de Ventas", "", "", OUTPUT ValMax). IF ValMax = "" THEN DO: RUN func\SetCFG.P("Meta de Ventas", "", "", 1, 250). ValMax = "250". END. FIND Ticket NO-LOCK WHERE Ticket.Ticket = pVenta NO-ERROR. FIND VendedorDia NO-LOCK WHERE VendedorDia.Fecha = TODAY AND VendedorDia.Nomina = pVendedor NO-ERROR. IF NOT AVAILABLE VendedorDia THEN RETURN. // primer venta del dia. no hay registro hasta que se cobra. FIND Empleado NO-LOCK WHERE Empleado.Nomina = pVendedor. FNombreEmpleado:text = Empleado.Nombre. textBox1:text = STRING(pVenta). lAvance:TEXT = "Meta de Venta". fTickets:text = STRING(VendedorDia.Tickets). progressBar1:MAXIMUM = max(INTEGER(ValMax), VendedorDia.Cantidad). progressBar1:value = VendedorDia.Cantidad. textKilos:TEXT = STRING(VendedorDia.Cantidad). /* IF INTEGER(ValMax) MuestraAvance Procs\Ven\Ven06034.w at line 4642 (c:\tap\Procs\Ven\Ven06034.r) [16/09/19@18:08:42.129-0500] P-052536 T-047760 1 4GL -- USER-INTERFACE-TRIGGER Procs\Ven\Ven06034.w at line 2671 (c:\tap\Procs\Ven\Ven06034.r) (Searched message and it is: System.InvalidOperationException: Starting a second message loop on a single thread is not valid operation. Use Form.ShowDialog instead. You cannot WAIT-FOR a Progress built-in event once any .NET forms are made visible. Use WAIT-FOR Application:Run(form) or WAIT-FOR formx:ShowDialog() instead. (13967) I'm really confused... can anybody see why happened this? TIA Jorge Olguin View online You received this notification because you subscribed to the forum. To stop receiving updates from only this thread, go here . Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Top