Subject: Error is Object doesn't support this property or method
I am trying to pass a C# string under Vs2005 (Net2) to an Vb6 ActiveX
Control.
I get the following runtime error--
"Object doesn't support this property or method"
Yet the Intellisense shows the following--
axMainViewJ1Obj 1.AddFileJ1(ref string str);
Also the project compiles without error.
The Vb6 method is--
Public Function AddFileJ1(FileN ame As String) As Boolean
Calling it from a test Vb6 Exe program works fine.
The actual code snippet in C# is--
string str=@"G:\Progra m FilesJ1\Iris\Da ta\Data\Example 1 - identified and
well separated.rst";
axMainViewJ1Obj 1.AddFileJ1(ref str);
Any suggestions would be appreciated.
--John Olbert
ja******@snet.n et
The full error information at runtime is--
System.NotSuppo rtedException was unhandled
Message="Object doesn't support this property or method"
Source="MainVie wJ1"
StackTrace:
at MainViewJ1._Mai nViewJ1Obj.AddF ileJ1(String& FileName)
at AxMainViewJ1.Ax MainViewJ1Obj.A ddFileJ1(String & fileName)
at Ce1.Form1.test1 aToolStripMenuI tem_Click(Objec t sender, EventArgs
e) in G:\Vx8\Vcs8J1\I nterop\MainView \Ce1\Form1.cs:l ine 41
at System.Windows. Forms.ToolStrip Item.RaiseEvent (Object key,
EventArgs e)
at System.Windows. Forms.ToolStrip MenuItem.OnClic k(EventArgs e)
at System.Windows. Forms.ToolStrip Item.HandleClic k(EventArgs e)
at System.Windows. Forms.ToolStrip Item.HandleMous eUp(MouseEventA rgs e)
at System.Windows. Forms.ToolStrip Item.FireEventI nteractive(Even tArgs
e, ToolStripItemEv entType met)
at System.Windows. Forms.ToolStrip Item.FireEvent( EventArgs e,
ToolStripItemEv entType met)
at System.Windows. Forms.ToolStrip .OnMouseUp(Mous eEventArgs mea)
at System.Windows. Forms.ToolStrip DropDown.OnMous eUp(MouseEventA rgs mea)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.ToolStrip .WndProc(Messag e& m)
at System.Windows. Forms.ToolStrip DropDown.WndPro c(Message& m)
at
System.Windows. Forms.Control.C ontrolNativeWin dow.OnMessage(M essage& m)
at System.Windows. Forms.Control.C ontrolNativeWin dow.WndProc(Mes sage& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)
at
System.Windows. Forms.Applicati on.ComponentMan ager.System.Win dows.Forms.Unsa feNativeMethods .IMsoComponentM anager.FPushMes sageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo pInner(Int32
reason, ApplicationCont ext context)
at
System.Windows. Forms.Applicati on.ThreadContex t.RunMessageLoo p(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
at Ce1.Program.Mai n() in
G:\Vx8\Vcs8J1\I nterop\MainView \Ce1\Program.cs :line 17
at System.AppDomai n.nExecuteAssem bly(Assembly assembly, String[] args)
at System.AppDomai n.ExecuteAssemb ly(String assemblyFile, Evidence
assemblySecurit y, String[] args)
at Microsoft.Visua lStudio.Hosting Process.HostPro c.RunUsersAssem bly()
at System.Threadin g.ThreadHelper. ThreadStart_Con text(Object state)
at System.Threadin g.ExecutionCont ext.Run(Executi onContext
executionContex t, ContextCallback callback, Object state)
at System.Threadin g.ThreadHelper. ThreadStart()