|
yeah something like that. (carrying it around).
raner wrote:
so how do i make use of CFrameWnd::GetActiveDocument to import the pointer?
something like this:
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();
CDocument *pDoc = pChild->GetActiveDocument();
this only gets the "active" document, so it might not do exactly what you want.
ILockBytes
|
|
|
|
|
Hi
I'm working on a SDI project.After looking through my program, i still dont know how to adapt it to SDI project, since there's no m_pMainWnd variable in the CWinApp class. And i'm not sure if GetActiveDocument(); is relevant for a SDI?
thks thks
|
|
|
|
|
raner wrote:
since there's no m_pMainWnd variable in the CWinApp class
here's it is, more generic :
CWnd *p = AfxGetMainWnd()->GetActiveWindow();
if (p->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
{
CFrameWnd *pfr = (CFrameWnd *)p;
CDocument *pdoc = pfr->GetActiveDocument();
}
-c
ILockBytes
|
|
|
|
|
Hi
i tried the easy method of carrying the pointer around as follows.But it is not working.
In CView class:
CRainAttDoc* pDoc= (CRainAttDoc*) GetDocument();<br />
CMyObject *pMyObject= new CMyObject;<br />
pMyObject->SetDocument(pDoc);<br />
pMyObject->ShowGraph()
In CMyObject.h
private:<br />
CRainAttDoc* pDoc;
In CMyObject.cpp:
void CMyObject::ShowGraph()<br />
{<br />
CSRawDataArray &dataArray = ((CRainAttDoc*)pDoc)->GetRawDataArray();<br />
}<br />
<br />
<br />
void CMyObject::SetDocument(CRainAttDoc *pDocument)<br />
{<br />
pDoc=(CRainAttDoc*) pDocument;<br />
}
where CSRawDataArray is a CArray template and GetRawDataArray() is a function of CRainAttDoc which returns a CSRawDataArray.
While debugging, the SetDocument function is found to record the pDoc pointer correctly.However when the pgm runs to the ShowGraph() function, the pDoc became incorrect.
know what's wrong?
thks alot!
|
|
|
|
|
i don't see anything wrong with that code.
??
-c
A | B - it's not a choice.
|
|
|
|
|
hi , ive been asked to make a movie file that will open a browser popup window during play to advertise to our media viewers.
i dont know if its really c++ 's area to do this, but i thought maybe someone would have a suggestion since this is the most technically resourceful group on the net I know of
any tips / suggestions appreciated,
thanks
josh
todo....
:: insert inpirational text here ::
|
|
|
|
|
jDawwg wrote:
hi , ive been asked to make a movie file that will open a browser popup window during play to advertise to our media viewers.
i dont know if its really c++ 's area to do this
It's not. It's a Microsoft-only thingie, using their proprietary WMF (or WMA or whatever the TLA is).
any tips / suggestions appreciated
If I were to watch a video strip, and was greated by some extra window popping up I'd be less than happy. My suggestion is: if you really need to do this, put this advertisement at the beginning of the video stream.
|
|
|
|
|
In MFC App Wizard EXE Project
Simply say------
I am drawing circles and rectangles on screen and then storing these figures as bmp file.
I want to exe be invisible when it is activated and perform also the above mentioned work.
I am drawing figures on screen of my application window in OnDraw(CDC *pDC)
method.
Note:
I have tried
ShowWindow(SW_HIDE)
it hides exe but the required work is not done.
I want my window hidden and perform the work required.
Give me suggestions how to do it. And whether any changes are required in application wizard generated code.
|
|
|
|
|
mkashifkkj wrote:
I want to exe be invisible when it is activated and perform also the above mentioned work.
Huh? Define "invisible". You want to mess up the users screen with "circles and rectangles" without the user ever seeing your application window? If so, it's easy: Just create your window (fullscreen), read up on SetLayeredWindowAttributes to be able to use the color key, and do your stuff.
If you're to use this on
|
|
|
|
|
Please do not answer this kind of question before knowing what the guy really wants, or once after downloading some stuff, you'll get your screen full of circles without knowing what happens.
~RaGE();
|
|
|
|
|
Rage wrote:
Please do not answer this kind of question before knowing what the guy really wants, or once after downloading some stuff
I don't "download" anything but source code anymore. If I can't compile it myself, I don't run it. I must in part thank Microsoft for having helped to display this way to me (with their "patches").
you'll get your screen full of circles without knowing what happens.
Hey, I remember the speed the Amiga could draw rectangles all over the screen. I bet it could draw circles almost as fast! (and we didn't even need 1.5 GB of disk and 128 MB of RAM just to log in back then).
|
|
|
|
|
Mike Nordell wrote:
I remember the speed the Amiga could draw rectangles
All due to assembler and this old VGA display mode (Mode 3 ? Yeah, that's it). Incredibely fast...
~RaGE();
|
|
|
|
|
First off, be advised,...I am a newbie at C++ programming and have a very simplistic notion of the complexity of the Windows System.
I am reading a book by Feng Yuan, "Windows Graphics Programming" 2002, in which he supplies a humongeous amount of hard intel on the Windows Graphics Engine and related DLL components. His book mainly describes the GDI API and is targeted at the Windows 2000 version. Anyway,...
He supplies a number of diagnostic and demo programs with source code as examples for annoying persons like me, and I'm curious if any of you are familiar with this. Specifically, there is a program towards the beginning of the book, called SysCall, which displays an output window with a comprehensive listing of all of over 600 Systems Calls that can be made from user processes to kernel mode address space (not even really sure what that is). Many of these calls appear to be a kernel version of the same calls that a programmer would use in writing a Win32 application.
I'm wondering several things. Why would this information be useful from a program design standpoint? And, how could this program be altered to work correctly on older versions of Windows (my system runs Windows 98)?
The code in the book is copyrighted, but, I'm sure I could list enough of it to give you an idea of what the program entails.
By the way, the book is great,...and way beyond my current comprehension of Windows graphics programming.
|
|
|
|
|
To modify the program to work with older Windows may not be possible, it depends on what API's he is calling, and if they have a W98 equivelant.
Yes, it's without a doubt the best book on GDI by a large margin. Too bad that he hasn't done one on GDI+.
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
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Nebulous Person wrote:
listing of all of over 600 Systems Calls that can be made from user processes to kernel mode address space (not even really sure what that is).
Here you displayed this book isn't for you. If you don't even know what it is, stick to Win32. When Win32 limits you, then, maybe, these calls might be of use.
Why would this information be useful from a program design standpoint?
It wouldn't, and thereby the question is wrong. The Correct question would be "Is this information of use from a program design standpoint?" and the answer is: no, at least not now for you. Read, and understand, the sourcecode at sysinternals (former winternals) first.
how could this program be altered to work correctly on older versions of Windows
How the heck would we know without neither seeing the code, nor knowing what it really does? Since you yourself don't even know what the program does (or at least not how it's done), is this question even relevant?
If you want to use a function call available from later OSes in an older OS (that doesn't implement this call itself), you'd have to write that code yourself like any good hacker.
|
|
|
|
|
|
I've got a dialog docked and it contains 2 CButtons. They show up and act as though they were disabled, but when I check IsWindowEnabled() it comes back true. Also, under properties for both buttons, disabled is UNchecked.
I can't figure out how to get these buttons working.
Can someone please point me in a direction? Preferably the right one.
If it helps, I had an issue with a group box on this same dialog, but it showed up transparent even though it wasn't selected that way.
I'm using Christi Posea's docking controls http://www.datamekanix.com/[^].
Thanks in advance!
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
you have to add command handling functions to the buttons
to do that, i think you double-click the buttons in the dialog editor if you made a class for the dialog
- Roman -
|
|
|
|
|
The button is actually greyed out when the dialog comes up, as though it were disabled. I know how to add OnButtonClicked(), etc. The button however is not at a state where clicking even works.
BW
"Gandalf. Yes. That is what they used to call me. Gandalf the Grey. *I* am Gandalf the White."
- Gandalf the White
|
|
|
|
|
1. I made the AboutBox modeless for a test.
2. I added a CEdit to it.
Ran it, entered text, and pressed Enter.
Code in OnCommand of CAboutDlg
if( wParam == IDOK && lParam == 0 )
{
CString strText;
CWnd* p = GetFocus();
p->GetWindowText(strText);
strCommand.Format(_T("Command from editbox: %s"), (LPCTSTR)strText);
AfxMessageBox(strText);
}
No response.
I had renamed the OK button as IDNOTOK instead of IDOK. wParam and lParam are definitely not 1 (IDOK) and 0. SO it never enters the if block.
WHat do I need to do if I want to Enter key with this mechanism ? I'm doing it this way because I have many textboxes and the user might enter in any one of them....so I cant say m_text1.GetWindowText(strT); etc....
Appreciate your help,
ns
|
|
|
|
|
Change
if( wParam == IDOK && lParam == 0 ) to
if( LOWORD(wParam) == IDOK )
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I think our friend ns is really confused. see the thread "WM_COMMAND and wParam" immediately below this one
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Yup. Sometimes it is not clear to me whether answering this simple, out-of-context questions is of any use to anybody.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi Joaquin,
I got really alarmed reading your thought that maybe your answers to my simple questions are not too useful. To your experienced eyes my queries are simple, but I do want to tell you that I struggle long and hard before I post, so to me they are really tough issues for which I could not find an answer or a sample to guide me. So PLEASE PLEASE keep responding. I consider you as one of my very valuable resources. CP has been extremely useful to me and has nudged me along with my project, which runs into a zillion problems everyday. I've got a dozen books, some access to a C++ but not MFC programmer, and of course the web and MSDN, and you folks at CP, and these are what I turn to to get things done.
Appreciate your help,
ns
|
|
|
|
|
First of all, accept my excuses if you felt in any way offended by my post. What I meant is that sometimes the questions are about so minute details and so detached from a general context that possible answers, even if correct, may lead to unexpected side results later on. I know sometimes one just gets dropped into the mainstream of a project with tight completion dates and has no time to learn about the general scheme of things, but IMHO it pays to save some time away from the project and dedicate it to careful reading of tutorials and books so as to grasp the general concepts behind MFC and other huge libraries.
That said, rest assured I will be happy answering as many questions as I think I have an answer for.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|