Re: VB6 executable accessing a .Net DLL with ComClass



On Apr 1, 10:50 am, drrev...@xxxxxxxxx wrote:
On Mar 17, 8:27 am, TDC <NOtcarvinS...@xxxxxxxxx> wrote:





Your VB6 app is going to want to use the registry by default, so you
will need to pick a single, unchanging location for the .NET dll and
use RegAsm with the /codebase option...this is conceptually just like
regsvr32 in that it records the exact location of the dll.

The /codebase option is considered fragile for cases where multiple
different applications share the same dll (you make a change in the
dll for App A but you have then also effected App B).  Again, this is
just like COM registration behavior with regsvr32.

The VB6 dev environment wants a type-library, which can be created via
RegAsm or TlbExp.

And finally, its best to explicitly decorate the objects you are
exposing to VB6 with the appropriate attributes and interfaces, though
that is not strictly required.

On Mar 15, 11:30 am, drrev...@xxxxxxxxx wrote:

I have a VB6 desktop application that I do not want to re-write.  I
have a new feature that I need to add so I created a VB.net ComClass
DLL.  I tested it using another VB.net program and everything works
fine.  When I test it using the VB 6 program, it allows me to set a
reference to it and I do get the intellisense to set the properties
and access the methods.  I declare it and use a Set an object as new
before using it.    If I do not use the Set I get an Object Variable
not set.  If I do the set, I get Run time error -'2146233078
(8013150a) Automation error.

I initially registered it using RegAsm but after that everytime I
would build, the changes were being picked up in both the.net and the
vb6 program. I did not create a Strongly Typed Assembly. That is so
confusing to me.I got my app to work one time with the key but when
I made a change to the app, I couldn't get it to work anymore.

The VB6 application and the .Net DLL will reside on the network for
mulitple users.

The DLL currently does not reside in the same folder as the VB6
program so I will try that next.- Hide quoted text -

- Show quoted text -

I got it to work on my PC and on another person PC but we both have
Visual Studio installed on our PC.  When I left one of my users try it
out, it registered fine but it fails for them because it is not
registering the class that I am using.  It is defaulting to the first
class in that DLL.  For some reason on my PC and another programmer's
PC, it registers the right Class.  Why is not registering all the
classess and how do I default it to register the class that I am
using.

When I look in the registry under the InprocServer32 section, the
Default, Assembly, Codebase, runtimeVersion and Threading Model
matches.  the Class entry is different.

How do I explicitly decorate the objects I am exposing to VB6.  There
are 3 objects in that DLL but I only need one of them exposed to VB6
and for the users, that is not happening.- Hide quoted text -

- Show quoted text -


I figured out how to get it to register the right class but now I am
getting an -2147024894 - Automation Error. The system cannot find the
file specified.

This error only happens on PCs that does not have Visual Studio 2005
installed which is all my users. When I look in their registry, it is
registered just like it is on my PC. This is happening on the Set obj
= new object.class statement in code.
.



Relevant Pages

  • Re: VB6 executable accessing a .Net DLL with ComClass
    ... regsvr32 in that it records the exact location of the dll. ... dll for App A but you have then also effected App B). ... The VB6 dev environment wants a type-library, ... registering the class that I am using. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Word Cannot Find Its Data Source ~~~.olk
    ... > I'd like some confirmation about registering this DLL. ... DLL, just in case, but regsvr32 came up with a "missing entry point" error. ... as I would like to have an address book connection method that can be ... initiated from Word and "does everything", the "initiation from Outlook" ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Word Cannot Find Its Data Source ~~~.olk
    ... "Peter Jamieson" wrote in message ... >> I'd like some confirmation about registering this DLL. ... >> But still need some help implementing this Workaround. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Application Eventlog Error message
    ... Jay ... >> XP Pro these messages are in System log. ... >> got same errors which leads me to believe that one or more DLL may not ... >> is less likely than registering dll. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Accessing a DLL without registering it
    ... If the dll is in the same directory as the exe, ... You should probably be careful registering dll's on a network share, ... The way the accounting package works is, ...
    (microsoft.public.vb.general.discussion)

Loading