Re: C++/CLI Integrating third party assembly into native C++
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Tue, 26 Dec 2006 09:50:26 -0800
"kyle.schmidt" <kyleschmidt@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3D0E5935-574F-499F-9318-9E6BEE9305F8@xxxxxxxxxxxxxxxx
I have a third party .NET assembly for which I have no control over that I
have to integrate into my app. My app is a large native C++ application. I
have other .NET assemblies that have integrated into the app successfully,
but this particular assembly is giving me problems. To integrate this .NET
assembly I'm using C++/CLI which should be fairly straightforward.
The assembly has a singleton engine that needs to be initialized so I can
get a NameValueCollection of providers from it. I can code up a C# sample
app
to do just that, launch the code through VS2005, and everything works as
expected. I get 5 providers returned which is the correct number. The
exact
same code in C++/CLI, changed for syntax, always returns 0 providers in
the
collection when launched through VS2005 both with and without the
debugger.
However, I have discovered that running the C++/CLI code through a command
line or through windows explorer will work correctly and return 5
providers.
My questions then are, what is different between launching a C++/CLI app
through VS2005 without debugging vs through windows explorer that would be
causing things to work differently? Is there something the third party
provider could check at run-time to disable functionality, but only with
the
C++ environment? The third party tool has been dotfuscated, so is there
anything in the dotfuscator that could be preventing this from working
correctly?
How is the list of providers loaded?
The only thing that comes to mind as a possible explanation is that when
running under the debugger, VS will use a "hosting process", so the name of
your process will be different than you might think. If the code is somehow
locating the providers by matching the process name (exe name) against some
resource, that might be the source of your problem.
There's an option "Use hosting process" in the Tools|Options pages
somewhere - you might try unchecking that to see if it makes any difference.
-cd
.
- Prev by Date: Re: making code native in a C++/CLI program
- Next by Date: Re: Events Sample that I can then use in VB with With Evnets keyword
- Previous by thread: making code native in a C++/CLI program
- Next by thread: Need a call to get the folder "My Documents"
- Index(es):
Relevant Pages
|