Re: passing a string to a dll
- From: "Tom Serface" <tom.nospam@xxxxxxxxxxxxx>
- Date: Tue, 18 Sep 2007 15:59:15 -0700
OK, I figured it was worth asking :o)
I'd bet one of the files the linker is trying to use is not found so being ignored and references in it are causing the errors.
Tom
"SteveR" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:ex5iO5j%23HHA.4784@xxxxxxxxxxxxxxxxxxxxxxx
Yes, in my view, where I call the DLL function, I have:
#include "Debug\TestDLL\DLLRect.h"
---------------------
"Tom Serface" <tom.nospam@xxxxxxxxxxxxx> wrote in message news:ujvemyj%23HHA.4880@xxxxxxxxxxxxxxxxxxxxxxxJust a guess, but did you include the header file for the DLL.---------------------"SteveR" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:Ohn3ONj%23HHA.4460@xxxxxxxxxxxxxxxxxxxxxxxThank you all for your help.
I have now specified unicode in the dll, so it should match up with the application.
I have, for now at least, chosen to use CString& in both the dll and the application.
Please remember that I am not nearly as trained in depth as you all are, and therefore cannot make complete sense of what I am now presented with:
Room 101View.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall DLLRect::PullWhisker(class CString &)" (__imp_?PullWhisker@DLLRect@@QAE_NAAVCString@@@Z)
My dll:
// DLLRect.h: interface for the DLLRect class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_)
#define AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class AFX_EXT_CLASS DLLRect
{
public:
DLLRect();
virtual ~DLLRect();
CString GetString();
CString LoadStringID(UINT stringID);
bool PullWhisker(CString& s); //LPCTSTR s);
};
#endif // !defined(AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_)
. . .
bool DLLRect::PullWhisker(CString& s)
{
if(s != _T("12345") )
::Beep(1000,200);
return true;
}
my app:
// DLLRect.h: interface for the DLLRect class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_)
#define AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class AFX_EXT_CLASS DLLRect
{
public:
DLLRect();
virtual ~DLLRect();
CString GetString();
CString LoadStringID(UINT stringID);
bool PullWhisker(CString& s); //LPCTSTR s);
};
#endif // !defined(AFX_DLLRECT_H__935F1132_14D8_4CC5_A466_5B6E1904C9B4__INCLUDED_)
. . .
in my view:
DLLRect r;
CString s = _T("12345");
r.PullWhisker(s);
.
- References:
- passing a string to a dll
- From: SteveR
- Re: passing a string to a dll
- From: Joseph M . Newcomer
- Re: passing a string to a dll
- From: SteveR
- Re: passing a string to a dll
- From: Tom Serface
- Re: passing a string to a dll
- From: SteveR
- passing a string to a dll
- Prev by Date: Re: passing a string to a dll
- Next by Date: Re: passing a string to a dll
- Previous by thread: Re: passing a string to a dll
- Next by thread: Re: passing a string to a dll
- Index(es):
Relevant Pages
|
Loading