|
You might want to look at this[^]. See the description for the sproxy.exe tool
led mike
|
|
|
|
|
Thanks a lot, I will give it i try.
|
|
|
|
|
That's cool - I never realised ATL Server had client side stuff like that as well. I'll have to remember that if I'm ever stuck doing SOAPy web services clients.
|
|
|
|
|
int i,j;ifstream infile(L"data.txt")infile>>i>>j;
string a,b;infile>>a>>b;
Any STL way to do this?
system
|
|
|
|
|
Presuming you want a to contain "aa" and b to contain "bb" , the code you've posted does precisely that with gcc (precisely, g++ 4.0.1 on OS X Leopard).
To provide you with any help beyond that (which isn't much help), it would help if you stated:
- What compiler you're using
- What you expect the code to do
- What actually DOES happen
|
|
|
|
|
I use VC9, and want to do just as you said, but it throws an excetpion.
system
|
|
|
|
|
followait wrote: I use VC9, and want to do just as you said, but it throws an excetpion.
OK....now, WHAT exception is it throwing?
It'll be derived from std::exception , so try something like:
<code></code>try {
std::string a, b;
infile>>a>>b;
}
catch(std::exception&e)
{
std::cerr << e.what() << std::endl;
}
This will print out the exception message, which should give some pointers.
|
|
|
|
|
OK - I've just tried the following program with VC9 (now I'm @ work, with Windows rather than OS X)
#include <iostream>
#include <fstream>
#include <string>
int main(int, char**)
{
std::ifstream f("a.a");
std::string a, b;
f >> a >> b;
std:: cout << "a = \"" << a << "\"\n";
std:: cout << "b = \"" << b << "\"\n";
} I compiled it with the command cl -EHsc a.cpp (-EHsc explicitly turns on exception handling, stopping a VC++ warning, while a.cpp is the source file name) and ran it using the following text in a file called a.a
string_a string_b When I ran it, there were no exceptions and no unexpected behaviour; it produced this output:
a = "string_a"
b = "string_b" So - to extend my previous list of questions - how are you building the code?
|
|
|
|
|
Hi
I want to create a Dialog on Toolbar Button Click , Dialog is Create when Every New Instance of IE is open (It's Working) (Means New IE is Open at that time Dialog is open) But IE7 Having multiple Tab ,I want that if my Dialog is open on IE7 1st tab It is not open on Other Tab of IE7 . But I open Another IE from That Dialog is open.
Thanks in Advance.
|
|
|
|
|
Did you make a toolbar plugin, or did you add a button to an existing IE toolbar? If it's the former, IE creates one instance of your toolbar for each tab for backcompat reasons. You'll need to keep a flag somewhere where all instances can read it that indicates whether your dialog is already open.
|
|
|
|
|
Hi Eric,
i have made toolbar for IE in VC6 using RBDESKBAND Wizard. I am not able to capture the IE Events.
Will you guide me the steps to capture IE events mainly onDocumentComplete in toolbar so that the
functionality will be in toolbar perform according to ondocumentcomplete events value.
I have even upgrade this (VC6) code to VS2005 & facing same problem.I want to use the toolbar for
IE6,7,8.
Pls. give your suggestion to comeout from this problem.
Thanks.
|
|
|
|
|
HI
I am new to this STL form. I have a simple question, unique does not work as expected.
Here is my test code
int iList[4] = {0};
iList[0] = -131;
iList[1] = -131;
iList[2] = -343455555;
iList[3] = -131;
vector<int> iNeighborList(iList, iList + 4);
vector<int>::iterator it;
it = unique(iNeighborList.begin(), iNeighborList.end());
iNeighborList.resize(it - iNeighborList.begin());
it = remove(iNeighborList.begin(),iNeighborList.end(),-343455555);
iNeighborList.resize(it - iNeighborList.begin());
int isiz = iNeighborList.size();
I am using VS2005 to compile it using Pure MSIL (/clr:pure) switch.
Can anybody help me why I am getting uncexppected result.
Thank you
|
|
|
|
|
Hi
Is there anybody know, what mistake I made in the code .
Thank you
|
|
|
|
|
Your problem is that your expectation of what unique does is incorrect. In the MSDN Documentation for Visual Studio 2008 (and the C++ Standard says the same, but in slightly different language), it says:
Removes duplicate elements that are adjacent to each other in a specified range. Only the first two elements of your array are of equal value and adjacent to each other.
|
|
|
|
|
Hi
Thank you for your good point.
Is there any function which can find unique elements in an array vecor even though unique elements may not be adjacent.
|
|
|
|
|
If the order of elements is unimportant, sort the vector (with std::sort ) before using unique .
Otherwise, try something like:
#include <set>
#include <vector>
#include <iostream>
#include <iterator>
struct Finder : std::unary_function<bool, int>
{
Finder(std::set<int>& s) : s_(s) {}
bool operator()(int i) const
{
if (s_.count(i)==0)
{
s_.insert(i);
return false;
}
else
{
return true;
}
}
std::set<int>& s_;
};
int main(int, char**)
{
std::vector<int> data;
data.push_back(1);
data.push_back(3);
data.push_back(2);
data.push_back(1);
data.push_back(5);
data.push_back(1);
std::copy(data.begin(), data.end(), std::ostream_iterator<int>(std::cout, ", ")); std::cout << std::endl;
std::set<int> uniqueItems;
data.erase(std::remove_if(data.begin(), data.end(), Finder(uniqueItems)), data.end());
std::copy(data.begin(), data.end(), std::ostream_iterator<int>(std::cout, ", ")); std::cout << std::endl;
return 0;
}
It's not too pretty, but should work OK. And if you parameterise Finder , you can re-use if you need to do it again
|
|
|
|
|
|
The definition of your functor is wrong. You have:
Stuart Dootson wrote: struct Finder : std::unary_function<bool, int>
It should read:
struct Finder : std::unary_function<int, bool>
Here's the definition of std::unary_function from <functional> :
template<class _A, class _R>
struct unary_function {
typedef _A argument_type;
typedef _R result_type;
};
The result type comes second, not first (which I've always thought was strange).
Also, you should be #include ing <functional> for std::unary_function , as things stand you seem to be relying on some other include file including it indirectly.
And finally, this technique is not very efficient. Try something like this:
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
void main()
{
using namespace std;
typedef vector<int> data_t;
data_t data;
data.push_back(1);
data.push_back(3);
data.push_back(2);
data.push_back(1);
data.push_back(5);
data.push_back(1);
cout << "Contents before:" << endl;
copy(data.begin(), data.end(), ostream_iterator<int>(cout, " "));
cout << endl << endl;
sort(data.begin(), data.end());
data_t::iterator new_end = unique(data.begin(), data.end());
cout < "Contents after:" < endl;
copy(data.begin(), new_end, ostream_iterator<int>(cout, " "));
cout << endl << endl;
}
Steve
|
|
|
|
|
You might note the first sentence of the post you're replying to:
If the order of elements is unimportant, sort the vector (with std::sort ) before using unique .
The whole reason for using the set and stuff is to preserve the order of the elements.
|
|
|
|
|
|
|
Hi, I just want to know if it's possible to access a vector object by it's unique id.
In vector objects don't have id's you can just access them by their locations!
for example:
std::vector<myobject> objs;
objs.at(1).my_property = 'qwerty';
here 1 is the location of the object in that vector and it's not unique..
it can change if you delete or add a object on top of this object.
but i want to give them a unique id and access them by that.
Any suggestions?
|
|
|
|
|
Use std::map or std::hash_map . Use the unique ID as the map's key, the object as the associated value.
#include <map>
class MyObject
{
...
int UniqueID() const;
...
};
std::map<int, MyObject> myMap;
To insert an item:
MyObject o;
myMap.insert(std::make_pair(o.UniqueID(), o));
To retrieve an item:
MyObject anotherO = myMap[someID];
|
|
|
|
|
I have a problem with an OLE document container, which is developed in VS 6.0 and by the use of ATL no MFC is involved.
It is so when a document is loaded in the container it is loaded maximized and the menu with comes with the document is show ok. But if I restore the document down and then maximize it again then is the menu/toolbar, which comes with the document, not correctly redrawn. If I then minimize the document and then maximize it seems to be OK again. I have tried to search for similar cases on the internet but no luck so if anybody have a proposal to the solution then it would be great - many thanks in advance.
Jakob
|
|
|
|
|
Hi
I want to create a combobox and Insert/attach a ActiveX Control for writing in Hindi , So How can I Insert/attach ActiveX Control on ComboBox .
dabara
|
|
|
|