|
Works same.
In usual method- yes,
in this - no any difference in problem.
|
|
|
|
|
It sounds like something else is setting the cursor, then.
You could also try to catch WM_SETCURSOR, and use a boolean set to true when your application is working:
BOOL CMyView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if(m_bMyAppIsWorking){
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
return TRUE;
}
::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
return CView::OnSetCursor(pWnd, nHitTest, message);
}
Silence Means Death
Stand On Your Feet
Inner Fear
Your Worst Enemy
|
|
|
|
|
Please explain what nature of error that was happen?
First is need to understand fully,
than to solve by try and error.
|
|
|
|
|
In the example I gave, the processing of WM_SETCURSOR by the view leads to set the cursor either at IDC_WAIT or at IDC_CROSS, whatever another part of your code set the waitCursor.
vgrigor wrote:
First is need to understand fully,
than to solve by try and error
IMHO, not always, sometimes it doesn't worth the time to learn it.
Silence Means Death
Stand On Your Feet
Inner Fear
Your Worst Enemy
|
|
|
|
|
Of course,
Worth - when it is possible.
It is usually (or often ) possible - to understand something, than only try and error.
that is often proposed.
|
|
|
|
|
Ensure that in your WORK() method nothing is trying to steal the capture of the mouse. Check for SetCapture() API calls.
|
|
|
|
|
how to replace char array[15] with string field?
|
|
|
|
|
Simply move the array into the string.
char array[15];
string str = array;
William
Fortes in fide et opere!
|
|
|
|
|
But I do I deal with indexes in array after I move everything into string?
|
|
|
|
|
Use the [] operator.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Like this?
char array[15];
string str[] = array;
|
|
|
|
|
No, like this:
char array[15];
string str = array;
if (str[3] == array[3])
...
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i don't understand what does"replicated servers" mean
|
|
|
|
|
There are several functions whose prototypes are the same. Because each is dependent on the preceding one to return a certain value, I thought, puttting them (the functions) in an array, and executing them from the array would be easier.
The syntax of the statements are correct, but when the program executes, the functions don't get activated.
Might someone see why this is happening? Here's the code.
class MyClass
{
enum PStatus { NoError, InvalidCode, OutOfRangeAmt, etc. };
PStatus Func1();
PStatus Func2();
PStatus Func3();
};
================
later in the program, I do this.
...
PStatus PS = NoError;
const int n = 3;
typedef bool (MyClass::*PTF)();
PTF FuncArr[n] = { MyClass::Func1, MyClass::Func2, MyClass::Func3 };
...
for(int i=0; i<n && PS==NoError; ++i)
FuncArr[i]; Even when I removed the "PS==NoError" part of the condition, the functions still didn't get activated.
Perhaps I should also mention, when I coded:
PS = FuncArr[i]; in the "for" statement, the compiler complained. (FWIW, I put certain message in each function to let me know they were entered. No such messages were shown.)
Thanks for any insight.
William
Fortes in fide et opere!
|
|
|
|
|
you cannot call a member function of C++ class without an object
you have to have an object and through that object you can call the member functions
if
class A {
void DoStuff();
};
then A a;
a.DoStuff();
now DoStuff knows from which object it was instantiated throug a hidden this pointer
we cannot simply call DoStuff() , if DoStuff is not a Static Function
|
|
|
|
|
Thanks for replying.
If I'm correct, I believe ALL objects of a certain type, share the same functions of that particular type, which means by qualifying the functions with its class name, I am specifying its type.
This does not hold true for the data portion of objects of the same type. To reference the data portion of an object, you must qualify it with that specific object.
In any case, even when I do the following, the functions still do not get activated.
PTF FuncArr[n] = { this->Func1, this->Func2, this->Func3 };
William
Fortes in fide et opere!
|
|
|
|
|
I can think of two things here:
1) AFAIK you have to put the paranthesis on the pointer before calling:
PS = (*(FuncArr[n]))() (I'm not too sure on the syntax, see MSDN)
your code FuncArr[n] only returns the adress stored in FuncArr.
2) Your Func1() (or Func2() etc) expects a this pointer as a parameter, so you'll corrupt your stack by not having an instantiated object. If you don't want this object you should make your Func's static.
happy hunting
Steen
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
you can do the following;
PTF FuncArr[] = { &CMyClass::Func1, &CMyClass::Func2, &CMyClass::Func3 };
int n = GetDesiredFunc();
CMyClass anObj;
bool retval = (anObj.*FuncArr[n])();
I think that should do the job..
Greetz,
Davy
|
|
|
|
|
How to enumerate pnp devices by their type? Subject of interest - unknown and unsupported devices.
|
|
|
|
|
Perhaps this article from MSDN will be of help. Not really one of my strong points, this one, but happy reading nevertheless: Enumerating Current Devices[^].
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thank you for you trying to help me, but
this sample enumerates devices with properly installed drivers. I need to enumerate devices of "Unknown" or "Unsupported" type. These devices has no GUID in the system registry, and I guess I can't enumerate them using this SetupAPI. Anyway it seems they are not appeared in the HKLM\System\CurrentControlSet entry in the System registry.
But I can be wrong.
|
|
|
|
|
Construct a reliable and efficient news service for users over a network of computers (with only one news group).
The service:
------------
Every user can connect via a news client to any one of replicated servers.
The news service provides the following capabilities:
1. Login as a user.
The GUI-based client mrn needs to login with a user to perform any of the tasks below. You should allow the client to login as a new user as part of the menu by specifying the user name.
2. Connecting to a server.
The client needs to connect to a server to perform any of the tasks below. You should allow the client to change its server as part of the menu, by specifying the server index. At any point, the client may be connected to one server only. To connect to a server, all a client needs to do is to set this server as its serving server.
3. View list of headers of available messages (The service should distinguish between messages that were already read by this user, and unread messages):
The view should include the user name, the responding server index and list of message headers. The headers in the list will be numbered (1, 2, 3, ...) the header should contain a subject and author.
Each request for a view should result in the most updated information possible.
4. Post a message:
subject: <subject string="">
<msg string="">
The size of the msg string can be bounded to 1000 bytes.
5. Delete a message (read or unread):
Will allow to delete a message from this user's view only, by its number or by pointing on it.
6. Read a message (read or unread):
Will allow the user to retrieve the content of a message by its number.
The message should be marked as read for this user thereafter.
The News Servers:
-----------------
The news client connects to one of the server processes. Each of the server processes is a background daemon. The server may crash and may subsequently recover. The overall set of servers is not fixed. A server is started with its id as a parameter with the command mserver[1-5].
The users must always receive a consistent view of the single news group, regardless of which server is consulted (of course, as consistent as possible, according to the network connectivity).
The view should be consistent as to which messages are available,
have been read or deleted by this user. Each server should save information separately on disk.
A news message should be expired by the system 300 seconds after its creation. After expiration, the message should not be available for users.
At some point after expiration, the message should be deleted without trace to it in the system's data structures (garbage collection).
Crashes of the servers and clients should be managed by a separate program mcrash pid. A crashed server exits the program immediately! it is not legal to write to disk after a server receives a kill signal.
When a server crashes, clients connected to that server will report the loss of connection to the user, so that the user can connect to another server and continue posting/receiving messages.
The users are not known beforehand, and their number is not bounded.
Summary
-------
These are 3 programs:
The client mrn
The server mserver
the crasher mcrash
Requirements
------------
- System produces correct results for all inputs, except those specificly listed as not required.
Deliverables:
-------------
1. Source files (.c not the stubs) and any .h isn't automatically generated by the rpcgen.
2. A listing of execution.
3. Final report.
|
|
|
|
|
Cool homework Sounds more advanced than anything I was assigned for my CS Degree..
Could you be a little more specific about what help you need? It looks like a lot of work, and some of us have to work for a living.
Ryan
|
|
|
|
|
if you can help me with this to not flunk the course, you can ask what ever u need
|
|
|
|
|
1. Thank you for admitting this is a homework question. When people try and hide this we can get irate.
2. Although we would like to help you, its better if you present what you have managed to do so far and where you have got stuck. Being presented with a complete answer circumvents the learning process which we here at CP would like to encourage. There is no better way of learning than getting your feet wet. Once you have paddled around for a while, we will be happy to help you out in deeper waters.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|