|
Thanks for your answers. but how can i make a Connection between my Dialog button and my main Windows (CTestView). ? what can i do if i want to Trap BN_CLICKED of a butoon on a Dialog in my CTestView ?
|
|
|
|
|
when the button gets clicked in the dialog send a message to the main app and process it there ... use some custom message id's and u'll be fine
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
void CMyDialog::OnBnClickedButton1() {
CTestView *e=new CTestView();
e->SendMessage(WM_MBUTTONUP, 0, 0);
}
it's not work what can i do ?
|
|
|
|
|
no no no
define some custom message id's (see msn) and send a custom message to ur app class and add a handler there for the message
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
What event (or message or function call) does my MFC application/dialog will get when user presses WINDOWS-KEY + M ( the one that we use to minimize all windows ).
My Dialog based application does not get any notification and doesn't get minimized when I press WINDOWS-KEY+M
however I am able to minimize all windows (including my app) by pressing the "Show Desktop" quick link (which generally resides next to Start menu in the taskbar)
I want to rectify this problem with my app.
Please help me.
|
|
|
|
|
ummmmm isnt it the WM_SHOWWINDOW message?
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
Wizard window says
WM_SHOWWINDOW: Indicates a window is about to be hidden or shown
So WM_SHOWWINDOW is when we call ShowWindow(nShowCmd) or any other similar things.
I am asking about window minimize.
I have done a weird thing for the window not to get minimized by default (ie without adding any code).
I removed the minimize button & title bar of the dialog.
Since I am doing all that title bar stuff on my own, I want to add this functionality too.
Please help me.
|
|
|
|
|
afaik all window stuff to do with min and max and whatnot gets done thru the SW_SHOWWINDOW message
"traffic lights are for people who can't make their own decisions" biz stuff about me
|
|
|
|
|
For message related issues, the best tool to use is Spy++, which comes with Visual C++. I just tried it and I got a message number 0x0127 (unknown) for Windows+M. You may wanna look into it further.
One thing to note however, is that Windows+M works fine with a dialog-based app I have here. Is there something special about yours?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
hello @all,
i need an instruction which waits until MATLAB will finish it's job.
earlier forum question:
hello @all,
i try to explain what i want / must do :
i have something like this:
i=0;<br />
while(i<5)<br />
{<br />
i++;<br />
}<br />
the only problem is the while loop. without these, the program part runs perfectly. however i need a while loop or something like that.
i think, the problem lie in the fact that the program sends the data to matlab and then directly in the code continues to go. possibly different processes run off parallel.
i think i must have something that waits so long, till matlab is ready with the diagram (i tried Sleep(1000) but it do not work).
maybe somebody know, if matlab has got a 'instruction' or if i can make something like a 'queue'.
thank you very much
happy
|
|
|
|
|
Donno how ure doing it but take a look at the code on
http://www.codeproject.com/com/matlabengine.asp
and http://www.mathworks.com/access/helpdesk/help/pdf_doc/matlab/apiext.pdf
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
thanks for reply.
cool idea with the first url.
but the second link is 'broken', or??
sunny
|
|
|
|
|
my error. Everything is correct. super, thank you.
sunny
|
|
|
|
|
Hi!
I develop my own application using Visual C++. I need to get a directory where my application is launched.
I've found in MSDN two function: GetCurrentDirectory and GetModuleFileName. It seems that both methods are shown the right results (except for GetModuleFileName I need to make ReverseFind the first slash - but it's not hard to do). What method is the best ?
Yours sincerely,
Alex Bash
|
|
|
|
|
I strongly recommend you to use GetModuleFileName , this will give you the correct result. Be careful with GetCurrentDirectory , this will return the path your app is currently working in. E.g. if you create a file in "C:\Windows", this will be the current directory, regardless of whether your app is located there or not.
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|
|
At the first state of application (I don't perform any creating of files) - do GetModuleFileName and GetCurrentDirectory show the same results ?
Yours sincerely,
Alex Bash
|
|
|
|
|
They can, but need not.
Example:
Create a shortcut to your program.
Modify the shortcut and specify a different directory for the working directory.
Run the program using the shortcut.
When you do this, those API routines will return two different things.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
To be honest: I don't know. But I assume that if you call GetCurrentDirectory dierctly after startup it will return the path where your app is located. But I still think it is safer to use GetModuleFileName.
/edit: Tim is right
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
When I rotate a transparent bitmap, the transparent background color will be drawn around the bitmap (a one pixel halo). This doesn't happen when the rotation is horizontal or vertical. I am doing the following masking:
BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT );
BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMaskDC, 0, 0, SRCAND );
BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT );
At this point I have no clue as to why something like this would occur, because I have rotated the whole bitmap and saved it into the DC's. Has this happened to anyone before?
Thanks!
|
|
|
|
|
Sounds like your rotation code is causing your mask to degrade, so that the transparent colour where it is next to another colour is slightly changed. Have you verified that the pixels in question are EXACTLY the background colour, and not off by one or two ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Can anyone tell me this?
I have a window that contains 4 to 5 property pages so the user can click on the tab on the top and change different things on each one. When the user hits OK, there are checks to validate some of the changes. If one of the validations fails, I want to go to the edit box that contains the information. But that edit box might not be on the property page the user is currently on. I have an error message saying what is invalid. But is there any way, after displaying the error message, to set the focus to the edit box on a different property page? I hope all of this is making sense.
In summary, I just want to be able to set focus on a control that might be on a different page than the one the user was on when he/she hit OK. Is there anyway to do this. Currently, it is setup using the Win32 SDK using PROPSHEETPAGE and PROPSHEETHEADER. No MFC used.
|
|
|
|
|
Try using PropSheet_SetCurSel. This function is simple to use, if you know the page handle or the index. For example, say your control is on the 3rd page out of 4 pages. The function would be:
PropSheet_SetCurSel(GetParent(hDialog), NULL, 2);
Then set the focus on your control. If you know the page and choose to use it, just replace NULL with the page handle...
|
|
|
|
|
Deleting intermediate files and output files for project 'VisiBounce - Win32 Debug'.
--------------------Configuration: VisiBounce - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
VisiBounce.cpp
VisiBounceDlg.cpp
FileInfo.cpp
Generating Code...
Linking...
VisiBounceDlg.obj : error LNK2001: unresolved external symbol _BBBOUNCECHECK@20
Debug/VisiBounce.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
VisiBounce.exe - 2 error(s), 0 warning(s)
anyone know this compilation error, and maybe can suggest what i did wrong?
todo....
:: insert inpirational text here ::
|
|
|
|
|
ah hahhh, I got it , for those who want to know, it was that the compiler was not finding the Library (.lib) file for my .dll ! I dropped the .lib file in the project directory, project / settings / link -> .lib file,
0 errors, 0 warnings
woohoo!
todo....
:: insert inpirational text here ::
|
|
|
|
|
And it appears it took you less than 7 minutes
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|