Why do equal strings sometimes behave differently? (VB.NET COM interface)
Example:
Dim Sh32 As Object = CreateObject("Shell.Application")
Dim path As String = "C:\temp\catalog.zip"
Dim sf As Object = Sh32.NameSpace(path)
-> does not work, sf = Nothing
Dim Sh32 As Object = CreateObject("Shell.Application")
Dim path As String = "C:\temp\catalog.zip"
Dim sf As Object = Sh32.NameSpace(path.T开发者_开发技巧oString)
-> works
Any idea?
Clearly path = path.ToString, but they behave differently when used as COM parameters.
Hmm, I don't know the details of VB and/or COM well enough, but maybe there is a difference between a string object and a string representation?
Should be interesting to see someone "in the know" resolving the puzzle ;)
精彩评论