FrenkR
2nd November 2018, 17:16
hello,
according documentation, it is specified that variable, defined as "external" inside one dll (general library) is visible to all dll-s inside same process. After testing, I can't get "global" variable in one dll to be accessed in another dll.

Example is as follows(2 general library dll-s)

library.1:

external domain tcitem ext.item.1 | Global variable definition in first dll

function extern string fnc.1(){
return(ext.item.1)
}


library.2:

#pragma used dll olibrary.1

function extern string fnc.2(){
return(ext.item.1) | "usage" of global variable from first dll, compiler generates an error "Error: "ext.item.1" not declared"
}


looks like compiler doesn't "include" external symbols from library.1. Is there any special "convention" to define global(cross dll) variables?

Rgds, Frenk

Ajesh
2nd November 2018, 20:09
You need to declare the variable as extern in both the dlls.Only then can you access it.

FrenkR
21st November 2018, 02:43
thank you for an answer. Anyway, it is quite strange that extern functions are passed without declaration(s), but extern variables are not.

NPRao
26th November 2018, 19:53
Refer to -

Scope of variables across DLLs (http://www.baanboard.com/programmers_manual_baanerp_help_dynamic_link_libraries_scope_of_variables_across_dlls)

Declarations (http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_declarations)