|
|
I know this is a visual c++ forum and I'm really sorry, but this seems to be the only lounge where I get the best answers to questions, so please don't get too mad that this question is a little more general and not focused solely on visual c++.
On a normal coordinate system, the Y-Axis is positive in the upward direction and X-Axis in the right direction, which naturally makes the Z-Axis positive coming towards you. On a computer screen, however, we still measure the X-Axis as positive to the right, but now the Y-Axis is positive going downward, so is the Z-Axis now positive away from the viewer?
I'm asking this for finding the normal line to a polygon on the monitor, trying to determine if it is front or back facing. I just need to know for sure if I'm doing this correctly or not.
Again, sorry this isn't really a C++ question, but I think the people in this forum are the best with quick and intelligent responses!
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
AFAIK X-axis is always positive to the right, Z-axis is always positive towards the viewer, and Y-axis is positive up in every mode except text mode, in which case it is positive down.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
That is correct, for OpenGL. You can of course change between left hand and right hand coords in both OpenGL and Direct3D.
|
|
|
|
|
Can anyone tell me how to get around problems created by Norton AV and other antivirus software? For instance, a lot of products on the market are realtime products. They record music, they play music, they create documents, and so forth. How have people gotten around how Norton AV realtime protection handles files? I cannot be the only person who has problems with a product that creates files and Norton AV interferes with this, can I? Am I making any sense?
I was once told that if you have a product that creates files, antivirus software locks the file when it is scanning. And to get around such problems, you have to work with Symantec. Does anyone know for certain?
|
|
|
|
|
I've been using NAV for years, even before Symantec entered the picture, with no problems. You can configure it to ignore certain file extensions.
|
|
|
|
|
I have never seen that issue. It sounds like BS to me. Who told you NAV 'locks' files? If it is true, I have never seen/heard of it. Anyway, you should set NAV to only scan program files. Scanning MP3, AVI, etc is a waste of time.
|
|
|
|
|
Hi,
I can access the doc from the view this way:
CGeneratorDoc * pDoc = GetDocument();
How do I access the view from the doc?
|
|
|
|
|
One quick and dirty way is to create a dummy project with the view to create as CEditView. This in effect creates a notepad like application. You can then look at the Doc to see how it is done. I never remember exactly how, but this is how I go find out. Also, there is a way to get the view (if it is a SDI and you will not be attaching anymore). Look in the MSDN for artical Q108587.
Good Luck
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
Use GetFirstViewPosition() /GetNextView() .
|
|
|
|
|
I'm still getting errors.
This is SDI application and I have two FormViews. I am trying to access functions of the first view class from the document.
I'm doing the following in the document class:
POSITION pos = GetFirstViewPosition();
CView* pFirstView = GetNextView( pos );
(CMyView *)pFirstView-> Function();
But, I'm getting errors which points to the declaration of the GetDocument() in the view class as following:
c:\rulegenerator\generator.v.13.0\generator.v.5.0\generatorview.h(34) : error C2143: syntax error : missing ';' before '*'
c:\rulegenerator\generator.v.13.0\generator.v.5.0\generatorview.h(34) : error C2501: 'CGeneratorDoc' : missing storage-class or type specifiers
c:\rulegenerator\generator.v.13.0\generator.v.5.0\generatorview.h(34) : error C2501: 'GetDocument' : missing storage-class or type specifiers
Generator.cpp
.......
Please help
|
|
|
|
|
Which one of these lines is it on? It is complaining about something in the view.h. Make sure that the doc.h file is before the view.h in the #include list.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
even after casting the view to my view class, i can't access view class functions.
POSITION pos = GetFirstViewPosition();
CView* pFirstView = GetNextView( pos );
(CGeneratorView *)pFirstView-> OnPopupRemove();
error:
C:\RuleGenerator\Generator.V.14\Generator.v.5.0\GeneratorDoc.cpp(633) : error C2039: 'OnPopupRemove' : is not a member of 'CView'
c:\program files\microsoft visual studio\vc98\mfc\include\afxwin.h(3542) : see declaration of 'CView'
|
|
|
|
|
Yeah, it isn't. Included the header for your view. Make sure it is after the doc.h. That should solve your problem.
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
i have included view header after the doc header, still the casting is not working.
|
|
|
|
|
Try this:
POSITION Pos = GetFirstViewPosition();
ASSERT( Pos ); // Check to see if it returns a valid value.
CGeneratorView* pView = (CGeneratorView*)GetNextView( Pos );
pVeiw->OnPopupRemove();
or:
POSITION Pos = GetFirstViewPosition();
ASSERT( Pos );
CGeneratorView* pView = reinterpret_cast< CGeneratorView* >( GetNextView( Pos ));
pView->OnPopupRemove();
The dynamic_cast is best, you need to enable the RTTI in you build options to use this. It is better checking than the reinterpret_cast which does nothing.
Now, This is assuming that OnPopupRemove is a public method.
Larry
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
cool..that worked.
Thanks a LOT Larry!!
|
|
|
|
|
No Problimo! Glad I could help.
Larry J. Siddens
Cornerstone Communications
TAME THE DOCUMENT MONSTER
www.unifier.biz
|
|
|
|
|
CGeneratorView *pFirstView = (CGeneratorView *) GetNextView(pos);<br />
pFirstView->OnPopupRemove();
|
|
|
|
|
Your casting was wrong
You should have done it this way...
/********Your Code *****************/
(CGeneratorView *)pFirstView-> OnPopupRemove();
/************************************/
/********Suggestion*****************/
((CGeneratorView *)pFirstView)-> OnPopupRemove();
/************************************/
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I want to display files in listview using icons associated with file ext.
but I can't find where does window store info about files to extract icons from. Can somebody tell me how to do that ?.
Thanks in advance.
|
|
|
|
|
One solution is SHGetFileInfo().
Kuphryn
|
|
|
|
|
probably i lost my eyes looking 2 hours in msdn for this function.
Thanks for your help.
|
|
|
|
|
Hi,
I have a virtual (LVS_OWNERDATA) list control working just fine. Only problems is I can't programatically change an item's state. Docs say that the virtual list view does manage selection+focus state, and, when I click around, it surely does. But SETITEM, modifying the state, returns false, and does nothing.
Any ideas?
[edit] found it - LVM_SETITEM doesn't work, but LVM_SETITEMSTATE does. (yes, I was filling the LVITEM correctly)[/edit]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Post the code that sets the item state.
Kuphryn
|
|
|
|