Syntax Error; End Function;

Hello!

I imported an ActiveX component to be able to instantiate a XMLHTTP OleObject (MSXML2).
With OleObject itself I had no success handling events.

When I try to compile everything I get error message:
Syntax error End Function

The error shows up in a Delegates declaration section.
Example:
validateNode_Func2(this As Ptr, node_Param As Ptr, ByRef errorObj_Param As Ptr) As Integer

Not in all functions but in about twenty.

How can I change or correct the code generated by Xojo?

I have this code

[code]dim URL as String
dim XML as MSXML2.XMLHTTP60

URL = “http://…REST.asp?P={%22Method%22:%22Name%22,%20%22Nr%22:12345}”

XML = new MSXML2.XMLHTTP60

if XML<>Nil then
AddHandler XML.onreadystatechange, onReadyStateChangeXmlHttpRequest

XML.open(GET, URL)

XML.send()
end if[/code]

Thanks a lot!

Regards

O.k. this is a general problem when importing ActiveX.
All tests I did result in that error.

I have seen that some methods generated have “this” as first parameter name.
I know this as somewhat special from JavaScript so I decided to rename those declarations.

from

Delegate setRequestHeader_Func2(this As Ptr, bstrHeader_Param As Ptr, bstrValue_Param As Ptr) As Integer

to

Delegate setRequestHeader_Func2(P As Ptr, bstrHeader_Param As Ptr, bstrValue_Param As Ptr) As Integer

Seems to change something but I don’t really know if first error is randomly shown up in IDE…

Hello Eli,

o.k.:
Delegate Name:

open_Func8

Parameters:

P As Ptr, pwszMethod_Param As WString, pwszUrl_Param As WString, pStatusCallback_Param As Ptr, pwszUserName_Param As WString, pwszPassword_Param As WString, pwszProxyUserName_Param As WString, pwszProxyPassword_Param As WString, OutVal_Param As Integer

Return Type:

For me it looks like a general problem with ActiveX import. As some other ActiveX all have the same problem.

I know that internally “sub end sub” and “function end function” are used; but this error comes up when ActiveX importer creates delegates.
Of course error changes between “… end sub” and “… end function” if delegate has return value or not.

Public Function validateNode_Func2(this As Ptr, node_Param As Ptr, ByRef errorObj_Param As Ptr) as Integer