|
I found this function:
LRESULT CMainFrame::OnTestMessageLParam(WPARAM wParam, LPARAM lParam)
used by some sample code. But when I went to "add windows messsage handler" in the mainframe class context menu I didnt see any thing like wm_message or something. SO where is this function coming from and what does it respond to? Shouldnt it have been in the context menu?
|
|
|
|
|
If you are using MFC you most surely have the source code also. Search the MFC src directory for OnTestMessageLParam .
|
|
|
|
|
Hi There,
Does anybody know the best way of rendering a 2d circle outline onto 3d device of a known number of pixels readius? I've tried rendering it by making vertex buffer with some points arranged in a circle drawn in close proximity to the camera, but it seems to be a bit of a convoluted way of going about it... Does anybody know a better way of overlaying 2d shapes into the buffer?
Thanks for you help...
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
Draw a plain circle on a bitmap and the use it as a texture.
Since this is also how it's done in OpenGL you might have a look at e.g. "NeHe Productions" or opengl.org (note, you might get biased against proprietary API's using free information like this :->).
|
|
|
|
|
My app will have only two MDI docs and two views (one for each). No new views or windows can be created. I want to show (or spawn) doc2 and view2 in response to a buttonclick on view1. Then after the user has finished entering data in view2, I want to click a button, get rid of view2 (destroy or hide), and show view1 (updated) again. How do I go about doing this?
I am working on how to get view1 the info returned by view2 in a separate thread.Thanks so much,
ns
|
|
|
|
|
I added classes for the second doc and view and added the template. Wouldnt compile. I compared it with a successful example with uses CViews , not CFormViews. My CFOrmView view code differed from the CView code,: the constructor wasnt argumentless and was public, and there was no dyncraete staement. SO I moved the declaration of my cosntructor to protected and added the dyncreate statement, but still wont compile. What am I doing wrong or not doing?
Thank you!
|
|
|
|
|
ns wrote:
but still wont compile
what are the error messages???
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Thanks so much for the interest. I used class wizard to make my view and doc files (the second doc)
The example with CView that works has:
from .h
protected:
CMDIBillView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIBillView)
and from .cpp
IMPLEMENT_DYNCREATE(CMDIBillView, CView)
CMDIBillView::CMDIBillView()
{
}
I just noticed that:
The implement line was missing in my view code (CFOrmView based)
so I added
IMPLEMENT_DYNCREATE(CMDIKVView, CFormView)
plus the other changes noted below. Now only 1 error:
C:\Trainer\mditalk\MDIKVView.cpp(16) : error C2512: 'CMDIKVView' : no appropriate default constructor available
My second view class has the following relevant code (I moved the constructor to protected and added dyncreate - it didnt show up by default as is does in a CView based example I made)
From the .h file:
protected:
CMDIKVView(CWnd* pParent /*=NULL*/); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIKVView)
From the cpp file:
CMDIKVView::CMDIKVView(CWnd* pParent /*=NULL*/)
: CDialog(CMDIKVView::IDD, pParent)
{
//{{AFX_DATA_INIT(CMDIKVView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
The example with CView that works has:
from .h
protected:
CMDIBillView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMDIBillView)
and from .cpp
IMPLEMENT_DYNCREATE(CMDIBillView, CView)
CMDIBillView::CMDIBillView()
{
}
I just noticed that:
The implement line was missing in my view code (CFOrmView based)
so I added
IMPLEMENT_DYNCREATE(CMDIKVView, CFormView)
plus the other changes noted below. Now only 1 error:
C:\Trainer\mditalk\MDIKVView.cpp(16) : error C2512: 'CMDIKVView' : no appropriate default constructor available
|
|
|
|
|
Well,
It turns out that my second document I accidentally derived from CDIalog, whereas I wanted CFormView. So things are okay regarding my troubles with that. Which brings me to the question: Does one not make a view derived from CDialog in MDI?
|
|
|
|
|
ns wrote:
Does one not make a view derived from CDialog in MDI?
no. one does not use CFormView instead.
-c
Garbage collection, making life better - for weenies!
|
|
|
|
|
Hello,
This is in regards to MDI architecture.
I have a CString that gets set to (lpszPathName) on the OpenDocument function inside the Doc class.
I want to access this string in the View class, and I don't know how to access it.
I tried this.
(in Doc Class)
m_String = lpszPathName;
AfxMessageBox(m_String);
This MessageBox display the Pathname as I wanted.
(in View class)
CMyView NewView;
AfxMessageBox( NewView.m_String );
This MessageBox displays a blank box. Obviously, the string isn't passing as I thought it would.
Does anyone know how I could do this?
Thanks a whole lot.
|
|
|
|
|
You have to get a pointer to the view's associated document first.
CMyDoc* pDoc = (CMyDoc*)GetDocument();
if (pDoc)
{
AfxMessageBox((LPCTSTR)pDoc->m_String);
}
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Perhaps i wasnt clear: I want to send info from view2 of doc2 to doc1 which will update view1 (how is mysterious yet).
I'm going to try the postmessage and see if I can populate a variable in view1 with info from view2.
However I'm still unable to even create a cFORMView project with 2 documents!!!! I posted about this just now.
I appreciate your responses.
|
|
|
|
|
HEY!!!!!!!!
That was awesome! That reply came so quick! And it hella worked.
Thank you, Outlaw Programmer. You da man!
-<>-
|
|
|
|
|
If this is confusing, please just read my summary. Thats what my ultimate goal is:
I am trying to communicate information received in a View (which is associated with doc1) to Doc2 so it can update View2.
First question is that if I put a button on my view and in the click event try to set the doc2 public variable directly (like Doc2::var = abc), it says that its illegal to access a data member from a static variable.
So I put a setvariable() function in doc1, and tried to create an object of type doc1 in view2 to set the variable (which I dont think is going to do what I want because of the way the document is created from the template). Anyways turns out that doc1() constructor is protected in order to use the dyn_create stuff.
I suppose making the classes friends might allow me access, but the view (view1) I eventually want to use to display info from view2, is created from a template so it wont be communicated to by the simple doc1 object that I am trying to make.
Summary:
I call a dll in view2, and want to give the info received in view2, to be seen in view1. THis I realize has to be done via doc1, but I am not able to figure out how to transmit this info to doc1.
Additional question: In response to a button click on view2, if I can successfully change the value of a variable in doc1, how do I updateallviews()? I dont want to click a ,menu item in doc1 to update all views. rather I want it done automatically as soon as the variable value changes.
|
|
|
|
|
Why don't you post a user-defined message to view2 from view1, and let view1 set the variable according to an lparam value passed with the call to PostMessage?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Hi,
The aspi scsi based software cannot find my CDRW/DVDR ROM,
such as CDex, Audacity, Xtractor and EAC...
I have a test by using ASPI Rip justly, the log file report an error
about my cdrom is "Wrong Drive Count".
What it mean? and how get a correct drive count for the cdrom?
Thanks in advance!
chen
chen
|
|
|
|
|
Drop the ASPI (that is inherently unsupported by MS) and go for SPTI or at least an ASPI<->SPTI conversion layer such as akrip (at least I think they still provide it).
The error you mention is completely useless without further info.
++luck;
|
|
|
|
|
Hi,
I have installed VStudio 7.0 on my computer, then I wanted to install DirectX 8.1 SDK in my machine but..., it seems that VStudio 7.0 doesn´t accept or import the wizards from Dx 8.1, what can I do ? Is there anyway to import them ?
Thanks, greetings
Braulio
|
|
|
|
|
I don't know this for sure (just a guess), so bear with me. But, the wizards in the DX SDK work with VC6, and I think even with 8.1 they still only work with VC6. I still haven't tried to use DX and VC7 together, so I don't know for sure.
Jeremy L. Falcon<nobr>
Homepage : Sonork = 100.16311
"Half the reason people switch away from VB is to find out what actually
goes on.. and then like me they find out that they weren't quite as good
as they thought - they've been nannied." - Alex, 13 June 2002
|
|
|
|
|
Does anybody know how to get extended information about a process under NT4/2000?
I have the ProcessID, therefore I can get a handle etc. but I need to know if the process is still
active(i.e. GetExitCodeProcess(hProcess, &dwExitCode)) does not help, if dwExitCode == STILL_ACTIVE the process could still be hung.
Thanks
|
|
|
|
|
enumerate the thread's windows (EnumThreadWindows) and try
sending message with a timeout (SendMessageTimeout) to see
if there is responsiveness.
|
|
|
|
|
Use this
DWORD dwResult;
BOOL bResponding = SendMessageTimeout(hwndInQuestion,
WM_NULL,
0,
0,
SMTO_ABORTIFHUNG,
5000,
&dwResult);
bResponding is TRUE if the process is responding and processing messages. This is precisely the way Task Manager works.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|