|
what if i use bitblt to draw the rectangle?
However, there is a problem i faced, after i've bitblt, the background turns to be black color. I just don't why?
"BitBlt(Hdc, 0, 0, pClass->m_ComputerResolutionX, pClass->m_ComputerResolutionY, pClass->m_MemDC, 0, 0, SRCCOPY);"
The bitblt was done in WM_PAINT.
Anyone has any ideas?
|
|
|
|
|
I'm not sure why this question was posted to me.
It's time for a new signature.
|
|
|
|
|
Additional to the words of Richard
this "dotted rectangle"[^] could be used...
virtual void BeHappy() = 0;
|
|
|
|
|
Hi,
How to resize the controls in a form view to fit to the availble size.
I have developed one formview application with screen of 1024X768.
When this application runs in another system having more or less resolution
it seems to be ugly.
How to resize the controls in a formview regardless of the resolution?
|
|
|
|
|
This[^] layout manager should do the work.
|
|
|
|
|
|
I was wrong. I forgot to add the 'class' in the syntax of the template! Extremely sorry for the inconvenience.
modified 7-Feb-12 1:20am.
|
|
|
|
|
Visual C++ 6.0 has lots of standard compliance problems[^], but it will be not fair to accuse it before analyzing your code.
|
|
|
|
|
Post the code please.
It is best to always assume that the tool, API etc are correct and the problem is in our code. And it usually will turn out to be so. Especially since, as you say, there were no problems with the earlier template class.
...byte till it megahertz...
|
|
|
|
|
Post SOME of the errors and the relevant code.
and in general rule, if an installer was not finished, you need to wait for it to finish and/or "repair" and/or re-install .
Watched code never compiles.
|
|
|
|
|
Hi guys!
I am currently doing a client/server connection through the sockets. And facing some problems.
My task definition: Create a socket for each connected clients to the server. Use the threads to maintain waiting process and message send-receive process.
So, right now I have 2 clients and one server. I created 2 threads, first one supports to listen when clients try to connect to server. The second one provides to receive and send the messages.
However, the problem is : when I create first thread (hThread1), the second has not turn means always hThread1 works and does not allow to start to hThread2.
Please help!
Anywhere I attach essential sides of my code and let's discuss it. Even though I am new at C++, I believe I could do it with you guys.
Thnks!
DWORD createSocket(char *, int); //prototype of createSocket function for each clients
DWORD receiveMsg(SOCKET); // prototype of a receive message function
DWORD threadId;
HANDLE hThread1 = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)createSocket(IP_Addr, port), port, 0, threadId);
if (hThread1 == NULL)
{
cout<<"Error at creating thread..."<
|
|
|
|
|
mashhur wrote: My task definition: Create a socket for each connected clients to the server. Use the threads to maintain waiting process and message send-receive process.
Start with a working networking example, creating a multi-threaded server in C++ is not a trivial task.
Have a look at Internet and Networking and Winsock FAQ[^].
Hope this helps!
|
|
|
|
|
Hello,
we know use cricheditctrl to show string. but it's limit 64K.
when I open a big text(about 8M), it can't work.
how to show the big txt?
yfpfly
|
|
|
|
|
You can set a new limit for your CRichEditCtrl by using LimitText[^] but this can lead to performance problems.
Have a look at this[^] MSDN article for additional details (it is mainly about CEdit and CEditView but it also contains a section about CRichEditCtrl ).
|
|
|
|
|
Hello,
I find thant CRichEditCtrl's stream (in/out) method can Read (write) text
quickly, and it support large *.txt document.
but I want to tranlate the text to my string array.
now the problem is : how can I translate between EditStream and string array
thanks
|
|
|
|
|
Hi guys i want to write a module which process user name and password.It's console software But i don't know how to hide the password when typing in the console like ********.If anyone know how to do this pls tell me......
Thanks in Advance
|
|
|
|
|
You could try using _getch[^] to read up the characters yourself and simply output astericks or whatever. Or maybe you could try redirecting stdout for the time of the password entry, don't know how that would work though.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
What Code-o-mat told will work for you. Here is the code snippet.
char strPasswrd[100];
int i = -1;
do
{
strPasswrd[++i] = _getch();
cout<<'*';
}
while(strPasswrd[i] != '\r');
strPasswrd[i] = '\0';
cout<<endl;
cout<<strPasswrd;
|
|
|
|
|
Hi Cool_Dev your code is very helpful to me but the problem is it also print one * for '\r' also
|
|
|
|
|
couldn't you re-write it as..
char strPasswrd[100];
int i = -1;
strPasswrd[++i] = _getch();
while(strPasswrd[i] != '\r')
{
cout<<'*';
strPasswrd[++i] = _getch();
}
strPasswrd[i] = '\0';
|
|
|
|
|
Hello,
I wanted to move the implementation of some of my functions to a DLL and update only the DLL and do not touch the GUI.I normally use STL and i learnt that STL and DLLs together can create some problems. Lets say i have such a function below and that Point3D vector will be given from another DLL (which deals IO stuff).
1. DLL
TEST_API double calcPerimeter(const std::vector<Point3D>& pts)
{
double p = 0.0;
for(std::size_t i = 1; i < pts.size(); ++i)
p+= calcDistance(pts[i-1],pts[i], false);
p = sqrt(p);
return p;
}
2. DLL
i want to export a std::vector<point3d> from a function.
Will this work or even if it works under what conditions? By the way, I will use the same compiler for exe and dlls.
How will you implement above? (a very simple data holder (Point3D vector) in a DLL and in another DLL just bunch of functions which operates on that data?
Best Regards.
Bekir.
|
|
|
|
|
Provided you use the same compiler and probably linker, the same compiler and linker settings (with a few exceptions to do with building DLLs) then you can do what you want without any problems. The fun comes with DLLs when people wonder why they can't link C++ DLLs with EXEs written in C or on another C++ compiler.
Cheers,
Ash
|
|
|
|
|
Additional to what Aescleal wrote, do not use STL across library boundaries if you can avoid it! Unfortunately, it's not guaranteed to be binary compatible and can cause you troubles in the long run. Nasty things can happen when you mix compilers or STL versions, hard to debug.
Cheers
|
|
|
|
|
Thank you for the answers.
I will look at options to remove that STL vector, any recommendations ?
Bekir.
|
|
|
|
|
I hate to say it, but in this case use only fundamental/primitive types and pointers. For example use as arguments buffer and buffer size/elements, avoid unnecessary data copying, e.g. caller provides buffers big enough to hold results.
You gave a function using STL, here is a slight variation of it:
TEST_API double calcPerimeter(const Point3D* pPoints, int nElements)
/M
|
|
|
|