Import functions into a MQL library FROM the expert, script or indicator

 
Hi there,

Question regarding #import

Lets say I have an expert called myexpert.mq4 that has the following function definition...


///// Code for myexpert.ex4 expert

#import "mylib.ex4"
#import

int AppFunc() {
// Do some stuff
return (0);
}

Notice that the "myexpert" expert imports a library called "mylib.ex4". In the "mylib" source I want to code something like....


//// Code for mylib.ex4 library

int init() {

/// Do initialization stuff for mylib....

/// Call the AppFunc function defined in the expert that imports this library
AppFunc();

}

AppFunc() is of course defined in the myexpert.mq4.

Within the code of the library "mylib" how could I use the #import function to tell the compiler that AppFunc() is actually defined in the ex4 file that will be importing "mylib.ex4". In effect I want the "mylib" library to make a call to the AppFunc() function that is defined in "myexpert".

Regards,

Laurence.