Error is Object doesn't support this property or method

G

Guest

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--
axMainViewJ1Obj1.AddFileJ1(ref string str);

Also the project compiles without error.

The Vb6 method is--
Public Function AddFileJ1(FileName As String) As Boolean

Calling it from a test Vb6 Exe program works fine.

The actual code snippet in C# is--
string str=@"G:\Program FilesJ1\Iris\Data\Data\Example 1 - identified and
well separated.rst";
axMainViewJ1Obj1.AddFileJ1(ref str);

Any suggestions would be appreciated.

--John Olbert
(e-mail address removed)


The full error information at runtime is--
System.NotSupportedException was unhandled
Message="Object doesn't support this property or method"
Source="MainViewJ1"
StackTrace:
at MainViewJ1._MainViewJ1Obj.AddFileJ1(String& FileName)
at AxMainViewJ1.AxMainViewJ1Obj.AddFileJ1(String& fileName)
at Ce1.Form1.test1aToolStripMenuItem_Click(Object sender, EventArgs
e) in G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Form1.cs:line 41
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,
EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs
e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,
ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Ce1.Program.Main() in
G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
 
C

Cor Ligthert [MVP]

John,

If you would not get your answer here, I would ask this in the newsgroup
microsoft.public.dotnet.languages.vb

There are more people who did formely use VB6 and which are more familair
with your problem.
(There are in this newsgroup as well some people active who knows that
before you understand me wrong).

The method you get will be almost the same in C# as in VB.Net

Better is not to tell that it is for C# because it is a VB.Net newsgroup.

Cor

John Olbert said:
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--
axMainViewJ1Obj1.AddFileJ1(ref string str);

Also the project compiles without error.

The Vb6 method is--
Public Function AddFileJ1(FileName As String) As Boolean

Calling it from a test Vb6 Exe program works fine.

The actual code snippet in C# is--
string str=@"G:\Program FilesJ1\Iris\Data\Data\Example 1 - identified and
well separated.rst";
axMainViewJ1Obj1.AddFileJ1(ref str);

Any suggestions would be appreciated.

--John Olbert
(e-mail address removed)


The full error information at runtime is--
System.NotSupportedException was unhandled
Message="Object doesn't support this property or method"
Source="MainViewJ1"
StackTrace:
at MainViewJ1._MainViewJ1Obj.AddFileJ1(String& FileName)
at AxMainViewJ1.AxMainViewJ1Obj.AddFileJ1(String& fileName)
at Ce1.Form1.test1aToolStripMenuItem_Click(Object sender, EventArgs
e) in G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Form1.cs:line 41
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,
EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs
e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs
e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,
ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs
mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Ce1.Program.Main() in
G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
 
W

Willy Denoyette [MVP]

| 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--
| axMainViewJ1Obj1.AddFileJ1(ref string str);
|
| Also the project compiles without error.
|
| The Vb6 method is--
| Public Function AddFileJ1(FileName As String) As Boolean
|
| Calling it from a test Vb6 Exe program works fine.
|
| The actual code snippet in C# is--
| string str=@"G:\Program FilesJ1\Iris\Data\Data\Example 1 - identified and
| well separated.rst";
| axMainViewJ1Obj1.AddFileJ1(ref str);
|
| Any suggestions would be appreciated.
|
| --John Olbert
| (e-mail address removed)
|
|
| The full error information at runtime is--
| System.NotSupportedException was unhandled
| Message="Object doesn't support this property or method"
| Source="MainViewJ1"
| StackTrace:
| at MainViewJ1._MainViewJ1Obj.AddFileJ1(String& FileName)
| at AxMainViewJ1.AxMainViewJ1Obj.AddFileJ1(String& fileName)
| at Ce1.Form1.test1aToolStripMenuItem_Click(Object sender, EventArgs
| e) in G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Form1.cs:line 41
| at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,
| EventArgs e)
| at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
| at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
| at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs
e)
| at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs
| e, ToolStripItemEventType met)
| at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,
| ToolStripItemEventType met)
| at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
| at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs
mea)
| at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
| button, Int32 clicks)
| at System.Windows.Forms.Control.WndProc(Message& m)
| at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
| at System.Windows.Forms.ToolStrip.WndProc(Message& m)
| at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
| at
| System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
| at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
| at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
| Int32 msg, IntPtr wparam, IntPtr lparam)
| at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
| at
|
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
| dwComponentID, Int32 reason, Int32 pvLoopData)
| at
| System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
| reason, ApplicationContext context)
| at
| System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason,
| ApplicationContext context)
| at System.Windows.Forms.Application.Run(Form mainForm)
| at Ce1.Program.Main() in
| G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Program.cs:line 17
| at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
| at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
| assemblySecurity, String[] args)
| at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
| at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
| at System.Threading.ExecutionContext.Run(ExecutionContext
| executionContext, ContextCallback callback, Object state)
| at System.Threading.ThreadHelper.ThreadStart()
|
|
|

axMainViewJ1Obj1.AddFileJ1(str);


Willy.
 
G

Guest

I did try it without the "ref" and it would not compile. It requires the "ref".

Thanks.
--
John Olbert



Willy Denoyette said:
| 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--
| axMainViewJ1Obj1.AddFileJ1(ref string str);
|
| Also the project compiles without error.
|
| The Vb6 method is--
| Public Function AddFileJ1(FileName As String) As Boolean
|
| Calling it from a test Vb6 Exe program works fine.
|
| The actual code snippet in C# is--
| string str=@"G:\Program FilesJ1\Iris\Data\Data\Example 1 - identified and
| well separated.rst";
| axMainViewJ1Obj1.AddFileJ1(ref str);
|
| Any suggestions would be appreciated.
|
| --John Olbert
| (e-mail address removed)
|
|
| The full error information at runtime is--
| System.NotSupportedException was unhandled
| Message="Object doesn't support this property or method"
| Source="MainViewJ1"
| StackTrace:
| at MainViewJ1._MainViewJ1Obj.AddFileJ1(String& FileName)
| at AxMainViewJ1.AxMainViewJ1Obj.AddFileJ1(String& fileName)
| at Ce1.Form1.test1aToolStripMenuItem_Click(Object sender, EventArgs
| e) in G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Form1.cs:line 41
| at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,
| EventArgs e)
| at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
| at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
| at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs
e)
| at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs
| e, ToolStripItemEventType met)
| at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,
| ToolStripItemEventType met)
| at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
| at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs
mea)
| at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
| button, Int32 clicks)
| at System.Windows.Forms.Control.WndProc(Message& m)
| at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
| at System.Windows.Forms.ToolStrip.WndProc(Message& m)
| at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
| at
| System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
| at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&
m)
| at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
| Int32 msg, IntPtr wparam, IntPtr lparam)
| at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
| at
|
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
| dwComponentID, Int32 reason, Int32 pvLoopData)
| at
| System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
| reason, ApplicationContext context)
| at
| System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason,
| ApplicationContext context)
| at System.Windows.Forms.Application.Run(Form mainForm)
| at Ce1.Program.Main() in
| G:\Vx8\Vcs8J1\Interop\MainView\Ce1\Program.cs:line 17
| at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]
args)
| at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
| assemblySecurity, String[] args)
| at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
| at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
| at System.Threading.ExecutionContext.Run(ExecutionContext
| executionContext, ContextCallback callback, Object state)
| at System.Threading.ThreadHelper.ThreadStart()
|
|
|

axMainViewJ1Obj1.AddFileJ1(str);


Willy.
 
W

Willy Denoyette [MVP]

|I did try it without the "ref" and it would not compile. It requires the
"ref".
|
| Thanks.
| --
| John Olbert
|

Right, ByRef is defaulut in VB6.

(ref somestring);

should work. Try to remove the referenced axcontrol from VS unregister the
ocx and reregister before adding the reference back.

Willy.
 
G

Guest

Thanks for your reply.
I tried that but it did not solve the problem.

I then removed all parameters from the Method to be called from C# (i.e., I
embedded a file name on the Vb6 side, tested on the Vb6 side and it worked).
Even without arguments I get the same error.

The processing inside the Vb6 control takes a few seconds and there is such
a delay when the C# Method is called on the wrapper class before the error is
returned so something is happening inside the control.

This particular Vb6 control uses a number of supporting Vb6 controls some of
which have licenses (which have been installed). I am assuming that if the
control is called successfully from Vb6 (same computer) that everything
should be in its proper place (COM objects registered, etc). So this whole
thing remains a mystery.

In searching the Web I found that the exact wording does occur associated
with just Vb6 App's so it may be not a C# Interop issue but a Vb6 issue YET
it works from the Vb6 side.

I have tried to post this question on the .NET Vb side but the Newsgroup
seems blocked at this point.

Any suggestions would be appreciated.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top