PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → How to call a global procedure in a included componen from the EVENT() statement
How to call a global procedure in a included componen from the EVENT() statement
Iniciado por J. Flietstra, set., 25 2004 12:24 PM - 4 respostas
Publicado em setembro, 25 2004 - 12:24 PM
How can i call a global procedure in a included component.
I want the following
EVENT("ProcedureName","*.",WM_ACTIVATE)
The ProcedureName is create in a component that i have created and is global.
On the Globalprocedures i can see my component global procedure.
At runtime i got the error that the ProcedureName is not found.
Publicado em setembro, 25 2004 - 3:46 PM
G'day Jonathan
I have not used components but would assume from reading about them that because they are designed to be a stand alone item that can be distributed without reference to any other windev app, that all procedues must be included within the component.
The windev help for components :
"A component is defined and managed from an existing WinDev project. It can then be integrated into other WinDev projects.
All the elements of the component are totally independent from the project in which the component is integrated. The component may have its own analysis, its windows, its reports, its files, etc. When generating the component, simply specify if these elements will be made available or not to WinDev project that integrates this component. "
Regards
Al
Publicado em setembro, 25 2004 - 5:42 PM
G'day Jonathan
I have not used components but would assume from reading about them that because they are designed to be a stand alone item that can be distributed without reference to any other windev app, that all procedues must be included within the component.
The windev help for components :
"A component is defined and managed from an existing WinDev project. It can then be integrated into other WinDev projects.
All the elements of the component are totally independent from the project in which the component is integrated. The component may have its own analysis, its windows, its reports, its files, etc. When generating the component, simply specify if these elements will be made available or not to WinDev project that integrates this component. "
Regards
Al

That's what i have done... but the event generates a error
------------------------------
Event function called.
MyProcedure procedure unknown.
--------------------------------
Publicado em setembro, 26 2004 - 9:27 PM
Hi,
the only way to call a project procedure from a component is ExecuteProcess(blabla, trtProjectProcedure). Your question looks like you want to do the opposite. My first idea to do this, is to place the Event-Code in a global procedure of the component. This should make sure that the procedure will be found.
HTH
Raimund

How can i call a global procedure in a included component.
I want the following
EVENT("ProcedureName","*.",WM_ACTIVATE)
The ProcedureName is create in a component that i have created and is global.
On the Globalprocedures i can see my component global procedure.
At runtime i got the error that the ProcedureName is not found.



http://www.invitec.com
Publicado em setembro, 26 2004 - 9:51 PM
Hi,
you have to full qualify the name of your event procedure to prevent the error message:
Event("TestCompEvent.GlobProc.TestEvent", "*.*", WM_CHAR)
TestCompEvent is the name of the component, and GlobProc the name of the global procedure set. Unfortunately, does this only prevent the error but it doesn't work. I assume that sub classing from project to component doesn't word, however the way to have a global procedure in the component which contains the Event declaration code does work.
Regards
Raimund
How can i call a global procedure in a included component.
I want the following
EVENT("ProcedureName","*.",WM_ACTIVATE)
The ProcedureName is create in a component that i have created and is global.
On the Globalprocedures i can see my component global procedure.
At runtime i got the error that the ProcedureName is not found.



http://www.invitec.com