|
Nathan Going wrote: How does the CSplitterWindow update it's panes
Not sure what you mean. Everything in windows get's painted more or less the same way, in response to a WM_PAINT message.
Perhaps you can rephrase your question for clarity?
led mike
|
|
|
|
|
Ok, start with the CSplitterWindow, if you move the splitter bar left or right, both panes are resized smoothly using a set of calls to SetWindowPos internally. Now I have the CSplitterWindow created as a child of another CWindow derived "View". I catch the WM_SIZE event and call SetWindowPos to set the new size of the CSplitterWindow, when this happens it appears that the entire window gets redrawn, producing a "flicker" effect. In my "view" window, I catch the WM_ERASEBKGND message so it doesn’t happen; also I handle WM_PAINT so I can draw a margin around the CSplitterWindow. I'm trying to find a way to resize the entire window and at the same time reduce the flickering of the contents as much as possible.
Thank you.
|
|
|
|
|
Hi Nathan,
Replace DECLARE_WND_CLASS(xx) in your frame and intermediate windows by DECLARE_WND_CLASS_EX(xx, 0, -1);
BTW your layout is much too complicated. Just paint what you want in your frame window and override the default CFrameWindowImplBase::UpdateLayout() to compute the position of your client window.
cheers,
AR
|
|
|
|
|
When I work for ATL composite project, I inserted ActiveX on the Dialog resource page.
But I can't asign the variable to any control on dialogue. When I use "Add Variable", the wizard doesn't to be enabled the "control variable" check box. So I don't know how to control them by programming from related .cpp file or .h file.
Please suggest me how to handle these controls(especially Activex) by programming.
|
|
|
|
|
I used WTL for windows apps, and ATL for COM, but now need to create a windows application with ATL/WTL that can connect to web service, and probably even more.
I also have a thorough knowledge of web services, remoting and WCF under .Net.
Now how do I merge these two, i.e. where do I find wrapper classes or examples for this kind of communication?
Thank you.
|
|
|
|
|
Dunno that MS do anything for non-.NET C++. This[^] might help though, especially this[^], if WS-* floats your boat. If you're more a fan of REST-ful web services, just use libcurl[^] and a parser for whatever format the payload's in. I've been using libcurl to write a specialized HTTP client in Haskell[^] - it's made the job very easy.
|
|
|
|
|
Thanks, I will look into this.
|
|
|
|
|
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
|
|
|
|