Will this fix my problem

Aug 2, 2010 at 5:56 PM

I have discovered an issue when a .NET class is exposed to com and assesed using VBScript - in short the following is the issue (VbScript code)

Dim Its
Dim Application
Set Application = CreateObject("dotNetCode.ApplicationClass")
Set Its = Application.Items
MsgBox Its(1).name
'The Following also works
MsgBox Application.Items.Item(1).Name
'And so does
MsgBox Application.Items()(1).Name
'But this does not work
MsgBox Application.Items(1).Name

More information on the exact issue can be found here - http://social.msdn.microsoft.com/Forums/en-US/vbinterop/thread/4b68da54-1e24-4461-b6c1-ceb16978eed4

I believe that the implementation of iDispatch::Invoke is not entirely correct within .NET and does not follow all the rules that say VB6 followed - does this project provide the possibility to change the behavior of iDispatch::Invoke to fix this issue???

The specific rules that need to be followed are:

The rule for implementers of IDispatch::Invoke is if all of the following are true:
•the caller invokes a property
•the caller passes an argument list
•the property does not actually take an argument list
•that property returns an object
•that object has a default property
•that default property takes an argument list
then invoke the default property with the argument list.

Thanks very much for your help.