Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 30th October 2008, 09:41
Angelika_N Angelika_N is offline
Junior Member
 
Join Date: Oct 2008
Posts: 4
Angelika_N is on a distinguished road
Baan: 4.0 - DB: informix - OS: windows xp
Question How to use two DLL with identical global variables?
Baan: Other/Unknown
C/S: None/Unknown

I want to use two DLL in one script. In both DLL there are variables with identical names (extern), for example 'r.mess'.
I receive a mistake at loading of the second DLL:
Error: Load DLL: Incompatible array subscripts in link external 'r.mess'
Error: Load DLL: Subscripts 1, source 150, external 100
Fatal error: Dynamic Link failure external symbol 'r.mess' in DLL object 'odll_1'
Fatal error: Can not continue in script_1 (function_1)

Is it possible to use these DLL together?
Reply With Quote
  #2  
Old 30th October 2008, 09:43
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,490
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
Hi,

You might want to check the Function overloading. Here are the available functions:
http://www.baanboard.com/programmers...w_and_synopsis

- George
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
Sponsored Links
  #3  
Old 30th October 2008, 11:49
Angelika_N Angelika_N is offline
Junior Member
 
Join Date: Oct 2008
Posts: 4
Angelika_N is on a distinguished road
Baan: 4.0 - DB: informix - OS: windows xp
I already use these functions for dynamic loading DLL (load_dll, get_function, exec_function).
I load the first DLL and I start its function.
Then I load the second library and I receive a error (global variables have identical names in different DLL)
It is possible to unload the first library?
Reply With Quote
  #4  
Old 30th October 2008, 12:50
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,490
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
I am not sure! I will check it...

try this workaround create a script, that uses the other DLL and call the function, then exports the wanted value. In your original script, import it.

- George
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
  #5  
Old 30th October 2008, 13:45
Angelika_N Angelika_N is offline
Junior Member
 
Join Date: Oct 2008
Posts: 4
Angelika_N is on a distinguished road
Baan: 4.0 - DB: informix - OS: windows xp
I tried to create intermediate script and DLL.
It is impossible.
Reply With Quote
  #6  
Old 30th October 2008, 13:59
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,490
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
What are the DLLs that you are using? I would like to test it here.
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
  #7  
Old 30th October 2008, 14:46
Angelika_N Angelika_N is offline
Junior Member
 
Join Date: Oct 2008
Posts: 4
Angelika_N is on a distinguished road
Baan: 4.0 - DB: informix - OS: windows xp
It not standard libraries.
In the first DLL there is a variable r.mess (it is declared as global, extern)
In the second DLL there is a same variable.

I run function get.item () the first DLL.
Then I run function get.clot () the second DLL.
The variable r.mess is not used anywhere
Reply With Quote
  #8  
Old 31st October 2008, 09:03
ARijke ARijke is offline
Guru
 
Join Date: Sep 2005
Posts: 455
ARijke is on a distinguished road
Baan: Baan IV upto LN - DB: -- - OS: --
The external variables should be unique. So one of those has to be renamed.
Reply With Quote
  #9  
Old 5th November 2008, 10:58
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 570
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Normally, the best coding style is to use unique names for external variables and functions (simply by using the dll name as prefix). This could also be done by using the preprocessor if you had to replace the entire dll code just because of renaming a variable.
And folks: Don't change anything of the interface of a dll; add new features - otherwise you will get errors on your live system! So, If you have to change too much, copy the dll and use the new one until you are sure that no other session depends on the old variables / functions!

In your case, I would suggest to check which dll has r.mess with 100 chars, and then to extend it to 150 chars. Then the problem should be solved (for the moment).

Günther
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Baan Project Manager / Solutions Analyst s.ashenden Jobs and Resumes 0 9th May 2006 10:33
xml question steveauckly Tools Development 4 27th July 2004 10:41
Passing Record Buffer to a DLL shaboo Tools Development 3 14th July 2004 10:30


All times are GMT +2. The time now is 05:26.


©2001-2017 - Baanboard.com - Baanforums.com