|
I Checked the handle return from CreateEvent
it had a valid Value
I added code to Create Security DisCriptor TO the Create Event
I am going to try that out
The Only thing I am not 100% certin is Whether Readfile And Write
Share/Inherit the same OverLapped.hEvent
Logically it would seem they would
|
|
|
|
|
Did you check the error using GetLastError()? What's the error code/message you're getting?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Yes it was 0x002 FILE_NOT_FOUND
Does really make sense ???
|
|
|
|
|
ForNow wrote: Yes it was 0x002 FILE_NOT_FOUND
Does really make sense ???
It should make sense. I strongly believe the event doesn't exist in the system when you tried to open it. So please check the source where the even being created and also check if the application calling "CloseHandle" before spawning the child process.
Debug your client program and just before you open the event, verify whether it exists or not using tools like WinObj.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
|
I couldn't get anywhere with WinOBJ However I did notice the Handles Column in Task Manager go up by one
When after I executed the CreateEvent
|
|
|
|
|
Hope you've created a named object. The objects with exclamation mark represents events. The tool lacks a "Find" option. Sort it and find it out yourself. Kernel objects will be appeared under "BaseNamedObjects" in the tree
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
The Event I have Created is named While stepping thru the Code with the Visual Studio Debugger after CreateEvent seems like a Handle is Returned
However when I go to WinOBj under --> KenerelObjects Tab there are only two named events HighMemoryCondition and LowmemoryCondition
|
|
|
|
|
I wrapped the event name inside the TEXT macro for Create and Open Event
and it worked
|
|
|
|
|
How you'd able to compile the source code?
OpenEvent() is Unicode ANSI compatible. if your project settings is to use Unicode character set, then you will have to pass Unicode string.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
I changed that in the Build to non unicode I seem to be
making progress
|
|
|
|
|
|
you havnt been around here for long, so you probably missed the bit that goes "we dont do people's homework/assignments/yada yada", even if we do feel a little sorry for them ...
If you post any attempt at code you've got we can use that as a starting point...
I'd suggest (since you say you're using c++) you look at :-
'string' : to hold the filename and a copy of each line in the file - you should only need two string instances to start with
ifstream : to access a data 'stream'/file for input
getline : to get one line of input from the stream/file into a string
while :(loop construct) to loop for all lines in the file until eof (end-of-file) is detected.
for starters.. you'll need to include appropriate headers - I'd suggest fstream, iostream and string ... once you can loop through a file and print its output to 'cout' or such, then think about how each line in the file needs to be split up/parsed to go into your array
'g'
|
|
|
|
|
Hey everyone,
I've been getting some rather interesting results from my LL_KEYBOARD hook recently. Here is my code:
LRESULT CALLBACK LowLevelKeyboardProc (INT nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode < 0 || nCode != HC_ACTION)
return CallNextHookEx( hKeyboardHook, nCode, wParam, lParam);
KBDLLHOOKSTRUCT* p = (KBDLLHOOKSTRUCT*)lParam;
char logchar=(char)p->vkCode;
It was working fine for a week, but I was adding KEYUP detection for the Ctrl, Alt, and Shift keys when it started giving me unexpected results.
The problem is that when I press the Ctrl key, logchar is equal to -72. I'm surprised by that, since I'm pretty sure the vkCode for the control key is 0x11. Because of this, I'm not detecting the Ctrl keypress, and ToAscii outputs the value for the ctrl key incorrectly. (It's outputting something that looks like a cent sign. If someone could explain why ToAscii accepts -72 as a valid vkcode that would also be appreciated)
The same problem occurs with any non-character key (except for space).
If anyone has any ideas on this I would highly appreciate it.
Thanks in advance.
|
|
|
|
|
the char type has the range of -127 to 128. you want to use an unsigned char which has the range of 0 to 256.
|
|
|
|
|
Ok. I changed it and now the ctrl key is giving a value of 162, which is still not equal to VK_CONTROL (0x11).
|
|
|
|
|
It is however equal to VK_LCONTROL.
|
|
|
|
|
So every time I press the left control key I get a VK_LCONTROL value? Does that mean that the right control key is VK_RCONTROL?
If so, why did the vkcode equal VK_CONTROL a few days ago? I had a switch statement on logchar, and on case VK_CONTROL I would print out [CTRL]. It worked fine until two days ago.
Finally, are there any keyboard drivers that do not seperate VK_LCONTROL from VK_RCONTROL and instead just give a VK_CONTROL value?
Thanks for your help.
|
|
|
|
|
I would like to know, the above mentioned,
for a car racing game,
would the server be able to handle say a thousand cars.
Can anybody suggest a means of testing such a venture?
I am working in MFC at the moment.
Thanks Simon.
|
|
|
|
|
|
One thousand sockets doesn't sounds like impossible. I guess you will hit limitations somewhere else, for example traffic limitation of your internet provider or performance bottlenecks in your server (who has to handle and distribute events to all clients).
Hope it helps.
|
|
|
|
|
I have an app that uses several CFormView objects. I set a default title to each of them when adding their frame windows to the document. I also set a new title in the OnUpdate function of these views based on the value of a member attribute. When the view is invoked it displays the title/caption in the title bar but, strangely, looses the title when loosing focus. The titles becomes ":1", ":2", etc. for these views if I switch from them to other views. To get back the title, I have to force an update so the OnUpdate gets called and the title is reset.
I am sure it's something very minor that's causing it but not sure what it is. Any feedback is very much appreciated.
|
|
|
|
|
Hi,
I want to split my window in 2 row but the below code is giving exception.
What is wrong with this?
<br />
CFrameWnd::OnCreateClient(lpcs, pContext);<br />
if (!m_wndSplitter.CreateStatic(this,2,1))<br />
return FALSE;<br />
<br />
m_wndSplitter.CreateView (0,0, RUNTIME_CLASS (CTreeFileRecovered),CSize (245,120), pContext);<br />
m_wndSplitter.CreateView (1,0, RUNTIME_CLASS (CListFileRecovered),CSize (100,400), pContext);<br />
<br />
return TRUE;<br />
|
|
|
|
|
Not enough info. What is the exception and what line of code is giving it?
|
|
|
|
|