|
So your problem is how to draw on your window even if other dialogs or windows are on top of it?
|
|
|
|
|
Yes. That's my meaning.
Thx!
|
|
|
|
|
How do you draw to your window? Do you use CDC?
|
|
|
|
|
yes. I use CDC to draw some bitmap file in window. The problem is: I take some other window on this window and then take them below. The area occured by other window is be drawn. The other area isn't be drawn and still be blank. That's all. I hope u and some others can tell me how to resolve it.
Thx!
|
|
|
|
|
I experienced the same thing before. What I did was I made the CDC handler for the window into a global variable. Try that first if it works.
|
|
|
|
|
|
If you are coding in MFC, you can use the pDoc->UpdateAllViews (NULL) as well. If the code in your main view is in the OnDraw () this command will update it, doesn't matters where in the Z-Order is.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
|
|
|
|
|
Hello, again.
I'm working on a program and i need to execute a command line entry from my program in MFC. My problem is how can I call commad promt and how will I execute an entry from my program. I'm using VC++ 2003.
Please comment on how to do this or found a link for this matter.
Thank you
|
|
|
|
|
try CreateProcess with cmd.exe as the application
|
|
|
|
|
|
|
That has nothing to do with templates - polymorphism works only with pointers or references, not concrete objects. Try this instead:
#include <iostream>
#include <deque>
using namespace std;
class A
{
public:
virtual void test() {cout << "A\n";}
};
class B : public A
{
public:
void test();
};
void B::test()
{ cout << "B\n";}
int main(int argc, char **argv)
{
A* x = new B();
deque<A*>* d = new deque<A*>();
d->push_back(x);
for(deque<A*>::iterator itD = d->begin(); itD != d->end(); itD++)
{
(*itD)->test();
}
delete x, d;
return 0;
}
BTW, why are you creating the deque on the heap?
Programming Blog
utf8-cpp
|
|
|
|
|
Oh, and I don't think the line
delete x, d;
is doing what you think it is doing
|
|
|
|
|
That is one tricky expression!
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
It's hard to tell without being able to see how you defined "d", but are you using
a reference or pointer type?
For example, this works as expected:
A* x = new B();
deque<A*> d;
d.push_back(x);
for(deque<A*>::iterator itD = d.begin(); itD != d.end(); itD++)
{
(*itD)->test();
}
delete x;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: but are you using
a reference or pointer type?
Can't you just assume he is? I think they should just add 'assume' as a C++ keyword, that would solve a lot of CodeProject questions.
Great fishing today eh? I bet you can bag your limit in like 5 minutes. Last modified: 14mins after originally posted --
|
|
|
|
|
led mike wrote: Great fishing today eh?
Actually it's been great for quite a while now....must be related to global warming
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: must be related to global warming
fatboy's going to get you for that!
|
|
|
|
|
led mike wrote: fatboy
Exactly...I'm trolling for the big one!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Edit your post so the "<" and ">" characters and what's between them can be seen! I can’t see what files you’re including or what specialization of deque you’re instantiating. This information is obviously important. Do you review your posts or what?
Steve
|
|
|
|
|
Hey all,
I wrote a simple TCP server client application, where client is sending some text to the server.
I based the implementation on Nish's article: http://www.codeproject.com/internet/winsockintro02.asp.
But I have one problem. For example, when I want to send data "hello" to server, I use the send(..) method, for which I have a correcsponding receive(..) method on the server side.
My problem is that if I want to send for example two data objects: "hello" and "hello again", with two 1. send("hello",..); 2. send("hello again",..); and two receive(..); receive(..); methods. I am still not managing to receive data on the server side in the appropriate order. Sometimes I will receive "hellohelloagain" sometimes I will receive data as I had sent them, i.e. "hello" and "helloagain".
Can anyone give me a clue how to implement the program such that I can seperately send differenttext data from client, i.e. text[1], ...., text[n] and easily receive this data in the same manner, on the server side ?
Thanks.
|
|
|
|
|
TCP is a stream based protocol - it only understands a stream of bytes.
It's up to you to parse the bytes into meaningful sequences.
You need to design a protocol on top of TCP so the receiving end knows how many bytes to expect.
This could be a fixed-length "packet" scheme.
A simple, more effiicient scheme is to pass the data length first (for example, a 4-byte int - don't forget
byte order issues!) before passing the data. The receiving end first receives the count, then it knows how
many bytes follow.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark. I thought so...
What I am currently doing is receiving text seperated by ";" and parse them appropriately..
|
|
|
|
|
How do you do that efficiently without knowing how many bytes to receive?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I just assume that the maximum length of text should be 512 bytes, for example. Not sure if it is very efficient
|
|
|
|