|
Create a select statement that will join the two tables based on some common key and then select the relevant fields. Though I am not exactly very clear on what you are trying.
|
|
|
|
|
Hi all,
anybody knows like disable [autoscroll] in a CEditView (multiline) ?
My instance is readonly and I add text always in append after then the CEditView scroll automatically automatically at the end.
Thank's,
Gigi
|
|
|
|
|
I am not sure about this, but you may want to set current selection at the top of the control after you've appended the text.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I click an item with right mouse button treectrl doesn't change selected item, so I don't know how to find out which item was clicked( as far as I know NM_RCLICK handler doesn't provide anything helpful ). I'm not sure whether it is possible to get handler of clicked item. I will apreciate any help.
|
|
|
|
|
I'm using ::GetMessagePos, CTreeCtrl::ScreenToClient and CTreeCtrl::HitTest.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
It's not very elegant in my opinion but it should work (I haven't checked it), but anyway thanks for help!
|
|
|
|
|
Anonymous wrote:
It's not very elegant in my opinion
If you find more elegant solution, let me know.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Tomasz' solution sounds fine to me, but if you don't like it then i'd suggest subclassing the tree control & installing your own WM_RBUTTONDOWN handler; you'll probably find all sorts of other uses for subclassing the control anyway.
Shog9
|
|
|
|
|
Shog9 wrote:
if you don't like it then i'd suggest subclassing the tree control & installing your own WM_RBUTTONDOWN handler
This should work, however, if you use TVN_BEGINRDRAG you'd have to write non-trivial code.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I've created an MFC-dll.
InitInstance() gets called when the dll is called, and ExitInstance() is called when it's released. Normal behaviour so far.
Normaly, Run() should be called too (automaticaly), after InitInstance() , isn't it? In my dll, Run() never gets called. Is there a good reason for that?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
CWinApp::Run contains the message loop. If you have DLL, there's no need for one - .exe provides its own.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Consider declaration,
std::string name = " ABCD"
As can be seen above the string consist of many "space bar"
characters in the beginning. I want to skip them and get the resultat string value. Please tell me how ????
|
|
|
|
|
name.substr(name.find_first_not_of(' '));
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
This would be easiest:
std::string name = "ABCD";
Now seriously: you should use string::find_first_not_of:
int pos = name.find_first_not_of(' ');
if (pos != std::string::npos)
{
name.erase(0, pos);
}
If you want to remove all spaces (not only at beginning), use this:
name.erase(std::remove(name.begin(), name.end(), ' '), name.end());
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Should you use CString you have the following methods: TrimLeft , TrimRight .
Best regards,
Alexandru Savescu
|
|
|
|
|
(with tremulous voice) Don't lead the guy apart from the one and true std::string ! Now seriously, these functions, though not directly available, can be easily written:
#ifndef TRIMTEMPLATES_H
#define TRIMTEMPLATES_H
#define VERSION_TRIMTEMPLATES 0x00010000
template<class String,class Ch>
inline String& trim_left(String& str,Ch ws)
{
typename String::size_type first_nonblank;
if ((first_nonblank=str.find_first_not_of(ws))!=String::npos)
return str.erase(0, first_nonblank);
else
return str;
}
template<class String>
inline String& trim_left(String& str)
{
return trim_left(str, ' ');
}
template<class String,class Ch>
inline String& trim_right(String& str,Ch ws)
{
typename String::size_type last_nonblank;
if((last_nonblank=str.find_last_not_of(ws))!= String::npos)
return str.erase(last_nonblank+1);
else
return str;
}
template<class String>
inline String& trim_right(String& str)
{
return trim_right(str, ' ');
}
template<class String,class Ch>
inline String& trim(String& str,Ch ws)
{
return trim_left(trim_right(str, ws),ws);
}
template<class String>
inline String& trim(String& str)
{
return trim_left(trim_right(str));
}
#elif VERSION_TRIMTEMPLATES!=0x00010000
#error You have included two LISTPORTS.H with different version numbers
#endif
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín M López Muñoz wrote:
Don't lead the guy apart from the one and true std::string!
I never meant that! I like STL just as much as you do. I was just showing some MFC code
Best regards,
Alexandru Savescu
|
|
|
|
|
SHAME! SHAME! You should know better than to show MFC examples. People will get the mistaken impression its easier to use than the beloved STL.
|
|
|
|
|
Take it easy man!
I was not giving any MFC example, I was giving a CString example. CString is a very good class it can be argued that it is better than std::string (it uses reference counting remember!)
Best regards,
Alexandru Savescu
|
|
|
|
|
Alexpro wrote:
it is better than std::string
SACRILEDGE!!
Alexpro wrote:
CString is a very good class
BLASPHEMY!!
Oh NO! STr o k e...
BTW CString is part of MFC. (Microsoft Foul Code). Everyone knows was developed as part of a feindish plot to undermine portablilty with Unix/Linux.
|
|
|
|
|
Hi everybody:
I want to display two modal dialogs, one first and the other when user clicks ok button on first dialog.
I try this:
CDialog1 dlg1;
m_pMainWnd = &dlg1;
int nResponse = dlg1.DoModal();
if (nResponse == IDOK)
{
CDialog2 dlg2;
m_pMainWnd = &dlg2;
nResponse = dlg2.DoModal();
...
}
in InitInstance function of my app but doesn't work (first dialog is ok but other dialog is showed and killed inmediately without user interaction)
Anybody can help me?
|
|
|
|
|
Remove lines assigning pointers to m_pMainWnd.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Is it that? What's the reason of this behavior?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
See my reply to your reply to OP
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Thanxs a lot. It is running well now.
|
|
|
|