|
Yes I did, but of course what I'm trying to do it's using the new platform
with the old MFC.
But in debug mode it was really straight.
Thank
|
|
|
|
|
AndreaF wrote: Yes I did, but of course what I'm trying to do it's using the new platform
with the old MFC.
Out of any special reasons?
The new MFC and the compiler is superiour in every respect. Use it!
From my experience, there is just a little Find&Replace to be done. (And switching off some warnings )
As of why it is working in debug: Have you tried setting the 'C++'-part of the project-properties like it is in 'DEBUG' mode? Maybe some setting here lets the compiler stop instead of simply complain.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I'll try and let you know
|
|
|
|
|
You just told me here[^] that everything was the same.
|
|
|
|
|
|
Hello All!
Its my first message on the forum though I am a member of CodeProject for quite a while...
I am currently trying to learn OpenGL on Win32 Platforms to simplfy the task, I downloaded GLUT32 Toolkit and did the following
1) Pasted the GLUT.h in Include/gl directory (gl.h, and glu.h already there...)
2) Pasted the GLUT32.lib in Lib Directory
3) Pasted GLUT32.dll in System32 Directory
Now
#include <gl/glut.h>
give error
c:\Documents and Settings\Mohsin Hijazee\My Documents\Visual Studio Projects\OpenGL Test\stdafx.h(21): fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory
I am unable to understand why is it so...
Please guide me what is that I am doing wrong?
Best regards,
Mohsin
Polite Programmer
More Object Oriented then C#
|
|
|
|
|
Go to project>settings and in the object library module box add the following
to link to OpenGL Libraries
Opengl32.lib glaux.lib glu32.lib
Now compile
Does this solve your problem
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
It's not a link error but a compile error. So, the first thing to check is the include directories, not the library directories.
But anyway, this problem will probably occur later if didn't add the library directory to his project .
|
|
|
|
|
Make sure that in your project settings you have added the path to the include folder of openGL in the "Additional Include Directories" option.
This option can be found in the C/C++ tab -> General.
|
|
|
|
|
Typically OpenGL files are placed in the GL subdirectory under the main VC++ include directory which is why the include statements say GL/glut.h.
I think he should make sure that glut.h is in with the other OpenGL headers.
|
|
|
|
|
As you all guyes sugested, Its not a linking problem, but compliation problem. I have mentioned all the libs like GL32.lib etc....
Amazing fact is that I am including two files from include/gl directory and those are gl.h and glu.h but no error at all!
I put GLUT.h in the same directory, and following statment prodcues error
<font color"blue">#include</font> <gl/glut.h>
Strange...
Any clue now?
Polite Programmer
More Object Oriented then C#
|
|
|
|
|
Hi,
How can I implement zoom in and outfor graphic objects in the view.
These are not bitmaps. ANy links?
thanks
Leya
|
|
|
|
|
to display a DC with different dimensions that originals you could use CDC::StretchBlt.
|
|
|
|
|
Depends of what the objects are. Please provide more information.
If you draw them yourself, then draw them bigger, that's simple.
|
|
|
|
|
Here's a little to get you started. Start a new MFC/SDI app and plop this stuff in the appropriate locations. Set up menu/toolbar buttons for the zoomin/zoomout. Add some drawing code to your OnDraw and you should find that the drawing is fit_to_width in the view and it should be fit to width when printing. The rest is up to you. have fun...
///////////////////////////////////////////////
//Constants
const int MAX_SCALE = 20; // The maximum scale factor
//CDocument members...
protected:
CSize m_DocSize;
CSize CYourDoc::GetDocSize() const
{
return m_DocSize;
}
CYourDoc::CYourDoc()
{
// TODO: add one-time construction code here
m_DocSize=CSize(2000,2800);
}
//CScrollView members...
protected:
int m_Scale;
CYourView::CYourView()
{
// TODO: add construction code here
m_Scale=1; // Set scale factor 1:1
SetScrollSizes(MM_TEXT,CSize(0,0)); // Set arbitrary values
}
void CYourView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CScrollView::OnPrepareDC(pDC);
// TODO: Add your specialized code here and/or call the base class
// Set up the DC for the current scale factor
int nExtentX;
int nExtentY;
CSize sizeDoc;
CRect rectClient;
// Allows the rectangle to include the bottom and rightmost logical unit
// SetGraphicsMode(pDC->m_hDC,GM_ADVANCED);
pDC->SetMapMode(MM_ISOTROPIC); // Allow scaling with aspect ratio preserved
// Get pertinent rectangle data
GetClientRect(&rectClient);
sizeDoc=GetDocument()->GetDocSize();
sizeDoc.cy=(-sizeDoc.cy); // Y goes down as it increments
pDC->SetWindowExt(sizeDoc); // Window extent is size of document
// Calculate viewport extent
nExtentX=(int)(GetScale()*rectClient.Width());
nExtentY=(int)((GetScale()*((nExtentX*sizeDoc.cy)/(sizeDoc.cx))));
// What kind of device context do we have?
if (pDC->IsPrinting()==TRUE) {
// Printer Context. Allow printing to edge of context. No scaling. Margins?
pDC->SetViewportExt(pDC->GetDeviceCaps(HORZRES),-pDC->GetDeviceCaps(VERTRES));
} else {
// Context is for screen
pDC->SetViewportExt(nExtentX,nExtentY);
}
}
int CYourView::GetScale()
{
return m_Scale;
}
void CYourView::SetScale(int nScaleFactor)
{
m_Scale=nScaleFactor;
ResetScrollBars(); // Adjust scrollbars to new scale
}
void CYourView::OnUpdateViewZoomout(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (GetScale()>=2) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CYourView::OnUpdateViewZoomin(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if (GetScale()<MAX_SCALE) pCmdUI->Enable(TRUE);
else pCmdUI->Enable(FALSE);
}
void CYourView::ResetScrollBars()
{
CSize sizeDoc;
CClientDC dc(this);
this->OnPrepareDC(&dc); // Update the device context
sizeDoc=GetDocument()->GetDocSize();
dc.LPtoDP(&sizeDoc); // Logical to device
this->SetScrollSizes(MM_TEXT,sizeDoc); // Update scrollbars
}
void CYourView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
// TODO: calculate the total size of this view
ResetScrollBars();
}
void CYourView::OnSize(UINT nType, int cx, int cy)
{
CScrollView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
ResetScrollBars();
}
// Toolbar/menu button handler
void CYourView::OnViewZoomin()
{
// TODO: Add your command handler code here
if (GetScale()<MAX_SCALE) SetScale(GetScale()+1);
Invalidate();
}
// Toolbar/menu button handler
void CYourView::OnViewZoomout()
{
// TODO: Add your command handler code here
if (GetScale()>=2) SetScale(GetScale()-1);
Invalidate();
}
-- modified at 9:09 Tuesday 2nd May, 2006
|
|
|
|
|
Hello comunity,
how to create an own messenger like MSN Messenger or Yahoo Messenger, they dont neet to have all the functions like the other, just to send and recive messages with other!?
Wich functions i need to use for that, does messenger works like chatserver???
regards
break;
|
|
|
|
|
Hi,
There are a few examples of messaging program on codeporject. I suggest download one of them look at it. Try to understand the various concepts involved e.g. client/server, connection vs. connectionless protocol, etc.. then write your own.
|
|
|
|
|
You want to make a server or client or both? Take a look at the XMPP protocol, recommeded by IETF, and is currently used by Google Talk.
http://www.xmpp.org/
You can find open source client and server implementations here.
http://www.jabber.org/
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hello,
thanx for your answers! I try with one of the examples in this community!
with best regards
break;
|
|
|
|
|
if we load an exe file in CMemFile object how can we run that exe file from there (memory)?
eg, CMemFile m_file;
....... // loaded exe into memory in binary format
.......
.......
WinExec("m_file",SH_SHOW);
above statement donot executes it looks in the directory for exe file m_file.exe.
All i want is to execute that program which is loaded in memory file from memory and not from disk.
|
|
|
|
|
This has been a frequently asked question. However, the consensus has always been that you cannot. 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
|
|
|
|
|
|
You can't do this, because the EXE that starts a process has to be an on-disk file. The OS loader gets the EXE into memory with a memory-mapped file.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
How to set the static edge/ client edge property of a dialog box to true at run time. Iam using SDK.
|
|
|
|
|
with ModifyStyle you can change some object styles
|
|
|
|