Re: passing a string to a dll
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 18 Sep 2007 10:05:16 -0400
First, DID YOU USE THE DEBUGGER TO EXAMINE THE STRING CONTENTS???? If not, why not? I do
things like this all the time without problems, so there is something about your
environment that you are not telling us, but more critically, you have not actually
examined the behavior of the code.
Are you doing static linking of the MFC library? In that case, all bets are off. You
can't pass MFC objects across library boundaries. In this case, you would have to use
LPCTSTR.
Is the example you are using EXACTLY using the string "12345" or is it using something
else?
Given the example below, you should be comparing the binary value of the string (12345) to
the numeric value 12345, which is why I suspect that the example you have shown here may
not be the example you are actually using.
Note that you would nominally be better of passing const CString & s instead of CString s
in such a case; it would be more efficient.
joe
On Mon, 17 Sep 2007 21:34:09 -0400, "SteveR" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote:
I am working with the first dll I've ever created. I am testing with thisJoseph M. Newcomer [MVP]
function:
bool DLLRect::PullWhisker(CString s)
{
if(s != _T("12345") )
::Beep(1000,200);
return true;
}
In my view:
DLLRect r;
r.PullWhisker(_T("12345") );
Why am I getting that beep, i.e. why is the string not recognized?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: passing a string to a dll
- From: SteveR
- Re: passing a string to a dll
- References:
- passing a string to a dll
- From: SteveR
- passing a string to a dll
- Prev by Date: Re: OTOH, you folks are smart ...
- Next by Date: Re: Handling focus change on child frame
- Previous by thread: Re: passing a string to a dll
- Next by thread: Re: passing a string to a dll
- Index(es):
Relevant Pages
|