Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Debugging DLL
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Debugging DLL
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01125286
Message ID:
01125286
Views:
54
Hi everybody,

I've created a very simple DLL with this program:
Define Class DataRetriever As line OlePublic 
procedure Init
set talk off
set deleted on
set exclusive off
set notify off
set safety off
endproc

Procedure Get_EmployeesQueueData(tcDatabase as String, ;
		tdDate as Date, tcAlias as String) As String
Local lcXML As String
lcXML = ""
open database (m.tcDatabase) shared
set database to (m.tcDatabase) 
external procedure GetEmployeesQueuesInfo

=GetEmployeesQueuesInfo(m.tdDate, m.tcAlias)
=strtofile('Run SP', 'myLog.txt',1)
if used(m.tcAlias)
	cursortoxml(m.tcAlias, 'lcXML', 0, 0)
	=strtofile('Produced XML', 'myLog.txt',1)
endif
	
Return m.lcXML
endproc

Procedure Get_EmployeeQueueData(tcDatabase as String, ;
	tcUsGrLink_fk as String, ;
	tcQueue_Names_fk as String, tTimeStart, ;
	tTimeEnd, tlPrimary, tcAlias as String, tlNoData) As String
Local lcXML As String

open database (m.tcDatabase) shared
external procedure GetEmployeeQueues
=GetEmployeeQueues(m.tcUsGrLink_fk, ;
		m.tcQueue_Names_fk, ;
		m.tTimeStart, ;
		m.tTimeEnd, ;
		m.tlPrimary, ;
		m.tcAlias, m.tlNoData)
cursortoxml(m.tcAlias, 'lcXML', 0, 0)
Return m.lcXML
endproc

Enddefine
Now I'm trying this class as
o = createobject('DataRetriever.DataRetriever')
?o.Get_EmployeesQueueData("t:\it_testing\data\mmviscollect.dbc",date(),'cTest')
And it gives me an error 11. However, if I just create a procedure as a regular program, it works just fine. I'm probably missing something simple. Do you know, what should I do to make it work?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform