|
hi!
yes, it was a mistake. both times it must be CString strText.
i tried several things, sometimes the mistake was in that row:
db.m_zweiter=strText;
or everything was fine, but nothing changed in the database.
|
|
|
|
|
|
You need to do this:
1. Create a database object and open it.
2. Create a recordset object and open it. You send the SQL statement to the Recordset.
3. See CRecordset member functions for details how to insert, update and delete rows
4. You close the recordset and then the database.
Best regards,
Alexandru Savescu
|
|
|
|
|
Does anyone know of an easy way to change the text and background colors on one edit control in a dialog box?
|
|
|
|
|
|
Handle the WM_CTLCOLOR message. There are plenty of posts here explaining the use of that message and it is in MSDN. You can check the ID of your edit control and if it is the right one, you can then set the background colour and text colour using the device context...
hope this helps
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I get and assertion when I run this code, is the reason it fails because the m_cTabMain control isn't created when the first OnSize message comes through?
void CToolTabsDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
int ncx = cx - ::GetSystemMetrics (SM_CXBORDER);
int ncy = cy - ::GetSystemMetrics (SM_CYBORDER);
m_cTabMain.SetWindowPos (NULL, 0, 0, ncx, ncy, SWP_NOMOVE | SWP_NOZORDER);
} I put similar code in the OnPaint handler and it works perfectly. Is there anyway I can get the code to run in the OnSize handler? m_cTabMain is a CTabCtrl that I put on the dialog in the resource editor.
Thanks in advance.
- monrobot13
|
|
|
|
|
you can test to see if m_cTabMain is a window (::IsWindow(m_cTabMain.m_hWnd)) - don't call SWP if it's not a window.
-c
"[it was..] one of those evenings when you feel that not only will there definitely be a revolution, but that the Association of Manufacturers will foot the bill."
-- Umberto Eco, Foucault's Pendulum
|
|
|
|
|
the reason it fails because the m_cTabMain control isn't created when the first OnSize message comes through?
Probably. SOmetimes this trick works: insert an UpdateData(FALSE) right at the beginning of CToolTabsDlg::OninitDialog , after the call to the parent's OninitDialog .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Okay,
Just wondering if anyone has seen an STL implementaion used to iterate though an XML document.
While I don't know how this could be implemented I would have though something along the lines of a std::map in that it would be implemented as a tree (as most maps are - bit do not have to be according the specification), have a pair for the node name and the rest of it, but not have the sorting.
|
|
|
|
|
In the C# XML wrapper I wrote recently for WDJ, I did a dictionary ( i.e. a map ) of an XMLDOMNode to it's path, and one to it's value, which I guess is what you're thinking of here, yes ? It's pretty easy to do recursively.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
In the C# XML wrapper I wrote recently for WDJ, I did a dictionary ( i.e. a map ) of an XMLDOMNode to it's path, and one to it's value, which I guess is what you're thinking of here, yes ? It's pretty easy to do recursively.
Sounds like the kind of thing. What made me think about it was that iterating though an XML tree looks so ugly, getchild and then get its child, and then its best friends dog etc. Its stuff that has to be done over and over and aI though STL may be able to come to the rescue, as iterators can save so much time in the right places.
Only just started looking at C#, haiving bought Tom's book the other day. Not had chance to get stuck in though having been busy with things.
|
|
|
|
|
Tom's book is excellent, but there is nothing on XML in there, apart from XML comments. I think a C++ container that fits into the STL and iterates XML is a great idea. Good enough that I'm considering doing it, unless you intend to ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Please go ahead, and drop me a line if you need any help with testing etc. While I use STL quite a bit, I've never written any new containters and iterators before, and currently don't have the time to get stuck in, as I'm busy wrting some Excel wrappers which I use for report writing that I was thinking of posting as an article on CP in the near future
After all, you are the STL king around here.
|
|
|
|
|
Giles wrote:
After all, you are the STL king around here.
No, I don't think so Check out the top rated article this week for the STL king. I am but the clown prince.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
No, I don't think so Check out the top rated article this week for the STL king. I am but the clown prince
Ahh the modesty.
Seriously, let me know how you get on, would be really interested to see how it turns out if you go ahead with it.
Right I'm off to bed, and to find my Harry Potter book. Its somewhere around here.
|
|
|
|
|
Hi I have never use vector in my life
This is what I tried to create integer array
here is my code
#include < vector >
using namespace std;
vector LCArray;
LCArray listCountArray;
but I got these errors
TextTreeDlg.cpp
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2146: syntax error : missing ';' before identifier 'listCountArray'
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2501: 'LCArray' : missing storage-class or type specifiers
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2371: 'LCArray' : redefinition; different basic types
D:\WinGames\TextTree\TextTreeDlg.cpp(23) : see declaration of 'LCArray'
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
where do i get wrong?
Oh I'm using VC++ and my application is dialog based application
Thanks
|
|
|
|
|
I see you worked it out
1. what is
Win wrote:
vectorLCArray;
????
Is this a typedef that is still missing it's < > ? I think it's better just to have vector<int> listCountArray. Oh, don't call it list, it's not a list at all.
2. You should use the bits of std you need, as in using std::vector. Otherwise, why have namespaces at all ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
my actual code is
<br />
#include < vector ><br />
using namespace std;<br />
vector < int > LCArray;<br />
LCArray listCountArray;<br />
all the < > were gone when I didn't put the space between them..
thanks
|
|
|
|
|
OK then, I could not tell what you were doing with the missing bits.
I think you must have seen some code that uses typedefs. The third line creates a vector of ints called LCArray, and the fourth line attempts to use this object as a type. Remove it, or add 'typedef' to the start of the line above. And as I said, only use the bits of std you need, and don't call it a list, it isn't one. list is a totally different container to vector.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi I have never use vector in my life
This is what I tried to create integer array
here is my code
<br />
#include <vector><br />
using namespace std;<br />
vector<int>LCArray;<br />
LCArray listCountArray;<br />
<br />
<br />
but I got these errors<br />
TextTreeDlg.cpp<br />
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2146: syntax error : missing ';' before identifier 'listCountArray'<br />
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2501: 'LCArray' : missing storage-class or type specifiers<br />
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : error C2371: 'LCArray' : redefinition; different basic types<br />
D:\WinGames\TextTree\TextTreeDlg.cpp(23) : see declaration of 'LCArray'<br />
D:\WinGames\TextTree\TextTreeDlg.cpp(24) : fatal error C1004: unexpected end of file found<br />
Error executing cl.exe.<br />
<br />
where do i get wrong?
Oh I'm using VC++ and my application is dialog based application
Thanks
|
|
|
|
|
The < and > have been stripped from your post - you needed to check 'display message as is' below the message.
#include <vector>
using std::vector;
vector<int> myVec;
I do not use typedefs with STL, they are a good way to uglify and obsfucate your code.
Christian
<i>Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that...</i> - <b>Shog9 04-09-2002</b>
<i>During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. </i> - <B>Alex E. - 12-Sept-2002</B>
|
|
|
|
|
Hi, my program needs to do some lengthy process without any interruption on users computer, however if the user has screen saver enabled things will be completely screwed up. I remember I saw a post here about disabling screen saver a few eeks ago but now I can't find it anymore.
Thanks.
|
|
|
|
|
Look up SystemParametersInfo in MSDN. There is a section on screen savesr.
|
|
|
|
|