Click here to Skip to main content
15,905,785 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: How to use multi byte character set in vs2008 ATL Pin
Nathan Holt at EMOM16-Apr-08 11:41
Nathan Holt at EMOM16-Apr-08 11:41 
GeneralRe: How to use multi byte character set in vs2008 ATL Pin
dlocarnini9-Jun-08 3:57
dlocarnini9-Jun-08 3:57 
Generalconversion from char* to string Pin
gReaen9-Apr-08 3:35
gReaen9-Apr-08 3:35 
GeneralRe: conversion from char* to string Pin
Hamid_RT14-Apr-08 21:49
Hamid_RT14-Apr-08 21:49 
GeneralRe: conversion from char* to string Pin
Johann Gerell14-May-08 21:47
Johann Gerell14-May-08 21:47 
GeneralUsing WTL/ATL in a static library Pin
mateuscb3-Apr-08 3:42
mateuscb3-Apr-08 3:42 
GeneralRe: Using WTL/ATL in a static library Pin
mateuscb3-Apr-08 7:24
mateuscb3-Apr-08 7:24 
QuestionCan u hand over CStrings from MFC to a WTL DLL? [modified] Pin
DaveB229-Mar-08 1:51
DaveB229-Mar-08 1:51 
I have tried to write a WTL DLL as a wrapper for some utility code which compiles fine with WTL. Want to call it from an MFC app, and assumed I could pass CString's back and forth through the wrapper because WTL docs say the CString class in WTL is compatible with MFC.

I strike a problem in the linking of the MFC app. Works fine with ints but with CString's DLL builds fine, MFC app compiles fine, but fails to link with message

1>TestCallerDlg.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall QXMyWrapper::Hello(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > )" (__imp_?Hello@QXMyWrapper@@QAEHV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) referenced in function "public: void __thiscall CTestCallerDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@CTestCallerDlg@@QAEXXZ)

Any ideas? Can you use CString params in a WTL DLL?

= = =
More details... I am using the same header file for compiling the .DLL and the .exe (application).
Trying to follow the advice in http://www.codeproject.com/KB/DLL/RegDLL.aspx[^]

Here's the .h .....

#ifndef _DLL_TUTORIAL_H_
#define _DLL_TUTORIAL_H_

#ifdef _AFX // MFC apps define this
#define DECLDIR __declspec(dllimport)
#else
#define DECLDIR __declspec(dllexport)
// WTL definitions for the non MFC environment
// #define _ATL_MIN_CRT
// #define _CRT_SECURE_NO_WARNINGS
// #define _CRT_NON_CONFORMING_SWPRINTFS
#include <atlstr.h>
#include <atlbase.h>
#include <atlapp.h>
#define _WTL_NO_CSTRING
#include <atlmisc.h>
#endif

class DECLDIR QXMyWrapper
{
public:
QXMyWrapper();
~QXMyWrapper();
int Hello(CString name);
int HelloInt(int val);
};

#endif

If I build a little test app MFC dialog with a button which calls HelloInt only then everthing links and works fine. As soon as I try to call Hello(CString) it fails to link. Seems like it is looking for a function with decorated name containing ...StrTraitMFC... but I think the DLL gets built with a decorated name containing ...StrTraitATL... for the CString param. Chances are it would happily pass the CString in if only I could convince the linker to give it a try Frown | :-(

PS Notice the commented out #defines like _ATL_MIN_CRT ... I kept fiddling thinking the secret might be one of these but I couldn't get it to work... left these commented lines to point to some thoughts anyhow

DaveB

modified on Saturday, March 29, 2008 8:23 AM

AnswerRe: Can u hand over CStrings from MFC to a WTL DLL? Pin
Stuart Dootson29-Mar-08 16:25
professionalStuart Dootson29-Mar-08 16:25 
GeneralRe: Can u hand over CStrings from MFC to a WTL DLL? Pin
DaveB229-Mar-08 23:41
DaveB229-Mar-08 23:41 
GeneralRe: Can u hand over CStrings from MFC to a WTL DLL? Pin
Stuart Dootson30-Mar-08 2:25
professionalStuart Dootson30-Mar-08 2:25 
GeneralRe: Can u hand over CStrings from MFC to a WTL DLL? Pin
DaveB231-Mar-08 0:10
DaveB231-Mar-08 0:10 
QuestionATL service: Call to LoadLibrary Fails. Pin
abhijitr28-Mar-08 5:53
abhijitr28-Mar-08 5:53 
GeneralRe: ATL service: Call to LoadLibrary Fails. Pin
Stuart Dootson29-Mar-08 16:33
professionalStuart Dootson29-Mar-08 16:33 
Questionwhy WTL ListViewCtrl's LVN_GETDISPINFO notification is not getting fired? Pin
Ram-Murthi28-Mar-08 1:43
Ram-Murthi28-Mar-08 1:43 
AnswerRe: why WTL ListViewCtrl's LVN_GETDISPINFO notification is not getting fired? Pin
Ram-Murthi30-Mar-08 19:42
Ram-Murthi30-Mar-08 19:42 
AnswerRe: why WTL ListViewCtrl's LVN_GETDISPINFO notification is not getting fired? Pin
PuttyTree23-Nov-11 20:47
PuttyTree23-Nov-11 20:47 
GeneralUnable to open file for reading using C++ I/O [modified] Pin
ComplexLifeForm26-Mar-08 23:34
ComplexLifeForm26-Mar-08 23:34 
GeneralRe: Unable to open file for reading using C++ I/O Pin
led mike27-Mar-08 5:00
led mike27-Mar-08 5:00 
GeneralRe: Unable to open file for reading using C++ I/O Pin
CPallini27-Mar-08 5:29
mveCPallini27-Mar-08 5:29 
GeneralRe: Unable to open file for reading using C++ I/O [modified] Pin
ComplexLifeForm27-Mar-08 7:21
ComplexLifeForm27-Mar-08 7:21 
GeneralRe: Unable to open file for reading using C++ I/O Pin
CPallini27-Mar-08 9:56
mveCPallini27-Mar-08 9:56 
QuestionNeed Help on ATL Project Pin
manish.patel25-Mar-08 22:20
manish.patel25-Mar-08 22:20 
GeneralRe: Need Help on ATL Project Pin
Michael Dunn26-Mar-08 17:58
sitebuilderMichael Dunn26-Mar-08 17:58 
GeneralRe: Need Help on ATL Project Pin
manish.patel30-Mar-08 22:34
manish.patel30-Mar-08 22:34 

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.