|
Hi :
I have a question on OnSetCursor for CRectTracker. During tracking, it shows the resize arrows when the mouse pointer is at the edges. Such as <->.
How do I overwrite this if I want it to display another icon, maybe a different color hand ?
The CRectTracker->OnSetCursor function returns only a BOOL, so I suppose the cursor is not set there.
Any pointers will be appreciated.
|
|
|
|
|
Quek Khoo Boon wrote:
The CRectTracker->OnSetCursor function returns only a BOOL, so I suppose the cursor is not set there.
It is. Override this function, comment out last line, and set your own cursor in it.
~RaGE();
|
|
|
|
|
Hi
A beginner here.We always use GetDocument() function of CView class to retrieve a pointer to the CDocument class. However this time, i need to get the pointer from a CObject derived class. But i've no idea how to do that at all. Can anyone help?
Anyway i always wondered whether i should always place my data in the CDocument class. Because OOD seems to dictate that data should be contained in its own relevant classes for encapsulation. However the Document-View architect seem to suggest placing all data in the CDocument class. Any comments to help me resolve this paradox?
thks
moo
|
|
|
|
|
raner wrote:
Any comments to help me resolve this paradox?
there's no paradox. the "document" in doc-view is the data. the doc itself can contain other classes to actually hold the data (like arrays or whatnot), but the CDocument class is (theoretically) supposed to be the embodiment of your data. the view is just a way to look at the data.
raner wrote:
i need to get the pointer from a CObject derived class
the easiest way is to just carry around a pointer to your CDocument. but, you can also get a pointer to the current doc via CFrameWnd::GetActiveDocument (and you can get the frame wnd from CWinApp).
-c
Zzzzz...
|
|
|
|
|
but my class is CObject derived, so how do i make use of CFrameWnd::GetActiveDocument to import the pointer? thks thks
To carry around the pointer, do you mean something like the below codes?
In CView class:
CPgmDoc* pDoc= (CPgmDoc*) GetDocument();
CMyObject *pMyObject= new CMyObject;
pMyObject->SetDocument(pDoc);
In CMyObject:
void CMyObject::SetDocument(CRainAttDoc *pDocument)
{
pDocument=pDoc;
}
thks for the help.Sorry if this seems painfully elementary;P
|
|
|
|
|
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
|
|
|
|