Re: Release DLL Problem by sid
sid
Thu Mar 13 13:08:37 CDT 2008
On 13 Mar, 15:38, sid <mail...@gmail.com> wrote:
> On Mar 13, 9:55=A0am, mind_the_gap <2voo...@gmx.de> wrote:
>
>
>
>
>
> > On Mar 13, 12:00=A0am, sid <mail...@gmail.com> wrote:
>
> > > On Mar 12, 10:23=A0pm, "Michael Salamone" <mikesa#at#entrek#dot#com>
> > > wrote:
>
> > > > Impossible to say without seeing the source code. =A0One thing to un=
derstand
> > > > is that just because something works in debug build, it's not guaran=
teed to
> > > > work ok in retail build - and vice versa.
>
> > > > Most common problem that gets uncovered between debug and retail bui=
lds is
> > > > uninitialized variables. =A0Check all your member variables to make =
sure they
> > > > are properly initialized. =A0Also check all local variables to ensur=
e they are
> > > > properly initialized.
>
> > > > --
> > > > Michael Salamone, eMVP
> > > > Entrek Software, Inc.www.entrek.com
>
> > > > "sid" <mail...@gmail.com> wrote in message
>
> > > >news:a4e9e618-1a11-42f8-a6c3-d37638013e06@s19g2000prg.googlegroups.co=
m...
>
> > > > > Hi there
>
> > > > > I have a DLL written in C++ which I call in my Embedded Visual Bas=
ic
> > > > > Application. The problem is when I call a particular function from=
the
> > > > > DLL which requires an LPTSTR argument. I send the argument as a St=
ring
> > > > > from VB.
>
> > > > > It works FINE if I run the Debug-version of the DLL, but when I ru=
n
> > > > > the Release-version of the DLL it sends an empty string to the
> > > > > function..
>
> > > > > Any Ideas for this anomaly..
>
> > > > > Cheers
> > > > > Sid- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > thanks for that..yes i do have many variables in the code both local
> > > and global. there is a strong chance i missed to initialise one or
> > > two. i will check that and see if i find any...
>
> > On Problem that got me searching some time and which had sometimes
> > same effects was that my DLL function declaration reqired a double for
> > a particular parameter and I, on the C# side, sent an integer - this
> > had as result that I got sometimes a number and sometimes just zero -
> > Maybe ou could also look for that :)- Hide quoted text -
>
> > - Show quoted text -
>
> I have just looked carefully at the problem. Its the problem with
> datatype mismatch.
>
> the c++ function I call from Visual Basic is
>
> =A0 =A0 Friend Declare Function DoRecognition Lib "CastAPI.dll" (ByVal
> ifilename As String, ByVal ofilename As String, _
> =A0 =A0 ByVal windowSize As Integer, ByVal targetRate As Integer, ByVal
> sampFrequency As Integer, ByVal preEmCoef As Single, _
> =A0 =A0 ByVal nfBankChannels As Integer, ByVal cepLifter As Integer, ByVal=
> loFreq As Single, ByVal hiFreq As Single, ByVal warpFreq As Single, _
> =A0 =A0 =A0 ByVal numCeps As Integer, ByVal sourceRate As Integer, ByVal
> useHamming As Boolean, ByVal useDelta As Boolean, _
> =A0 =A0 =A0 ByVal useCMN As Boolean, ByVal beamWidth As Integer, ByVal
> pruneModelLimit As Integer) As Boolean
>
> CASTAPI_API BOOL DoRecognition(LPTSTR filename,LPSTR ofilename,DWORD
> windowSize,DWORD targetRate,DWORD sampFrequency,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0FLOAT preEmCoef,INT=
nfBankChannels,INT cepLifter,FLOAT
> loFreq,FLOAT hiFreq,FLOAT warpFreq,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0INT numCeps,WORD so=
urceRate,BOOL useHamming,BOOL useDelta,BOOL
> useCMN,INT beamWidth,INT pruneModelLimit);
>
> The above works perfectly fine with the DEBUG-version of the DLL, but
> for Release-version I do not see anything for FLOAT's and
> LPTSTR's..they come as blanks or they does not show up at all (like
> expression cannot be computed or similar errors)
>
> Any Say- Hide quoted text -
>
> - Show quoted text -
the problem is solved for now...i have switched of all the compilation
optimisation options..and it compiles and runs well...
the problem is when i optimise hte code for speed or minimum space .
in that case also it compiles well but my function parameters like
float, LPTSTR stops working..