c++ - How can I obtain the content of a Edit Control with WTL? -


i've read on few threads here on how achieve that. tried several answers none worked far. want content of edit control, given cedit in wtl, , save preferably std::wstring, guess can't around using cstring/tchar*.

prerequisites:

id of control: idc_linkpasteedit  member variable idc_linkpasteedit assigned via ddx map: m_linkpasteedit 

what tried far:

1.)

cstring windowtext; getdlgitemtext(idc_linkpasteedit, windowtext, 1024); 

-> argument list error getdlgitemtexta (which referred getdlgitemtext's define)

2.)

cstring windowtext; m_linkpasteedit.getwindowtext(windowtext); 

-> argument list error getdlgitemtexta

i can't quite figure out correct list well, documentation not existent , looking define feel arguments should correct.

sadly didn't find resource, downloaded html document wtl library, seems cedit isn't documented in there.

any ideas?

edit:

made work in very weird fashion, not wtl-like in opinion, works @ least.

1) - change multibyte charset unicode in project settings

2) -

wchar windowtext[1024];  getdlgitemtext(idc_linkpasteedit, windowtext, 1024); 

works multibyte using char instead of wchar, prefer wide way.

the cstring, ddx , getdlgitemtext suggest using mfc, not wtl - right?

mfc's getdlgitemtext has 2 overloads:

int getdlgitemtext(    int nid,    lptstr lpstr,    int nmaxcount  ) const; int getdlgitemtext(    int nid,    cstring& rstring  ) const; 

and call doesn't match either. use cstring's form, without length.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -