To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=43536 Issue #:|43536 Summary:|DLL functions declared are only valid in the same |module Component:|api Version:|OOo 1.1.4 Platform:|PC URL:| OS/Version:|Windows 2000 Status:|UNCONFIRMED Status whiteboard:| Keywords:| Resolution:| Issue type:|DEFECT Priority:|P3 Subcomponent:|code Assigned to:|sw Reported by:|audirac
------- Additional comments from [EMAIL PROTECTED] Fri Feb 25 03:24:53 -0800 2005 ------- Hello, First of all, I refered by bug to the OO.o version 1.1.2, whereas it is the 1.1.4, but unfortunately the 1.1.4 is not available in the list ! When a DLL function is defined with "Declare", it is only usable in the same module. Calling it from other modules leads to an error "Undefined variable". To make it available in other modules, a workaround it to wrap the declared function in another "Sub" or "Function" in the same module. The new Sub or Function name is then available in other modules. ------------ First basic program in one module, which works: Option Explicit Declare Function VeeInitDll Lib "VeeGenApi.dll" () As Integer Sub Main Call VeeInitDll() End Sub ------------ The same program altered to have the DLL function declared in another module (it does not work, why ?) : Module1: Option Explicit Declare Function VeeInitDll Lib "VeeGenApi.dll" () As Integer Module2: Option Explicit Sub Main Call VeeInitDll() End Sub An error "Undefined variable" rises at the "Call VeeInitDll()" line. ------------ Workaround to the bug (?) by wrapping the DLL function : Module1: Option Explicit Declare Function VeeInitDll Lib "VeeGenApi.dll" () As Integer Function oo_VeeInitDll() As Integer oo_VeeInitDll = VeeInitDll() End Function Module2: Option Explicit Sub Main Call oo_VeeInitDll() End Sub ***** If it is not a bug the on-line help is unsufficient. Best regards. Guillaume Audirac --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]