|
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?
|
|
|
|
|
|
Hello everyone,
I have made some experiment about poi command. But
always met with syntax error, here is my source code, and
related commands in WinDbg. My purpose is to deference
the memory which is holds by variable b, so that the value
of variable is displayed. Any ideas?
0:000> dv
b = 0x00000000`0012feb4
a = 200
0:000> poi (b)
^ pass count must be preceeded by whitespace error
in 'poi (b)'
0:000> poi (0x00000000`0012feb4)
^ pass count must be preceeded by whitespace error
in 'poi (0x00000000`0012feb4)'
#include <iostream>
using namespace std;
int main()
{
int a = 200;
int* b = &a;
return 0;
}
thanks in advance,
George
|
|
|
|
|
Hello everyone,
I think extern C is enough to prevent name from decorated, but when we export function names from a DLL using dllexport, even if we declare at the same time with extern C, but without a DEF file to define un-decorated exported function names, the name is still decorated.
I do not know why DEF file is needed? extern C is not enough to control name decoration for both DLL exported names and current DLL model linking?
regards,
George
|
|
|
|
|
George_George wrote: I think extern C is enough to prevent name from decorated
Don't think this is exactly true. C functions are also decorated based on calling convention.
See: http://msdn.microsoft.com/en-us/library/x7kb4e2f.aspx[^]
As an example; in .cpp:
extern "C" {
__declspec(dllexport) int MyFunc ( int A ) { return(A*2); }
}
and in .def (in EXPORTS):
MyFunc @3
'DumpBin /exports mydll.lib' will report '_MyFunc' as the name.
If, we used:
extern "C" {
__declspec(dllexport) int __stdcall MyFunc ( int A ) { return(A*2); }
}
then, even with the .def entry, dumpbin will report '_MyFunc@4' as the name.
What are you using to view the name ?
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi cmk,
Your reply is excellent. I have tried but have different results. In the document you recommended, it is mentioned default calling convention is __cdecl, and the resulting name in DLL should begin with sign _.
But my result is the default calling convention __cdecl results in name without _ sign? Here is my code and my output. Any ideas?
I am using VS 2008, Debug build for Win32.
D:\Visual Studio 2008\Projects\TestDll2\Debug>dumpbin /exports TestDll2.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file TestDll2.dll
File Type: DLL
Section contains the following exports for TestDll2.dll
00000000 characteristics
48E8B6E6 time date stamp Sun Oct 05 20:45:26 2008
0.00 version
1 ordinal base
2 number of functions
2 number of names
ordinal hint RVA name
1 0 000110AF MyFunc1 = @ILT+170(_MyFunc1)
2 1 0001106E _MyFunc2@4 = @ILT+105(_MyFunc2@4)
Summary
1000 .data
1000 .idata
2000 .rdata
1000 .reloc
1000 .rsrc
4000 .text
10000 .textbss
extern "C"
{
__declspec (dllexport) int MyFunc1 (int A) {return 100;}
__declspec (dllexport) int __stdcall MyFunc2 (int A) {return 100;}
}
regards,
George
|
|
|
|
|
The default _cdecl is standard, the _ prefix is used by all vendors.
Other calling conventions are vendor specific (__stdcall is only MS i think).
Use extern "C" {} _and_ the default _cdecl when you want to create a dll with one compiler that can be called by an exe compiled using any other compiler.
If you have a .cpp file all functions will be named using C++ naming - mangled. If you have a .c file all functions will be named using C naming - mangled as described in the url i posted in previous message. The default _cdecl .c naming is considered by most to be unmangled, even though it is (leading _).
Using extern "C" in a .cpp file, or extern "C++" in a .c file, just allows you override the default naming the compiler uses based on the file extension (.c or .cpp).
In your dumpbin output MyFunc1 _is_ mangled (_MyFunc). The default is so standard that the _ is often dropped from display - but it is there.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Thanks cmk,
1.
If from dumpbin, we can not see the leading _ sign in my sample, then how could you find the leading _ sign is there? From which tool? Is it a bug of dumpbin which does not accurately?
2.
I am interested in your comments -- "extern "C++" in a .c file, just allows you override the default naming " -- do you mean using extern C++ in a .c file using C++ compiler, we could make the c program using C++ name mangling?
regards,
George
|
|
|
|