Inability to scale DLL code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using VC++ 5.0

I have a DLL created by a previous employee that is used for reading from
text files and databases and outputs to a database and ASP pages. I am
attempting to convert the DLL to input/output UNICODE in specific places.

I am able to read in the UNICODE text files (the code for which is in
various classes), however when trying to scale the output code (which is
called from an ASP page) I encounter a segmentation fault when performing the
initalization of the DLL object (though I can create the ASP object
successfully).

The only change I make is adding a BSTR declaration (BSTR wcGoalStmt =
SysAllocString("")) in the function that is called by the ASP page which
resides in the core object of the DLL. However, I receive the error when I
call an initalization function elsewhere in the core object of the DLL, which
is the first call made to the DLL. When I remove the BSTR declaration the DLL
works correctly (though not outputting UNICODE).

Why would the addition of a variable declaration cause the first call to a
DLL to fail?

Thanks in advance,
Chris Reddy
Infotech
 
reddz said:
Using VC++ 5.0

I have a DLL created by a previous employee that is used for reading from
text files and databases and outputs to a database and ASP pages. I am
attempting to convert the DLL to input/output UNICODE in specific places.

I am able to read in the UNICODE text files (the code for which is in
various classes), however when trying to scale the output code (which is
called from an ASP page) I encounter a segmentation fault when performing
the
initalization of the DLL object (though I can create the ASP object
successfully).

The only change I make is adding a BSTR declaration (BSTR wcGoalStmt =
SysAllocString("")) in the function that is called by the ASP page which
resides in the core object of the DLL. However, I receive the error when I

call an initalization function elsewhere in the core object of the DLL,
which
is the first call made to the DLL. When I remove the BSTR declaration the
DLL
works correctly (though not outputting UNICODE).

Why would the addition of a variable declaration cause the first call to a
DLL to fail?

Maybe the rules of conduct for assigning releasing resources are not
maintained. That's the drawback of using C++ :<
Note that you never can mixup unicode/ansi string manipulation without
thouroughly redesiging your solution in C++. If the project was ansi based,
just consider to rewrite the component in VB6 which is not a bad choice at
all and VB6 performs very well for ASP pages.
 
Back
Top