|
Hi,
What I am refering to is When you setup variuos Libraries e.g. $(ProjectSolution) or $(TargetDir) These Variables Have Certain Values
If you were to go Properties-> Configuration Properties the first entry is General on the right hande side is any entry for OutputDirectory if click on the Drop down and go into edit There 3 buttons one of them is "macros" if you click on it you will see all the Variables However you cann't add of Modify them
|
|
|
|
|
Hi all,
I want to write some data in XML format. Actually not to a XML file, just as XML stream. So, I've added some attributes as follows.
pWriter->WriteAttributeString(NULL, L"CharacterCount", NULL, L"5");
As you can see the last argument is a string. But I want to add a int value there, which is calculated from a data map.
I tried as follows.
int char_count = dataMap->first;
pWriter->WriteAttributeString(NULL, L"CharacterCount", NULL, char_count);
but it gives a compile error.
error C2664: 'IXmlWriter::WriteAttributeString' : cannot convert parameter 4 from 'int' to
'LPCWSTR' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast
or function-style cast
How can I do this conversion.
I appreciate your help all the time...
Eranga
|
|
|
|
|
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
|
|
|
|