|
CString t;
t.Format("%d", char_count);
pWriter->WriteAttributeString(NULL, L"CharacterCount", NULL, t);
|
|
|
|
|
I'm not sure, that this is work. CString is not compatible with wide-string variable types, isn't it?
I appreciate your help all the time...
Eranga
|
|
|
|
|
then how about:
wchar_t buf[20];
wsprintf(buf, "%d", char_count);
etc...
|
|
|
|
|
Yes it is, if you build is unicode.
Steve
|
|
|
|
|
Use a CStringW then.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dear All,
I've enumerated all the processes in the system and i have all the relevant ProcessIds.
Now i want to find out the command line argument associated with each process. How can i find out the command line parameters of other processes.
Imtiaz
|
|
|
|
|
Hi guyz,
I want to copy a vector to another but i have no idea how.
Last option i have in mind is by elements but its a long process.
Hope somebody can help me.
That's all thanks.
|
|
|
|
|
There's probably a way using back_inserter or something like that.
|
|
|
|
|
have you tried:
std::copy(in.begin, in.end, out.begin);
?
|
|
|
|
|
That will end in tears unless the size of the second vector is large enough. This could be solved by using a back_inserter . The best approach is to simply use "=" or the copy constructor.
Steve
|
|
|
|
|
Stephen Hewitt wrote: This could be solved by using a back_inserter
or out.resize(in.count());
|
|
|
|
|
Simply use "=" or the copy constructor:
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{
typedef vector<int> ints_t;
ints_t first;
first.push_back(1);
first.push_back(2);
first.push_back(3);
first.push_back(4);
typedef ostream_iterator<int> intout_t;
cout << "First:" << endl;
copy(first.begin(), first.end(), intout_t(cout, "\n"));
cout << endl;
ints_t second = first;
cout << "Second:" << endl;
copy(second.begin(), second.end(), intout_t(cout, "\n"));
cout << endl;
return 0;
}
Steve
|
|
|
|
|
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<int> first;
vector<int> second (5,100);
vector<int> third (second.begin(),second.end());
vector<int> fourth (third);
return 0;
}
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Good to see you spelt "colour" correctly.
Steve
|
|
|
|
|
It depends on the particular effect you want. Here's a link to some free source code:
http://www.nuclecu.unam.mx/~federico/gimp/gradient-editor/index.html[^]
I've just glanced at it, so don't know if it's exactly what you want. It uses pointers, but within loops through x and y, so you should be able to modify it to use arrays instead.
On the above page, there is a link to the source code. After you click the link, the source code will look all jumbled together. Go to the Internet Explorer menu and select View, then Source. A new window will then pop up with the proper formatting of the source code.
Hope this is helpful.
|
|
|
|
|
Inside every directory there are two 'folders' with the names of '.' and '..'
Is there a common name for them like 'reparse point' or something?
The reason I ask is that I have created a macro to check for them in a FindFile loop, and IS_INVALID() doesn't really make for clear understanding.
Waldermort
|
|
|
|
|
|
I suppose IS_SHORTCUT() is better than IS_INVALID()
Waldermort
|
|
|
|
|
Or IS_DOSSHORTCUT or IS_DIRSHORTCUT or IS_SHORTCUTDIR...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Or IS_ONEOFTHOSEANNOYINGDOSSHORTCUTSTHATADDUNDESIREDSTRINGCOMPARRISSONS()
Waldermort
|
|
|
|
|
WalderM wrote: IS_ONEOFTHOSEANNOYINGDOSSHORTCUTSTHATADDUNDESIREDSTRINGCOMPARRISSONS
Perfect! Self-commenting too!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If you're using MFC, why not use the IsDots[^]method of the CFileFind class.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
WalderMs there a common name for them like 'reparse point' or something?
I'm not sure if this is the answer you're looking for, but . is a pointer to the Current directory while .. is a pointer to the parent directory.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
I have a worker thread that is posting a registered message to my UI thread to add data items to a combo box. Under extreme conditions, ie. lots of data items to be added, the PostMessage call fails. My suspicion is that the PostMessage is failing because the message queue is full of unprocessed messages that the worker thread has already posted. Besides doing the following, are there any better ways of doing this.
if ( !PostMessage(m_nRegisteredWndMessage, 0, (LPARAM)pItemData) )
{
Sleep(250);
if ( !PostMessage(m_nRegisteredWndMessage, 0, (LPARAM)pItemData) )
{
TRACE1("PostMessage has failed for %s\n.", pSecurities->GetSecurityID());
}
}
Like a PostMessageButYouCanBlockMeIfTheQueueIsFull() call? Thanks.
|
|
|
|