By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,165 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,165 IT Pros & Developers. It's quick & easy.

Problem using mixed-mode DLL from VB.NET

P: n/a
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.Exception("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?
Feb 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Doug Belkofer" <no****@nospam.com> schrieb
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.


This sounds like you want to change the DLL written in C++. The better group
for this is microsoft.public.dotnet.languages.vc
Armin

Feb 15 '06 #2

P: n/a
Thanks - I'll post there and see what others say.

This sounds like you want to change the DLL written in C++. The better
group for this is microsoft.public.dotnet.languages.vc
Armin

Feb 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.