|
Can someone *PLEASE* tell me how to post code like this without having it all screwed up by the browser?
|
|
|
|
|
You need to take all angle brackets out and replace 'em with the HTML escapes.
IOW, instead of "<" enter "<", and instead of ">" enter ">". Same thing for ampersand, "&" instead of "&"
Some stuff will come through, like "cout << blah" but that may not work on all browsers. It's always safe to replace all angle brackets.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
Hi Erik!
What Michael said plus that if you wanted it to appear the same format you typed in the editor area, then you must use/start with <PRE> and then close the fragment with </PRE>.
Example:
----> This line is: <PRE>
Hi...----> Here is anything you write. Code fragments/lines
----> And this line is: </PRE>
Have Fun!
" I love water, but hate to drown! "
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
Ahh.. exactly what I was looking for. Thanks Masoud.
|
|
|
|
|
Hi,everyone!
I have a big problem:my program can not exit completed.
below is the structure of my program:
WinMain(...)
{
Init(...);
RegisterClass(...);
CreateAndShowMainWindow(...);
// Main message loop
while(::GetMessage(...))
{
::TranslateMessage(...);
::DispatchMessage(...);
}
return msg.wParam;
}
CALLBACK MainWindowProc(...)
{
switch(message)
{
case WM_PAINT:
...;
break;
case WM_COMMAND:
...
break;
case ...:
...;
break;
case WM_LBUTTONUP:
::DialogBoxParam(...);
break;
case WM_DESTROY:
::PostQuitMessage(0);
break;
default:
::DefWndProc(...)
break;
}
return 0;
}
It's looks ok,Is not it?
but:
if I click the left mouse button,and the dialog box appeared,
and I press ESC(or ENTER),the dialog box disappeared and the
main window disappeared also,the program has completed,I do not
know why.
so I changed my code,the main message loop like blow:
// Main Message loop
BOOL bRet=FALSE;
for(;;)
{
for(;;)
{
if(!::GetMessage(&msg,NULL,0,0))
bRet=TRUE;
::TranslateMessage(&msg);
::DispatchMessage(&msg);
}
if(bRet)
return msg.wParam;
}
It works fine,the dialog box disappeared and the main window not
disappeared,but when I press Alt+F4 close the main window,I can
find the process in task manager,and I must press the "End Process"
button to end the process,It is said,my program can not exit completely.
I'm very puzzled!
Thanks for any suggestion.
|
|
|
|
|
ummmm
i dont see the dialog box message loop callback anywhere in your code ... once you kick off a dialog box it has to have its own callback for processing its own messages ... when that terminates you should find yourself in the main apps message loop again from where a terminate will work correctly
if your dialog box is modeless then you may have to check for its existance before closing your main app
other than that i dont see anything more from the code you have posted
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
yes,I have a Dialog callback procedure like below:
INT_PTR CALLBACK DialogProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
RQCDialog * pDialog;
switch (uMsg)
{
case WM_INITDIALOG:
...;
return TRUE;
case WM_COMMAND:
if(LOWORD(wParam) == IDOK)
{
::EndDialog(hwndDlg,1);
return TRUE;
}
if(LOWORD(wParam) == IDCANCEL)
{
::EndDialog(hwndDlg,0);
return TRUE;
}
return FALSE;
case WM_PAINT:
...;
return TRUE;
}
return FALSE;
}
and I call DialogBoxParam like use DialogProc as lpDialogFunc parameter.the problem still there.
|
|
|
|
|
Hi,
This link below talks about how to build a MFC Activex control from the
popular MFC doc / view sample Scribble.
http://www.microsoft.com/mind/0497/mfc.htm
I wanted to enhance this to support multiple documents at the same time..So
I could add methods like ActivateDoc(index) to the control which would then
activate the correct window..I have been trying to do this with MDI Frames
and MDI Child Frames but I manage to keep my control crashing...
Then I was trying to not have my Frame Window derive from CMDIChildWnd but
just CFrameWnd, but keep a list of pointers as I do OpenDocumentFile() each
time...But how do I activate the correct frame?
Can somebody help me with what I am doing?
Eventually what I want to do with this is build an ActiveX control that is a
Active Document container ( like the Web browser control ) to open Office
Documents. I need to use this in a Vb app and I would have used the Web
browser control except that I can only have one Office document open then. i
need to have multiple docs open.
I have a long way to go I think...Some help will help me get there faster
( if at all I am in the correct direction)
Thanks in advance
Rajesh
|
|
|
|
|
How can I prevent SetWindowText triggering EN_CHANGE?
Code:
____________________________________________________
CEdit m_Edit1;
void CMyDlg::UpdateEdit1
{
m_Edit1.SetWindowText("BLABLA"); //This triggers EN_CHANGE
}
void CMyDlg::OnChangeEdit1() // EN_CHANGE message handler
{
UpdateEdit1();
}
|
|
|
|
|
some thoughts
first ... why are you doing the two events like that?
second ... if you must then either use UpdateData(FALSE) to set the edit control text
third ... you could use a flag in the en_change event to mask out things you don't want to fire
if it's special formatting you want to do there is probably a better way with one of the many edit box enhancements here on code project
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Flags solved the problem.
However if I had found a way to suppress EN_CHANGE message generation, my code would be more poetic.
|
|
|
|
|
i failed to display hex numbers with zeros in the left side.
i use FORMAT to change the numbers to the CString .
but the numbers with different lengths can not arranged in a column.
|
|
|
|
|
UINT uHex = 0x124AB;
CString str;
str.Format ( "%08X", uHex );
str is now "000124AB". The 0 before the 8 means to pad leading space with 0's.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
How do you tell how much memory a specific program is using?
|
|
|
|
|
use the process viewer app that ships with visual studio
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
I want to place some controlls on Rebar (Progress, etc.) and then i want
to manage these controlls.
Thanks.
|
|
|
|
|
i am designing a program.i need a lot of dialogs to recieve user's input.example: the first dialog is be displaied to get user's information,the second dialog or the third dialog would be display based the first dialog.
how can i do ? please tell me ,thanx
|
|
|
|
|
Why not use wizard style property sheet+pages!
Like the one used with the VC++ app wizard! If the user misses or leaves an important entry point blank, then they cannot proceed unless returned and filled it!
Good Luck!
" I love water, but hate to drown! "
-- Masoud Samimi
Website: www.geocities.com/samimi73
|
|
|
|
|
Masoud Samimi:
Thank you for your reply.I have used wizard and property page style
|
|
|
|
|
it sounds to me like your app might be a "do this then do this then do this then do this etc" type of app ... maybe thats not the way to write windows apps ... a redesign of the structure of the app flow might be in order
if it's just a part of the program that needs the sequential dialog boxes then try using either proprty pages or a wizard
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
What are some functions I could use to monitor how much memory is in use on my system or even how much memory each program is using so I could run through each program and add the total up myself.
|
|
|
|
|
I'm having trouble getting my CView window to act as a drop target. I've added the line:
m_pMainWnd->DragAcceptFiles(TRUE);
to my CMyApp::InitInstance() function and I've added a handler for the WM_DROPFILES message. However, the no drop cursor still comes up when I try to drag a file over the window. Does anyone know what I have to do?
Greg J. Hedlund
SuperStar
|
|
|
|
|
|
Hi All,
I'm Having trouble with this message "User breakpoint at 0x.." (some memory location) during the debugging of my project, even when i do not have any breakpoints in my project, and lands me between mysterious assembly code.
Does anyone understand what this message means???And if yes, then how to get rid of this??? This has been very aggravating for me for the last couple of days. It would not let me debug my actual program.
Any suggestions are welcome. Thanks for your time.
Sean
|
|
|
|
|
This is the message you get when the instruction pointer lands on an int 3. This is a single-step trap, or user breakpoint, which you can code in VC with _asm int 3; .
Typically, debug builds use padding to allow space for things to grow, enabling incremental linking and such. And what sort of data would they use for such 'padding'? You guessed it, int 3!
You may even not have stumbled into this kind of padding - I think there is code in some of the debug heap allocations that will force one of these. I'd suggest viewing the call stack <alt-f7> and seeing just how you got there.
Wish I could remember an example. Two things you might try are rebuild all and seeing if a release build has the same problem.
|
|
|
|