Problem using mixed-mode DLL from VB.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Doug Belkofer

    #1

    Problem using mixed-mode DLL from VB.NET

    We have created a fairly complex mixed-mode DLL that we want to use from
    VB.NET. The mixed-mode DLL is written in C++, and does use the standard C
    runtime libraries. An unusual thing is happening in that when we look at
    this DLL from the Object Browser in Visual Studio, it seems to be exporting
    several items related to the standard C runtime libraries. One example is
    that there is a namespace called "std" in the Object Browser, and in that is
    something the Object Browser identifies as "Public Structure exception".

    If we have code somewhere in the VB.NET application that throws an
    exception, and such as:

    Throw New exception("FOO" )
    We get a build error that says "Type 'exception' has no constructors." The
    mixed mode DLL is obviously making something visible to the project with the
    name "exception" , even though we never intended to do that. In fact, there
    are many things showing up in the Object Browser for this mixed mode DLL
    that should not be showing up.

    If we modify the code to say:

    Throw New System.Exceptio n("FOO")

    then everything works fine. But we don't want to have to deal with these
    naming conflicts, because the names in the mixed mode DLL shouldn't be
    visible in the first place.

    Does anyone have any ideas on how to fix this?


  • Armin Zingler

    #2
    Re: Problem using mixed-mode DLL from VB.NET

    "Doug Belkofer" <nospam@nospam. com> schrieb[color=blue]
    > then everything works fine. But we don't want to have to deal with
    > these naming conflicts, because the names in the mixed mode DLL
    > shouldn't be visible in the first place.[/color]

    This sounds like you want to change the DLL written in C++. The better group
    for this is microsoft.publi c.dotnet.langua ges.vc


    Armin

    Comment

    • Doug Belkofer

      #3
      Re: Problem using mixed-mode DLL from VB.NET

      Thanks - I'll post there and see what others say.
      [color=blue]
      >
      > This sounds like you want to change the DLL written in C++. The better
      > group for this is microsoft.publi c.dotnet.langua ges.vc
      >
      >
      > Armin[/color]


      Comment

      Working...