PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → 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
Débuté par J. Flietstra, 25 sep. 2004 12:24 - 4 réponses
Posté le 25 septembre 2004 - 12:24
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.
Posté le 25 septembre 2004 - 15:46
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
Posté le 25 septembre 2004 - 17:42
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.
--------------------------------
Posté le 26 septembre 2004 - 21:27
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
Posté le 26 septembre 2004 - 21:51
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