Thanks.
Ken
Ken,
That's to be expected. They aren't the same as your exported DLL
functions.
> How do I use DllImport in my managed dll to
>call a
>function from a static library?
You don't need to - just #include the header file that defines your
static library functions, and add that static library's .lib file to
the list of linked libraries for your DLL project.
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.
Parser Error Message: File or assembly name VPDataReader, or one of its
dependencies, was not found.
Source Error:
Line 170: <add assembly="System.Drawing, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 171: <add assembly="System.EnterpriseServices,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 172: <add assembly="*"/>
Line 173: </assemblies>
Line 174:
Source File:
c:\winnt\microsoft.net\framework\v1.0.3705\Config\machine.config Line:
172
Assembly Load Trace: The following information can be helpful to determine
why the assembly 'VPDataReader' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = VPDataReader
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/VPDataReader
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: VPDataReader
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET
Files/vpdatareader/0b262eeb/20817507/VPDataReader.DLL.
LOG: Attempting download of new URL
file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET
Files/vpdatareader/0b262eeb/20817507/VPDataReader/VPDataReader.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/VPDataReader/bin/VPDataReader.DLL.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: VPDataReader, Version=1.0.881.11565,
Culture=neutral, PublicKeyToken=null
Any ideas? I do appreciate the help David.
Ken
"David Lowndes" <dav...@mvps.org> wrote in message
news:pi7dfu01u5l28lgbn...@4ax.com...
No idea - sorry :(
If I recreate the web service as C# instead of MC++, is there a way to still
link the static C++ lib?
Ken
"David Lowndes" <dav...@mvps.org> wrote in message
news:7lrefu4mbpmgfdkec...@4ax.com...
Is your unmanaged DLL in your service's bin directory, or at least in a
directory referenced in your PATH variable?
--
Tomas Restrepo
tom...@mvps.org
Ken
"Tomas Restrepo [MVP]" <tom...@mvps.org> wrote in message
news:#65xPrMCCHA.2444@tkmsftngp05...
> Ken,
If I'm correct then that's what is happening:
ASP.NET tries to preload all assemblies from you bin folder (don't ask why)
When it loads your unmanaged dll and tries to treat is as assembly it fails
and throws exception. (to MS: by the way why? isn't suppose just ignore the
file it does not understand). So you have two options:
1. Move you unmanaged DLL to somewhere where it will be accessible through
PATH variable.
2. Add the following to your web.config to prevent ASP.NET assembly
preloading.
<configuration>
<system.web>
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<remove assembly="*"/>
</assemblies>
</compilation>
</system.web>
</configuration>
Let me know if it helps.
"Ken Johnson" <kjoh...@vp.com> wrote in message
news:e23m8bKCCHA.2580@tkmsftngp05...
has a profile option which might also be useful.
Hope this helps.
Thank you,
Bobby Mattappally
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Ken Johnson" <kjoh...@vp.com>