|
luyongxing wrote: Is there anyone know how to take this kind of program into practice in general
Yes, most of the people in this forum can help you but what is exactly what you want?
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Maybe I did not say clearly and even there were some grammar mistakes.I am very sorry for that.I will think it over and explain it in exact words.
|
|
|
|
|
One way would be to replace the shell with one of your own. I did this once with Windows 9x. The registry value is:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
By default, the shell is explorer.exe. There are many articles on the Net that can provide you with details.
Another way is via the Group Policy Editor.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I create a new project (MFC Dialog) and place a button on the dialog. The code that the button performs is the following:
<br />
CCriticalSection c;<br />
c.Lock();<br />
c.Lock();<br />
c.Unlock();<br />
c.Unlock();<br />
When I start the Program in DEBUG-Mode I expect the following behaviour:
1. The CritSec is created.
2. The first Lock is applied.
3. The second call to Lock should result in a deadlock.
But that is not the case. The code will run without any problems.
WHY !!!!
Is there some different behaviour in DEBUG-Mode, or what?
Greets Snow
|
|
|
|
|
what is the return value when second lock is applied
-- modified at 6:51 Monday 28th November, 2005
|
|
|
|
|
|
Hi,
the CCriticalSection object encapsulates the CRITICAL_SECTION type.
The lock function calls the EnterCriticalSection API. So from the MSDN libs I found this:
After a thread has ownership of a critical section, it can make additional calls to
EnterCriticalSection or TryEnterCriticalSection without blocking its execution. This prevents a
thread from deadlocking itself while waiting for a critical section that it already owns. The
thread enters the critical section each time EnterCriticalSection and TryEnterCriticalSection
succeed. A thread must call LeaveCriticalSection once for each time that it entered the critical
section.
So it is normal behaviour
codito ergo sum
-- modified at 11:29 Monday 28th November, 2005
|
|
|
|
|
|
Hi all,
I have to write a program in MFC that should do:
- draw a sinusoidal signal on the screen
- draw a random signal with random dispersion on the screen
- draw the sum of the two signals
I haven't program and I'm not very interested in programming in MFC, so I'm just asking if anybody of you have done something like this and could give me a ready class, a hint, etc. If there are some ready functions in MFC I'll appreciate if you point them.
Thanks very much for the help!
SELECT * FROM LIFE
|
|
|
|
|
There are several chart articles that may help you. One that I've used in several ocasions to represent data series is XGraph[^] that is very powerfull
I hope it helps,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
I am working on something like this but
havent done up with the work and it remaining to
optimise the class.
But u can find some example in codeproject for
displaying some good sinosuidal signals.
Abuout random i dont knwo if the same class can do
the work for but will try my class to do that for u
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi,
here is my code...
BOOL cInput::Init(HWND hWnd, HINSTANCE hInst)
{
// Free a prior Init
Shutdown();
// Record parent Window handle
m_hWnd = hWnd;
// Create a DirectInput interface \\\
m_pDI = NULL;
if(FAILED(DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&m_pDI, NULL)))
return FALSE;
// Return a success
return TRUE;
}
i use VC++ 6.0 and directx 9 sdk
can anybody tell me whats wrong with this code ,it compiles n runs fine but while debugging at line "DirectInput8Create" it exits to the
assembly gives dialog "userbreakpoint called at .....".here the hInst is valid...n even rest seems fine for me.any kind of help is welcomed.
thanks in advance...
|
|
|
|
|
Hello,
It doesn't help to post your question three times after eachother...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
OOOOOPS!!!! it was a mistake...sorry abt it(i got a server error everytime i posted it)
chillax
|
|
|
|
|
I have never done any DX programming, so this is just a guess.
The second parameter is supposed to be the version number for which the application is designed. You specified the DIRECTINPUT_VERSION macro, but what is the value of that macro? It is defined in the file DInput.h. So which version of the file are you using? If you are using the version that came with VC6 then it will be defined as 0x0500 (DX5).
You then provide an IDD for DX8 in the third parameter, and you say you are using the DX9 SDK.
Are you running into too many version conflicts here?
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for replying.....
well the macro is
#define DIRECTINPUT_VERSION 0x0800
defined before
#include <dinput.h>
according to the msdn link below.....
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/input/ref/functs/directinput8create.asp
and if i am sure the there was no changes made in DX9SDK in direct input so it uses dx8 parameter here(3rd param).
regards
varun
|
|
|
|
|
Hi,
here is my code...
BOOL cInput::Init(HWND hWnd, HINSTANCE hInst)
{
// Free a prior Init
Shutdown();
// Record parent Window handle
m_hWnd = hWnd;
// Create a DirectInput interface \\\
m_pDI = NULL;
if(FAILED(DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&m_pDI, NULL)))
return FALSE;
// Return a success
return TRUE;
}
i use VC++ 6.0 and directx 9 sdk
can anybody tell me whats wrong with this code ,it compiles n runs fine but while debugging at line "DirectInput8Create" it exits to the
assembly gives dialog "userbreakpoint called at .....".here the hInst is valid...n even rest seems fine for me.any kind of help is welcomed.
thanks in advance...
|
|
|
|
|
Hi,
here is my code...
BOOL cInput::Init(HWND hWnd, HINSTANCE hInst)
{
// Free a prior Init
Shutdown();
// Record parent Window handle
m_hWnd = hWnd;
// Create a DirectInput interface \\\
m_pDI = NULL;
if(FAILED(DirectInput8Create( hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&m_pDI, NULL)))
return FALSE;
// Return a success
return TRUE;
}
i use VC++ 6.0 and directx 9 sdk
can anybody tell me whats wrong with this code ,it compiles n runs fine but while debugging at line "DirectInput8Create" it exits to the
assembly gives dialog "userbreakpoint called at .....".here the hInst is valid...n even rest seems fine for me.any kind of help is welcomed.
thanks in advance...
|
|
|
|
|
i heard one of the method is using % and / as predicate when compare the elements, but i dont really understand why use % and /, may anyone explan for me, thx very much!
1
|
|
|
|
|
Hello,
What algorithm are you testing? It's impossible for use to help you if you don't specify your problem more clear.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
sorry,
my question is how do u test sorting algorithms for stability by using % and / as predicate and why use % and /
like in merge sort ,u not suppose to swap the same element which its stable sort
but how do u prove its stable
thx
1
|
|
|
|
|
Hello,
I normally don't prove the stability of an algorithm with a test program. I prove the stability and correctness of my algorithm using math. It's difficult to explain and even harder to do, but if you can do it, it's an powefull tool in your toolbox. I'm just glad that I don't have to use it much..
A test program is there to help you resolve bugs in the implementation of your algorithm. Often, test programs are written for stress testing and preformance measuring.
If you want to prove your algoritm with a test program, you should have lots of data. You can choose the data carefully or use random data. The benefit of random data is that it mightsaves you a lot of work early in the process, but can cost you much more if you miss the hard-to-detect bug. Choosing your data carefully reduces the change that you miss a bug, but takes a lot of time early in the process. If you already verified the correctness of your algorithm, you should choose the random number approach and do a lot of stress testing (let your algorithm process HUGE amounts of data and see how it performs). If you want to debug your algorithm, you should carefully pick a sequence of data that you expect to give problems. These sequences can be very small.
Hope this helps.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Without any code added for validations if I simply send IDOK on the sheet, i have it call IDOK on all its member pages which causes an assertion failure. But the problem is does not happen when one activate all pages of the property sheet before IDOK.
guesses are calling of UpdateData before the dialog is initialized might be causing the problem.
Could someone explain the working of CPropertySheet::AddPages()??
does it take care of initializing the dialog of its member pages?
Thanks in advance
|
|
|
|
|
The PropertyPages are not true 'windows' until you activate them or go to them using the tab or the next/back butons if it is a wizard. Otherwise, you just have the instance of the wrapper class, but no window exists yet.
You could check some of their member variables, such as m_hWnd to see if there is really a 'window' there before sending a property page any messages. Otherwise, you can declare a 'initialized' member variable for each property page and then set it to true in an OnInitDialog handler. Check this variable before sending a property page any messages.
|
|
|
|
|
thanks a lot, didn't know dat and never seen samples using this technique.
now d appl works fine. thanks again
|
|
|
|