|
i've inserted
cs.style &= ~WS_EX_APPWINDOW;
cs.style |= WS_EX_TOOLWINDOW ;
in the PreCreateWindow function of the dialog but with dlg->Create the program doesn't execute PreCreateWindow. Where i can put this code? The TOOLWINDOW option is set also with the dialog editor
|
|
|
|
|
You're trying to change window style while you need to modify *extended* style. Remove stuff from PreCreateWindow and add following line to OnInitDialog:
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);
Note that you can set WS_EX_TOOLWINDOW in dialog editor, but WS_EX_APPWINDOW is not accessible there (in VC6, at least).
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
i've seen APPWINDOW isn't in the dialog editor Now it's working, thanks! I'm working on a simple player (i'm boring of ultra skinned apps, ultra wasting memory windows). It plays audio cds, compressed and uncompressed wave files, module music and some video files.
Thanks a lot again
|
|
|
|
|
hi friends!
how to trap notifications set with IDirectSoundNotify8::SetNotificationPositions method in a separate thread, in MFC application?
|
|
|
|
|
Hello,
I nend to be able to detect the event fired when the user leaves the press operation over a button:
I'm trying to activate a process while the button is pressed and deactivate it as soon as the button is left.
As always thank you very much.
|
|
|
|
|
Do you mean when they let go of the mouse button on your control? If so, WM_LBUTTONUP
Or do you mean when they move the pointer outside your button? Then use TrackMouseEvent & WM_MOUSELEAVE
Or do you mean when the user moves the mouseout of your control while the mouse button is down?
If so then set a flag when you get WM_LBUTTONDOWN and clear it when you get WM_LBUTTONUP, and also use TrackMouseEvent() and WM_MOUSELEAVE.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hello,
I've spent all night working and I can't think clearly, could you help me again?
Where should I place those message filters? in PreTranslateMessage? and what about TrackMouseEvent? (I've tried to find information of that function in msdn and only one article appears, and I've not understood where to place anything...)
Thank you in advance...
|
|
|
|
|
Can you clarify which of the 3 scenarios you are trying to capture?
quicker for me to explain then
Signature space for rent. Apply by email to....
|
|
|
|
|
I must say that I didn't thought of those three detection modes, but I need all of them, due to the fact that I need to stop the process activated by clicking that button when any of that events happens...
Could you explian me this scenario?
Or do you mean when the user moves the mouseout of your control while the mouse button is down?
If so then set a flag when you get WM_LBUTTONDOWN and clear it when you get WM_LBUTTONUP, and also use TrackMouseEvent() and WM_MOUSELEAVE.
Thank you very much for your time and help.
|
|
|
|
|
Check TrackMouseEvent API.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
I developed an Activex Control with events that I'm using in Vb. Now I'd like to use this Activex in a VC++ project. Importing activex I can see only method but no events. How can I import this events and manage its?
Thanks you
Bye
|
|
|
|
|
If you have placed an activex control on a dialog or form, you can map the events using class wizard. Start classwizard Ctrl+W and goto the "ActiveX events" tab. From there you should be able to choose which you want to map.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
When use CInternetSession::OpenURL in a seperate thread,for example:
CStdioFile* pFile=CInternetSession::OpenURL(...)
If this thread for some reason is terminated suddenly,VC will detedct a memory leak:
Detected memory leaks!<br />
Dumping objects -><br />
{202} normal block at 0x003478D8, 30 bytes long.<br />
Data: < /] > B0 00 2F 5D 0D 00 00 00 0D 00 00 00 01 00 00 00
and because OpenURL have not finished properly,so pFile is still NULL,so we cannot manage to dealocate the memeory by delete pFile.
What should I do? Is it a bug in MFC?
|
|
|
|
|
my guess is that the leak is because of
If this thread for some reason is terminated suddenly,VC will detedct a memory leak
Are u calling TerminateProcess or one of the family??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks for response.
OpenURL will wait until received the response from server or time out.In a narrow band and slow connection,this may take some time.If the user is weary of waiting and click "Stop" button,I don't want to say "Hi! I'm waiting something from server,don't bother me! I'll stop until I can stop",I just want to stop the thread immediately.But in this way I don't know how to avoid the memory leak.
|
|
|
|
|
You have a couple of options for handling this correctly.
1. Let the thread finish it's work and clean up but make the application ignore the results and pretend like the thread is not running.
2. Use an asynchronous connection to the server which involves a bit more than a simple call to OpenURL, but will get you what you want. You can use this link to read more on ansync connections using CInternetSession[^]
--
If it starts to make sense, you're in a cult.
|
|
|
|
|
Hello,
I need to be able to control the limits that are allowed to type in a CEdit control (ie: if the max number must be smaller than 2000, I need not to be able to type 3000).
OK I know that I can tell the CEdit to be limited by the use of this DDX call:
DDV_MinMaxInt(pDX, m_vediVelocitat, 0, 3000);
OK, I need to be able to modify this limit at runtime, is there an easy way?
All that I've tried gives me an artificial behaviour.
As always, thank you in advance.
|
|
|
|
|
Have you try removing the DDV_MinMaxInt intrcution from the AFX_DATA_MAP section, and replace "3000" by a variable ?
void CMyDialog::DoDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog::DoDataExchange(pDX);<br />
DDX_Text(pDX, IDC_MY_EDIT, m_iPos);<br />
DDV_MinMaxInt(pDX, m_iPos, 0, m_iRangeMax);<br />
}
Some of those that work forces
Are the same that burn crosses !
Killing In The Name/Rage Against The Machine
|
|
|
|
|
Do you need that 'on the fly', meaning you want to stop the user from entering eg. one '0' too much, or are you satisfied with the (IMHO stupid, confusing and unsatisfactory)MFC approach of testing after the user has clicked OK?
|
|
|
|
|
MFC tests when you type, that is why it is stupid. If you have a number, highlight it and hit delete, you'll get a validation error. I ALWAYS roll my own validation, so as not to drive my users insane.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
MFC tests when you type
Really? Not only in UpdateData()? This was new to me, it must be limited to CEdit, as all other validations are triggered by UpdateData().
|
|
|
|
|
MFC *doesn't* test until DoDataExchange is called from UpdateData.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hmmm.... I remember spending ages trying to stop it from popping up all the time, but when I did a quick test, it was not the case. I'm confused now, I wonder what I was doing at the time.....
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
what can I do? I have no time and this will semi-solve my problem, when I'd have finished this machine, I'll try to find out another way...
|
|
|
|
|
I found this
DDX_Check(pDX, IDC_SEX, m_bFemale);
DDX_Text(pDX, IDC_EDIT1, m_age);
if (m_bFemale)
DDV_MinMax(pDX, age, 0, m_maxFemaleAge);
else
DDV_MinMax(pDX, age, 0, m_maxMaleAge);
in the MSDN under "TN026: DDX and DDV Routines".
Seems you can easily use variables.
|
|
|
|