|
MFC dialogs are modeless dialogs, which then become modal.
Message boxes are modal dialogs.
Maybe this can explain things?
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
Hello,
New-B question.. I'm parsing a text file for a value.. when found I extract it and display it on a dialog box.. this works fine but the problem is it displays some garbage before and after the String.. Could this be because there is a carrage return before and after the falue in the text file? How can I remove the garbage and just display the string?
Thanks for any help!
Rob
|
|
|
|
|
|
I am using an asynchronous property in my ActiveX control to implement the background of my control.
What should I do to implement the property?
Is there any articles about the topic?
Thanks.
Maer
|
|
|
|
|
In the "OnCreate" funtion of the class "CInPlaceFrame" of a Server Application, there is a statement like this "m_dropTarget.Register(this)". Here are the comments from Microsoft:
// By default, it is a good idea to register a drop-target that does
// nothing with your frame window. This prevents drops from
// "falling through" to a container that supports drag-drop.
I can not see the funtion of the statement. If I remove the statement, my server application runs like before.
Maer
|
|
|
|
|
Why use the statement "EnableCompoundFile()" in the function "CMyServerDoc::CMyServerDoc"? Here, "CMyServerDoc" is a class derived from the class "COleServerDoc". My application is a MDI based server application.
Does it have anything to do with "COleServerItem"?
|
|
|
|
|
I have some simple questions about "NETRESOURCE":
1.What is the difference between "RESOURCE_GLOBALNET" and "RESOURCE_CONTEXT"?
What means "All network resources"(from MSDN) in the description of "RESOURCE_GLOBALNET"?
And What means "The network resources associated with the user's current and default network context. "(from MSDN) in the description of "RESOURCE_CONTEXT"?
2.If I specify the value "RESOURCEDISPLAYTYPE_SERVER" to "dwDisplayType " when calling "NPOpenEnum", then after the call to "NPEnumResource", I get several "NETRESOURCE"s. Can the value of "dwDisplayType" of the "NETRESOURCE"s (retrieved) different from "RESOURCEDISPLAYTYPE_SERVER"?
3.How can I check out whether a "NETRESOURCE" is a container that contains sub-"NETRESOURCE"s?
Use the flag "RESOURCEUSAGE_CONTAINER" or the flag "RESOURCEUSAGE_CONTAINER" & "RESOURCE_GLOBALNET"?
Thanks
Maer
|
|
|
|
|
I know this will be a silly question but it is driving me nuts. I need to both display and print symbols for hearts, diamonds, clubs and spades. No problem on the View, everything works just fine. What doesn't work is the print function. The symbols are output as empty blocks. I have delved into every help/resource I can find and have found nothing that works. This can't be difficult, but the solution isn't obvious (to me). Any help would be appreciated.
The essential code from the OnDraw() and set up logic is:
LOGFONT m_lf;
m_lc.lfCharSet = ANSI_CHARSET;
m_lc.lfPitchAndFamily = FIXED_PITCH | FF_DECORATIVE;
m_lc.lfQuality = PROOF_QUALITY;
strcpy(m_lc.lfFaceName,"Symbol");
// Create font for this view
m_SymbolFont.CreateFontIndirect(&m_lc);
CFont* xFont = pDC->SelectObject(&m_SymbolFont);
pDC->TextOut(xPos,yPos,wbItem,wbItem.GetLength());
Thanks
Too much poop - not enough toilets
|
|
|
|
|
|
I never did get an answer, but finally did solve the problem and thought I would share it in case someone else ever has the same problem.
// Original didn't work
m_lc.lfPitchAndFamily = FIXED_PITCH | FF_DECORATIVE;
// This works!!
m_lc.lfPitchAndFamily = DEFAULT_PITCH | TMPF_TRUETYPE;
The original displayed just fine, but on either print preview or actual printed output the symbols were replaced with empty "blocks".
The key was in specifying DEFAULT_PITCH instead of FIXED_PITCH - FF_DECORATIVE and TMPF_TRUETYPE did not have an impact on the results.
|
|
|
|
|
Hi..
I added a Windows message handler "OnLButtonDown" ... and I was wondering how will I know which control is being clicked (within that procedure of OnLButtonDown)....
Note: I cannot use the BNCLICKED (message handler) because it conflicts with the LButtonDown of the Dialog...
Thanks in Advance... Ciao!
|
|
|
|
|
If you want to capture a button being pressed, you would handle the BN_CLICKED message for that control within the dialog that holds it.
Alex
|
|
|
|
|
Hi.. I'm using a project whose baseclass is CFORMVIEW..
my question is HOW DO YOU CHANGE the COLOR of the FORM???
Thanks...
|
|
|
|
|
OnEraseBackground. Draw the colour you want here instead.
Alex
|
|
|
|
|
Hi ...
Sorry to ask you once again ...but I don't seem to understand your response.
Is this OnEraseBackground a windows message handler .. and where should I add such windows message handler (I only saw WM_ERASEBKGND on the CMainFrame)? And what's the command to change the color of the Form? Please, elucidate.
Thanks for the help. =)
|
|
|
|
|
I've just had a look, and the view *does* have WM_ERASEBKGND. There is no command, this is called whenever the area is erased and you will need to draw the background.
Something like this:
CRect rc;
GetClientRect(&rc);
pDC->FillSolidRect(&rc, RGB(255,0,0));
Alex
|
|
|
|
|
Oh.. didn't see that there was WM_ERASEBKGND.. coz the filter messages was to the default class:VIEW class instead of the window or child window.. so i didn't see it...
alex, thanks a lot...ciao...
|
|
|
|
|
Erasebackground will not completly solve your problem nor do I think it is the prefered method. Usesomething like this:
void CMainView::OnPaint()
{
CMainFrame* pFrame;
CPaintDC dc(this); // device context for painting
pFrame = (CMainFrame*)GetParentFrame();
CString s="Printing Library Demo Program";
pFrame->SetWindowText(s);
RECT rc;
CBrush cBr(RGB(255,255,0));
GetClientRect(&rc);
dc.FillRect(&rc, &cBr);
}
then to solve the control background problem use this:
HBRUSH CMainView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor==CTLCOLOR_STATIC)
{
HBRUSH hbr2=CreateSolidBrush(RGB(255,255,0));
pDC->SetBkMode(TRANSPARENT);
return hbr2;
}
return hbr;
}
Class wizard will make both overrides for you
Richard
ISS Software
Dallas Texas
|
|
|
|
|
I posted a message HERE a few days ago, but I have been unable to figure out a solution. I was hoping maybe you GURU's may have some helpful thoughts. The basic situation is as follows...
I have SDI formview based app. It runs fine when compiled in debug mode, and compiles fine in release mode. However, the release version, crashes before reaching the first line of CMyApp::InitInstance() when I attempt to run it. Turning off optimizations doesn't help and I am out of ideas on what to try next.
When I attempt to run to cursor on the first line of InitInstance, the debugger stops in "\Mfc\Src\Appmodul.cpp" on the following function.
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
When I press I run after that it pops up "Unhandled exception in MyApp.exe: 0x0000005: Access Violation", and the debug window, after I stop debugging, shows "First-chance exception in LU.exe (KERNEL32.DLL): 0xC0000005: Access Violation."
Any ideas, thoughts would be greatly appreciated.
- John
|
|
|
|
|
Do you have any static objects in your program? Or, is there any code in CYourApp constructor?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
No code in the constructor.
|
|
|
|
|
Check wether release version of this app links all other libraries in release version.
Furthermore - try to turn off incremental linking. I have one project which does not want to run (though this is the debug version which does not want to get up - release runs fine) if inremental linking is on...
|
|
|
|
|
All libraries are linked. I tried both using mfc in both a static and shared dll. I tried with and without incremental linking. Still broke. I seem to crash on "ProcessShellCommand(cmdInfo)".
|
|
|
|
|
Mukkie might have a point - plus you are running a unicode based app...
The only KERNEL32 routine that I can see if I break where you indicate is in BaseProcessStart@4. Since a DLL I'm implictly linking to loads before I hit _tWinMain, I'm starting to suspect a DLL.
Hmmm... maybe its an errant MFC dll - try a static link to mfc? I saw a situation once where an install left MFC dlls in the system dir on NT - hiding the proper ones that were in system32.
|
|
|
|
|
How do you tell what is a KERNEL32 routine? And what within "ProcessShellCommand(cmdInfo)" calls routines within KERNAL32?
|
|
|
|