> Hello,
>
> -I am unable to use the IO stream (write to an event log) from the dll.
> Although I can successfully use an IO stream when calling the dll from a
> regular .net Windows Form.
This will be a permissions problem. ASP code runs as a specific user
(IUSR_[MachineName] IIRC) and that user has very limited permissions.
You will need to give the user permissions to write to the event log
or have ASP impersonate another user.
> -The program behaves very inconsitently. Normally I can connect to my
> database (via the unmanaged C++ dll) for the first time only. After this it
> will crash everytime UNTIL I restart the aspnet_wp process from the task
> manager (at which time I can again connect to the database one time).
I highly doubt this is ASP.Net's fault; most likely, you're not
correctly closing or releasing some resource, or corrupting memory, or
something.
Akoni - 16 Jun 2004 21:21 GMT
Thanks Eric,
I tried giving the ASPNET account administrator privileges, but still the
same results. Here is the code snippet from the unmanaged C++ dll:
GetExePath ( szEventLogPath ) ;
_tcscat( szEventLogPath, "eventlog.txt" ) ;
// open the log file
ofstream r_os( (char*)szEventLogPath, ios::app | ios::ate ) ;
if ( r_os == NULL )
return ;
r_os always end up being NULL (so it never even tries to write). It like it
can't create an ofstream if the dll is called from the ASP.NET front end.
> > Hello,
> >
[quoted text clipped - 15 lines]
> correctly closing or releasing some resource, or corrupting memory, or
> something.