Basically, when i use vb.net or c#.net to do this, it works perfectly, but when i use vb6, it doesn't work, in my for loop where the relevant service in the relevant device is captured, here is the code that returns no result...
' serv is properly declared and instantiated by the for loop.
Dim xins(0)
Dim xouts(0)
MsgBox ("Starting..." & serv.ServiceTypeIdentifier & vbCrLf & serv.id & vbCrLf & serv.LastTransportStatus) ' all this shows correctly.
serv.InvokeAction "GetExternalIPAddress", xins, xouts
MsgBox (xouts(0)) ' this should print the ExternalIP, but prints an empty string.
Basically, xouts(0) should contain the IP address, but it doesn't (is an empty string instead, no error or exception is raised).
all the other upnp.dll related stuff works, ie: retreiving devices list and getting the services in each device etc... no probs, just InvokeAction doesn't seem to be working on the service i am trying to use it on (which is of type "WANIPConnection:1"
in the device of type "WANConnectionDevice:1"
)...
here is the interface details for reference: http://msdn.microsoft.com/en-us/library/aa382237(VS.85).aspx
i tried to get the return value from InvokeAction (which is shown as the last argument in the interface declaration at the link i just provided, thats mainly for C/C++ users, in .NET and VB6, the last argument is the return value) and even couldn't get that to work, can provide code on how i did that if needed, but i'm happy to just run it straight out without looking for the return value, as that is just defined by this list here: http://msdn.microsoft.com/en-us/library/aa381160(v=VS.85).aspx and the actual data i'm looking for is supposed to be in xouts array, specifically xouts(0), does anyone have any leads on what this could be?
firewall issue maybe? i'm running in elevated mode and upnp is enabled on device (router).
Update: vie noticed that the action is actually being run/executed but the out argument array (or ByRef argument in VB) is not being updated with the data, which suggests markj comments about interop issues being a good lead.