Click here to Skip to main content
16,013,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTAPI Pin
Sameer Maggon29-May-02 18:34
Sameer Maggon29-May-02 18:34 
GeneralRe: TAPI Pin
Michael P Butler29-May-02 22:01
Michael P Butler29-May-02 22:01 
GeneralMessage Queue and Threads Pin
wilche29-May-02 17:51
wilche29-May-02 17:51 
GeneralRe: Message Queue and Threads Pin
Prem Kumar29-May-02 18:28
Prem Kumar29-May-02 18:28 
GeneralRe: Message Queue and Threads Pin
wilche30-May-02 13:52
wilche30-May-02 13:52 
GeneralRe: Message Queue and Threads Pin
Bill Wilson30-May-02 12:12
Bill Wilson30-May-02 12:12 
GeneralRe: Message Queue and Threads Pin
wilche30-May-02 13:48
wilche30-May-02 13:48 
GeneralPassing Pointer Between DLL & App Pin
29-May-02 17:08
suss29-May-02 17:08 
I write an Application which uses another DLLs.

In the DLL_DS, it contain a DataService class, which with functions to get something from the database, and return the list of something, say:

<br />
CSimpleKeyList *CRebDataService::GetSimpleKeyList()<br />



In the DLL_TY, it holds the basic definition of some class, say:
<br />
class CHRISTINE_EXPORT CSimpleKeyDetail  <br />
{<br />
public:<br />
	CSimpleKeyDetail();<br />
	virtual ~CSimpleKeyDetail();<br />
<br />
	CString GetKeyID() const;<br />
	long GetKey() const;<br />
	CString GetKeyName() const;<br />
<br />
	void SetKeyID(const CString& keyid);<br />
	void SetKey(const long key);<br />
	void SetKeyName(const CString& keyname);<br />
<br />
protected:<br />
<br />
	CString m_KeyID;<br />
	long m_Key;<br />
	CString m_KeyName;<br />
};<br />


One of header file of DLL_TY defines the template of CDualMapListType (which is just a std::map), and
<br />
typedef CDualMapListType<CSimpleKeyDetail> CSimpleKeyList;<br />


The Application includes the header file, and is getting a CSimpleKeyList *plist from DLL_DS, but when loop through the list, an access violation occurred.

<br />
for (itr=plist->begin();itr!=plist->end();itr++)<br />
{<br />
    CSimpleKeyDetail *pKeyDetail = itr->second;<br />
    keyid = pKeyDetail->GetKeyID();          //Access Violation Here<br />
<br />
    ... ... ...<br />
}<br />


Now, I am wondering if CString can be passed between the DLL and the App, or even I can't pass the pointer to a std::map from DLL to the app, where memory is allocated in the DLL, and deletion is in the Application.

Can anyone showe me the hint ??

Thanks very much
GeneralRe: Passing Pointer Between DLL & App Pin
Joaquín M López Muñoz29-May-02 19:47
Joaquín M López Muñoz29-May-02 19:47 
GeneralRe: Passing Pointer Between DLL & App Pin
29-May-02 21:09
suss29-May-02 21:09 
GeneralRe: Passing Pointer Between DLL & App Pin
29-May-02 21:14
suss29-May-02 21:14 
GeneralRe: Passing Pointer Between DLL & App Pin
29-May-02 21:35
suss29-May-02 21:35 
GeneralWho Pin
chen29-May-02 17:13
chen29-May-02 17:13 
GeneralIE Standard Buttons 'dithering' Pin
Tim Deveaux29-May-02 13:47
Tim Deveaux29-May-02 13:47 
GeneralRe: IE Standard Buttons 'dithering' Pin
Shog929-May-02 15:05
sitebuilderShog929-May-02 15:05 
GeneralRe: IE Standard Buttons 'dithering' Pin
Tim Deveaux30-May-02 4:01
Tim Deveaux30-May-02 4:01 
GeneralRe: IE Standard Buttons 'dithering' Pin
Michael Dunn29-May-02 17:48
sitebuilderMichael Dunn29-May-02 17:48 
GeneralRe: IE Standard Buttons 'dithering' Pin
Tim Deveaux30-May-02 3:59
Tim Deveaux30-May-02 3:59 
Generalpointer to an array... "char" Pin
SilverShalkin29-May-02 13:45
SilverShalkin29-May-02 13:45 
GeneralRe: pointer to an array... "char" Pin
soptest29-May-02 13:57
soptest29-May-02 13:57 
GeneralRe: pointer to an array... "char" Pin
Christian Graus29-May-02 14:37
protectorChristian Graus29-May-02 14:37 
GeneralRe: pointer to an array... "char" Pin
Nish Nishant29-May-02 14:56
sitebuilderNish Nishant29-May-02 14:56 
GeneralRe: pointer to an array... "char" Pin
Christian Graus29-May-02 15:16
protectorChristian Graus29-May-02 15:16 
GeneralRe: pointer to an array... "char" Pin
Nish Nishant29-May-02 15:27
sitebuilderNish Nishant29-May-02 15:27 
GeneralRe: pointer to an array... "char" Pin
Christian Graus29-May-02 15:48
protectorChristian Graus29-May-02 15:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.