wavecas.blogg.se

Function in visual basic
Function in visual basic








function in visual basic

HRESULT ServiceTypeIdentifier( BSTR* pVal) and when I loop through this aryOuts array, the items 0 and 1 are printed out and viewed perfectly (without problems) but on the 3rd item (aryOuts(2)) I get the above exception.īasically, the first 2 arguments are just simple strings (no problem accessing these) but the 3rd argument is defined by the UPnP people as an Unsigned 4 Byte Integer (and this is where the problem lays), VB6 is unable to interpret this datatype and is not letting me access this array item (aryOuts(2)), and I could not figure out what part of the TypeLib I need to modify, since the definition for InvokeAction aryOuts is just stated as a VARIANT* in the TypeLib, and here is the relevant part of the TypeLib for your view (I've included the area I understand to be relevant, if you would like additional areas posted, let me know and I can do this): [ So aryOuts ends up as an array with items from index 0 to 2 (3 items total). I don't need to define any items for aryIns since this call doesn't require or need any input arguments, but it provided (returns) 3 items (results) and puts them in aryOuts. Re the point I'm getting the error, I am using (for sActionName) "GetStatusInfo" on a "WanIPConnection" under the "WAN Connection Device".

function in visual basic

The good thing is, InvokeAction turns my general Variant into a properly dimensioned array reflecting the number of output items that are returned for the ActionName I'm using. InvokeAction sActionName, aryIns, aryOuts where aryIns and aryOuts are Variants declared like this: Dim aryIns As Variant, aryIns As Variant - basically, I declare it generally, put any input data I need inside aryIns and I will get aryOuts with the results of the InvokeAction call. (for your information, upnp.dll is contained in windows\system32 and oleview.exe comes with the Windows SDK Toolkit if you do not already have it on your machine). Now, I need to solve the same problem but for a different function/variable, but the problem is, I have no idea which variable datatype I need to change or remove when I'm in oleview's TypeLib view of upnp.dll.įor completeness, I'll let you know where this error is occuring, and then I will show you the relevant part of the oleview/TypeLib view that I am having trouble modifying. Previously, this same error occured but on a different function/variable, and the resolution was to open up upnp.dll in oleview.exe (to view Type Library Information) and to replace all occurences of "Unsigned Long" with just "Long" and then compile a new TypeLib with the "Unsigned" keywords removed, this solved the problem for that senario. Basically, I'm getting this error when I try to call a function inside the upnp.dll using VB6, where upnp.dll is returning a datatype that is not supported by VB6.










Function in visual basic