|
Thanks Michael!!! Saved me again as usual.
I also found the answer in MSDN Q184796 together with an example.
|
|
|
|
|
Are there any web sites about "AI(Artificial Intelligence)"?
Thanks,
Maer
|
|
|
|
|
|
You might take a look at www.gamedev.net
regards
|
|
|
|
|
http://cs.felk.cvut.cz/~xobitko/ga/
Enjoy it....
Nice weekend
Carlos Antollini.
Today is Friday....
SSShhh Bob!!!
|
|
|
|
|
Hi, Antollini!
It is a nice site!
Regards,
Maer
|
|
|
|
|
What means "dependency loops in the DLL load order"? (from MSDN "DllMain")
Can you show me an example?
Thanks,
Maer
|
|
|
|
|
How to precisely create a CEdit that contains 6 rows with 10 characters in a row? (the font and size of the characters are not certain, so we must get the width and height of the font, but I do not know how to do that)
Can you show me an example?
Thanks,
Maer
|
|
|
|
|
You need to make the CEdit multiline, you need to get the size of the font, and then you need to call MoveWindow or SetWindowPos to size the CEdit accordingly. You probably have to take into account the edge of the CEdit also.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Thanks pal!
Your answer is the one I am looking for.
Have a nice day!
Maer
|
|
|
|
|
What is the function of "a thread local storage (TLS) index"?
What is the difference between it and an ordinary parameter?
Can you help?
Thanks,
Maer
|
|
|
|
|
The thread local storage (TLS) is a place provided by Win32 where you can put thread-specific data. Imagine you have a multi-threaded program, and you have some piece of data in each thread which is specific for that thread. Win32 gives you the TLS to store this kind of thread data. The index-part is because you can allocate many TLS "slots".
To answer what's the difference between a TLS index and an ordinary parameter I'd have to know your context.
Cheers
Steen.
"To claim that computer games influence children is rediculous. 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"
|
|
|
|
|
Hi, Steen!
Thanks for your reply! It really helps me a lot.
From MSDN, I learned that the DLL have something to do with the TLS. For example, the DLL uses TlsAlloc to allocate a TLS index. But I do not know how they work?
Why Dll should do that?
Can you help?
Regards,
Maer
|
|
|
|
|
Well, the DLL can be attached to several threads within a process, and you could imagine that each attachment would need some data that was global to the DLL but specific to each thread (e.g. the state information that MFC uses). DllMain can use TlsAlloc in response to a DLL_THREAD_ATTACH to allocate room for this data, and a TlsFree to deallocate it in response to a DLL_THREAD_DETACH.
If you want to know how TlsAlloc/TlsFree works just look it up in MSDN. If you want to know more about multithreading then I warmly suggest that you read Richter's "Advanced Windows".
Cheers
Steen.
"To claim that computer games influence children is rediculous. 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"
|
|
|
|
|
Why does you mail bounce? Please provide a valid mail address (out of courtesy).
Cheers
Steen.
"To claim that computer games influence children is rediculous. 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"
|
|
|
|
|
Hi, Steen!
I am sorry if I have got you into trouble. My mail address provided on www.codeproject.com(maer727@sohu.com.
) is a valid mail address. I use the mail address every day in my Lab.
I hope you can help.
Best regards,
Maer
|
|
|
|
|
How can I, from a dll, get the text in an edit control on my main app. In the dll I have the HWND of the edit control.
I tried
::GetWindowText(hWndEdit, buffer, _MAX_PATH); didn't work
so I tried
::SendMessage(hWndEdit, WM_GETTEXT, _MAX_PATH, (LPARAM)buffer);
still no luck
There must be a way to do this, but I can't seem to find it.
---
Blessed are those who can laugh at themselves, for they shall never cease to be amused
|
|
|
|
|
Hi,
I would like to transmit very simple data (like two integers) between two applications through a dll. I use a shared data segment to store the data. One application writes the data and the other reads it. The problem is the following:
The application which reads the data has to do some sort of polling to check if new data has arrived and this is too slow. Isn't there a simple way to install a callback mechanism (please as simple as possible... I'm not a programming guru (and "memory mapped file" makes me afraid ))
Thanks for your help
|
|
|
|
|
I would use a registered windows message to relay the sync info. Register a message in each of your applications (a GUID is a very good name to use for the message). After one app updates the shared info it broadcasts the registrered message (PostMessage with NULL HWND). In the recieving app your respond to the registered message and read the shared data.
Cheers
Steen.
"To claim that computer games influence children is rediculous. 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"
|
|
|
|
|
...hope that is as easy at it sounds
|
|
|
|
|
This should be a simple question.
I have set up a global hook using the WH_GETMESSAGE flag (no problem there). After I have processed the message in my hook function, how do I remove it from the message queue so that it not processed by the application
(The message is a WM_KEYDOWN message trapping the VK_UP and VK_DOWN keys).
---
Blessed are those who can laugh at themselves, for they shall never cease to be amused
|
|
|
|
|
I think you might need to use WH_KEYBOARD.
From "INFO: Importance of Calling DefHookProc()" in the MSDN:
<snip>
"Only a keyboard hook (WH_KEYBOARD) can suppress a keyboard event by not calling DefHookProc() and returning a 1. When the system gets a value of 1 from a keyboard hook callback function, it discards the message. "
</snip>
oops - wrong snip! - the above was for win 3.0
"For Win32, mouse and keyboard hooks can suppress messages by return value and do not have to call CallNextHookEx(), unless they want to pass the message on. Other hooks, like WH_CALLWNDPROC, don't need to call CallNextHookEx(), because it will be called by the system. However, all hooks should call CallNextHookEx() immediately if nCode<0."
Someday I hope to be able to get a post right on the first attempt!
|
|
|
|
|
Hi all,
My source code won't work, what is my wrong ?
My database is Access 2000.
pApp->pConnection->Open(_bstr_t("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Server.mdb;"), _bstr_t(""), _bstr_t(""), adConnectUnspecified);
pApp->pRecordsetACTION->Open(_variant_t(_bstr_t("SELECT * FROM ACTION")), pApp->pConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText);
Help me !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
When you say it won't work, what does it do ? What errors do your connection object contain ( they are flags in the object ) ? Are both pointers OK ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi Christian ...
My source code haven't error in compiling ...
But when my program want to run, have crash !!!
My English is VERY BAD, sorry
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|