|
Thank you so much for your reply. I did not run debug, I am not familiar with it. I followed the instruction to debug, but did not success. Could you please tell me how to do that? Thanks again.
|
|
|
|
|
1. Set a breakpoint at some function of interest
2. Compile a debug build of your filter
3. Make sure that this debug filter is registered and not your release build (regsvr32). You can setup a custom build step to ensure this is done.
4. Press F5
5. You should see a dialog that pops up asking for the executable to be used for the debugging session. Select GraphEdit. (If you do not see the dialog you need to modify your project configuration properties under Debugging)
6. Insert your filter and do what you want. When it hits a breakpoint you'll see it.
|
|
|
|
|
Thanks for your detailed the instruction about filter debugging. I followed those instructions step by step, but as the program ran to the breakpoint, error message popped up said Could not get debugging iformation about graphedit.... then the computer crashed. I tried other filters provided by DX sdk, the same things happened. I do not know if there is something wrong with my computer. Thanks again.
|
|
|
|
|
We've got two classes that we use to resize standard CDialog-based classes and to show a resize handle in the lower right-hand corner of the dialog. These work fine when the class is derived from CDialog. However, if the class is derived from CAxDialogImpl we have problems instantiating the class that shows the resize handle.
The class used to show the resize handle is called CEasyStatusBar and is derived from CStatusBarCtrl. The class has a Create() method which is the first method that classes that use the CEasyStatusBar class must invoke. The Create() takes a CWnd pointer which is normally passed as the this pointer from CDialog based classes. However in the CAxDialogImpl class we are using CWnd::FromHandle(m_hWnd) to get the CWnd pointer to pass in to the Create() method. The Create() method does a few things and then invokes the CStatusBarCtrl::Create() method as follows:
BOOL IsVisible = parent->IsWindowVisible(); // parent is the CWnd pointer
DWORD ProgressBarStyle = WS_CHILD | CCS_BOTTOM | SBARS_SIZEGRIP | SBT_OWNERDRAW;
CStatusBarCtrl::Create(ProgressBarStyle, CRect(0, 0, 0, 0), parent, 1);
When it gets into the CStatusBarCtrl::Create() method an assertion failure is being generated. I debugged into this to find out where and it is performing the following:
The CStatusBarCtrl::Create() method is invoking VERIFY(AfxDeferRegisterClass(AFX_WNDCOMMCTL_BAR_REG)). This is invoking AfxEndDeferRegisterClass() which is doing the following:
// mask off all classes that are already registered
AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
fToRegister &= ~pModuleState->m_fRegisteredClasses;
if (fToRegister == 0)
return TRUE;
LONG fRegisteredClasses = 0;
// common initialization
WNDCLASS wndcls;
memset(&wndcls, 0, sizeof(WNDCLASS)); // start with NULL defaults
Wndcls.lpfnWndProc = DefWindowProc;
Wndcls.hInstance = AfxGetInstanceHandle();
The first thing the AFxGetInstanceHandle() method does is do an ASSERT(afxCurrentInstanceHandle != NULL) which is failing and causing the assertion fault. I debugged into this with one of our other classes based on CDialog and in that one, fToRegister was set to 0 so it was never getting to the AfxGetInstanceHandle() method.
Does anyone have any clues as to what could be causing our CAxDialogImpl-based class to get the above assertion failure?
-- modified at 18:46 Saturday 29th April, 2006
|
|
|
|
|
Hi,
I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window.
QUESTION:
How do I find the parent, main dialog, parent window??
I have been trying to find it while setting breakpoints in the debugger.
Thanks.
Jerry
|
|
|
|
|
jerry1211a wrote: My class needs access to an Edit control in the main dialog.
This is not advisable. What is it exactly that you are trying to do?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
for access to main dialog you can use GetParent but you said "that is not derived from any MFC class"
|
|
|
|
|
In your own class create a member to your edit control (like CEdit* m_pEdit).
Then create a function to set the member (like SetEdit(CEdit* pEdit) { m_pEdit = pEdit; } ).
Then in your own class, use m_pEdit->SetWindowText(...) or GetWindowText(...).
Does that work?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
hello
i have a VC++ 6.0 application .here i want to convert a Cstring variable(a filepath) to WORD(unsigned short)
how can i do that?
plz guide me
joy
joy
|
|
|
|
|
Why do you need to do that? A WORD representaton of a CString does not make sense.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
You can use atoi (or strtoul always forget about that too :->) to convert the string to an integer, then cast it, but it doesn't make sense to convert a filepath to a number (unless the path is a number, I guess).
- S
50 cups of coffee and you know it's on!
-- modified at 18:34 Friday 28th April, 2006
|
|
|
|
|
I'm curious whether it is possible to compile your apps for Win 3.x with VC6-8. My first idea would be to remove the WIN32 from the preprocessor definitions, but that would be too easy.
|
|
|
|
|
No, I think you would need one of:
- Visual C++ 1.52
- Borland C++ 5.02 (not Borland C++Builder)
- Open Watcom
Those are the only compilers I know of off-hand that can make 16-bit Windows apps.
|
|
|
|
|
maybe he doesn't need to keep the 16bits compatibility; only rebuild the application with a modern compiler.
I can't help since I never coded win 3. applications.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: maybe he doesn't need to keep the 16bits compatibility
Windows 3.1 == 16-bit applications only, unless you use the Win32s add-on that Microsoft came out with near the end of Windows 3's lifespan. I understand that Win32s programming has, um, issues.
|
|
|
|
|
Gordon Brandly wrote: I understand that Win32s programming has, um, issues.
Yes, I remember this from doing technical support on mathematical software products such as Mathsoft's Mathcad about 12 years ago.
Kevin
|
|
|
|
|
No, VC 1.5 was the last VC that made 16-bit binaries. Your other option is to use VC 4.0 and make a Win32s app, then install Win32s on the Win 3.1 machine. (I forget when Win32s support was removed, it was either VC 4.1 or 4.2)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I am trying to add an interface to my CFormView and CRecordView classes but not getting the results I would expect. Some code snippets...
// MainFrm.cpp
void CMainFrame::SelectView(UINT ViewID) {
...
TRACE("-1-\n");
((CViewControl*)pNewActiveView)->activate(); // <-- not working
//((CMasterView*)pNewActiveView)->activate(); // <-- this does work
TRACE("-2-\n");
}
// ViewControl.h
#pragma once
#include "StdAfx.h"
class CViewControl
{
public:
CViewControl();
~CViewControl();
virtual void activate();
};
// ViewControl.cpp
#include "StdAfx.h"
#include "viewcontrol.h"
CViewControl::CViewControl()
{
}
CViewControl::~CViewControl()
{
}
void CViewControl::activate()
{
TRACE("-----CViewControl::activate()\n");
}
// and here is one of the view clases that use it...
// MasterView.h
class CMasterView : public CRecordView, public CViewControl
{
...
public:
virtual void activate();
...
// MasterView.cpp
void CViewControl::activate()
{
TRACE("-----CMasterView::activate()\n");
}
..with the following output:
-1-
-2-
...expected:
-1-
-----CMasterView::activate()
-2-
A side note: If I make ~CViewControl() virtual, I get the following output:
...
-1-
Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called.
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
Now I know there are different ways of doing the same thing, Create my on CMyRecordView and CMyFormView classes, but would like to know why the above code is not working like it should.
Any insight would be appreciated.
Chris
|
|
|
|
|
I am very new to mfc and i have a basic question, can anyone tell me how to get the local drives like C:, D:, E:,.....etc inside the tree control in mfc...
Thanks in Advance;)
With Regards
raja
Raja Bose
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
is there compiler options for compiling executable to use both processors in double core architecture under VC2003
9ine
|
|
|
|
|
nope, design your program to be multithreaded...
|
|
|
|
|
Are you wanting the compiler to use both processors to compile your program, or are you wanting your program, when running, to use both processors?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
|
While the previous posters are correct, there is a code generation option that you need to select to enable multi-threading and link with the correct run-time libraries.
|
|
|
|