Call from VB6 program to .NET assembly on network drive.

G

Guest

Hi!

We built VB6 application to work with Reporting Services server. To connect
to reporting server has been created a special assembly with .NET VS2003.
While we execute our program on local machine, every thing works. But when we
put the whole program on network drive, the VB6 program could not create
required object from .NET assembly.
Nothing we done were not useful to help to solve the problem.

Does anybody have idea?

Thanks!

Best regards.
Igor.
 
G

Guest

Michael,

Thanks for your response!

The assembly we created already has a strong name as required.
We also registered it with RegAsm utility.

We produced all steps as you offer, but stile have the same problem.
We have VB6 executable program and .NET Dll assembly.
But if we replace VB6 exe application with small .NET exe application, just
in case to test our assembly Dll, everything works fine.
Just like we have a problem to call only from VB6 executable to .NET Dll
assembly,
and no Security Policy change makes any different.

Of cause on local disk everything works fine.

Thanks!
Igor.
 
M

Michael Nemtsev

Hello Igor,

I> The assembly we created already has a strong name as required. We
I> also registered it with RegAsm utility.

to the network path?

I> We produced all steps as you offer, but stile have the same problem.
I> We have VB6 executable program and .NET Dll assembly.
I> But if we replace VB6 exe application with small .NET exe
I> application, just
I> in case to test our assembly Dll, everything works fine.
I> Just like we have a problem to call only from VB6 executable to .NET
I> Dll
I> assembly,

How do u call it, and what the error is?


I> "Michael Nemtsev" wrote:
I>---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Michael,

here is a .NET Dll assembly full code:
*********************************************************
using System;

namespace TextRSAccess
{
public class CTextRSAccess
{
public CTextRSAccess()
{
}
public int ValueData
{
get { return 3; }
set { int iValue = value;}
}
}
}
*********************************************************
It realy very simple, just for testing.
And here it is VB6 Command button click event function, that calls to this
..NER Dll.

*********************************************************
Private Sub Command1_Click()
Dim oRSccess As TextRSAccess.CTextRSAccess
Dim iValue As Integer

On Error Resume Next

Set oRSccess = New TextRSAccess.CTextRSAccess
If (Err <> 0) Then
MsgBox "Error: Set oRSccess = New TextRSAccess.CTextRSAccess"
Else
iValue = oRSccess.ValueData
If (Err <> 0) Then
MsgBox "Error: iValue = oRSccess.ValueData"
Else
MsgBox Format$(iValue)
End If
End If

End Sub
*********************************************************
The error occures on line: Set oRSccess = New TextRSAccess.CTextRSAccess

The error is:
Run-time error '430':
Class does not support Automation or does not support excepted interface.

Of cause, from local drive everything works fine.
We mapped network drive, but the same thing happens also without mapping.

No changes in Security policy makes any different.

What we are doing wrong?


Michael Nemtsev said:
Hello Igor,

I> The assembly we created already has a strong name as required. We
I> also registered it with RegAsm utility.

to the network path?

I> We produced all steps as you offer, but stile have the same problem.
I> We have VB6 executable program and .NET Dll assembly.
I> But if we replace VB6 exe application with small .NET exe
I> application, just
I> in case to test our assembly Dll, everything works fine.
I> Just like we have a problem to call only from VB6 executable to .NET
I> Dll
I> assembly,

How do u call it, and what the error is?


I> "Michael Nemtsev" wrote:
I>---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Ok, now it works!

It's really some strange behavior while both 1.1 and 2.0 frameworks
installed on the same machine.
Even the .NET Dll assembly created in VS2003 for framework 1.1, no changes
in Security policy of 1.1 applies to it. By if create full trust for this
assembly in 2.0 Security policy configurations, the program will run fine.
But on machine with only 1.1 frameworks installed the same changes in 1.1
Security policy configuration works well.

Thanks a lot!

Igor.


Igor said:
Michael,

here is a .NET Dll assembly full code:
*********************************************************
using System;

namespace TextRSAccess
{
public class CTextRSAccess
{
public CTextRSAccess()
{
}
public int ValueData
{
get { return 3; }
set { int iValue = value;}
}
}
}
*********************************************************
It realy very simple, just for testing.
And here it is VB6 Command button click event function, that calls to this
.NER Dll.

*********************************************************
Private Sub Command1_Click()
Dim oRSccess As TextRSAccess.CTextRSAccess
Dim iValue As Integer

On Error Resume Next

Set oRSccess = New TextRSAccess.CTextRSAccess
If (Err <> 0) Then
MsgBox "Error: Set oRSccess = New TextRSAccess.CTextRSAccess"
Else
iValue = oRSccess.ValueData
If (Err <> 0) Then
MsgBox "Error: iValue = oRSccess.ValueData"
Else
MsgBox Format$(iValue)
End If
End If

End Sub
*********************************************************
The error occures on line: Set oRSccess = New TextRSAccess.CTextRSAccess

The error is:
Run-time error '430':
Class does not support Automation or does not support excepted interface.

Of cause, from local drive everything works fine.
We mapped network drive, but the same thing happens also without mapping.

No changes in Security policy makes any different.

What we are doing wrong?


Michael Nemtsev said:
Hello Igor,

I> The assembly we created already has a strong name as required. We
I> also registered it with RegAsm utility.

to the network path?

I> We produced all steps as you offer, but stile have the same problem.
I> We have VB6 executable program and .NET Dll assembly.
I> But if we replace VB6 exe application with small .NET exe
I> application, just
I> in case to test our assembly Dll, everything works fine.
I> Just like we have a problem to call only from VB6 executable to .NET
I> Dll
I> assembly,

How do u call it, and what the error is?


I> "Michael Nemtsev" wrote:
I>
You need to have strong sighed assembly ant increase assembly trust
http://groups.google.com/group/microsoft.public.dotnet.vjsharp/browse
_thread/thread/996b37a9a9205fd9/b3264d3d9af9ee92

For other details look through there
http://groups.google.com/groups/search?ie=UTF-8&oe=UTF-8&q=network+as
sembly+trust+level

-- WBR, Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche

:

Hi!

We built VB6 application to work with Reporting Services server. To
connect
to reporting server has been created a special assembly with .NET
VS2003.
While we execute our program on local machine, every thing works.
But when we
put the whole program on network drive, the VB6 program could not
create
required object from .NET assembly.
Nothing we done were not useful to help to solve the problem.
Does anybody have idea?

Thanks!

Best regards.
Igor.
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

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