|
Thanks for the heads up re: XP. I've been very happy with Win2K so far and plan to use XP mainly for testing my apps to ensure they run fine on all supported platforms.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thias might be a stupid question, but how do I change the text of the title bar?
The title bar is automatically filled with the application name given to the AppWizard. What when I want to change the application name from "TestApp" to "LevelEdit"?
Greets,
Jakob Bysewski
---------------------
Build a system that even a fool can use, and only a fool will use it.
|
|
|
|
|
|
Ahem, sorry. I found the answer...
*peng*
Build a system that even a fool can use, and only a fool will use it.
|
|
|
|
|
simple
in Your OnInitDialog()
just place
this->SetWindowText("Whatever You want to appear on Title");
enjoy -
CodeTheDreams();
|
|
|
|
|
Another solution is UpdateFrameTitleForDocument().
Kuphryn
|
|
|
|
|
I am searching for an easy way to query the amount of memory on an installed graphic card under windows.
Is there an easy way to do this, e.g. using Windows API?
I couldn't find any information about this.
Thanks in advance.
|
|
|
|
|
I don't think that there is a simple API function to get the size of the video memory. But the way to get the size of the video memory with DirectDraw is not very hard.
Try the IDirectDraw::GetCaps function!
HRESULT GetCaps(
LPDIRECTDRAW lpDD,
LPDDCAPS lpDDDriverCaps,
LPDDCAPS lpDDHELCap
);
You can found the size in the DDCAPS structur:
typedef struct _DDCAPS {
DWORD dwSize;
DWORD dwCaps;
DWORD dwCaps2;
DWORD dwCKeyCaps;
DWORD dwFXCaps;
DWORD dwFXAlphaCaps;
DWORD dwPalCaps;
DWORD dwSVCaps;
DWORD dwAlphaBltConstBitDepths;
DWORD dwAlphaBltPixelBitDepths;
DWORD dwAlphaBltSurfaceBitDepths;
DWORD dwAlphaOverlayConstBitDepths;
DWORD dwAlphaOverlayPixelBitDepths;
DWORD dwAlphaOverlaySurfaceBitDepths;
DWORD dwZBufferBitDepths;
DWORD dwVidMemTotal;
DWORD dwVidMemFree;
DWORD dwMaxVisibleOverlays;
DWORD dwCurrVisibleOverlays;
DWORD dwNumFourCCCodes;
DWORD dwAlignBoundarySrc;
DWORD dwAlignSizeSrc;
DWORD dwAlignBoundaryDest;
DWORD dwAlignSizeDest;
DWORD dwAlignStrideAlign;
DWORD dwRops[DD_ROP_SPACE];
DWORD dwReservedCaps;
DWORD dwMinOverlayStretch;
DWORD dwMaxOverlayStretch;
DWORD dwMinLiveVideoStretch;
DWORD dwMaxLiveVideoStretch;
DWORD dwMinHwCodecStretch;
DWORD dwMaxHwCodecStretch;
DWORD dwReserved1;
DWORD dwReserved2;
DWORD dwReserved3;
DWORD dwSVBCaps;
DWORD dwSVBCKeyCaps;
DWORD dwSVBFXCaps;
DWORD dwSVBRops[DD_ROP_SPACE];
DWORD dwVSBCaps;
DWORD dwVSBCKeyCaps;
DWORD dwVSBFXCaps;
DWORD dwVSBRops[DD_ROP_SPACE];
DWORD dwSSBCaps;
DWORD dwSSBCKeyCaps;
DWORD dwSSBCFXCaps;
DWORD dwSSBRops[DD_ROP_SPACE];
DWORD dwMaxVideoPorts;
DWORD dwCurrVideoPorts;
DWORD dwSVBCaps2;
DWORD dwNLVBCaps;
DWORD dwNLVBCaps2;
DWORD dwNLVBCKeyCaps;
DWORD dwNLVBFXCaps;
DWORD dwNLVBRops[DD_ROP_SPACE];
DDSCAPS2 ddsCaps;
} DDCAPS,FAR* LPDDCAPS;
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Thanks for the answer. I thought that there is a way using DirectX but I wanted to avoid it. But since I did not find any other ways I think I must use it.
|
|
|
|
|
Hi all
How do you draw an ellipse using c++ given that you've got all the coefficients (ie. a,b,c,d,e & f). The ellipse() function that i know only accepts the vertices of the rectangle (as the parameters) in which the ellipse should be drawn. I need it for my final year project at uni. Thanks a lot
|
|
|
|
|
Well,
the first aproach might be to calculate the enclosing rectangle of your ellipse function by using the first degration( german:Ableitung) in x and y. for finding the minimum and maximum coordinates. But then you will find out, that the ellipse function will only draw parallel to the x- and y-axis.
The only way to draw an arbitrary ellipse is to use the path functions with transform parameters/matrices. These graphic functions are only supported in Windows NT/2000. With XP I can't tell. They are definitly not supported in Win95/98/ME.
Even dwarves started small.
|
|
|
|
|
how can i use this path function?can you explain a little bit more please? i'm using win2k.
|
|
|
|
|
Okay,
here is the code. I took it from a private project, I developed in 1996. It took me quite a while to find it.
void CGraphEllipse::zeichne(CDC* pDC)
{ if( m_listAbschnitte.IsEmpty() ) return;
if( m_a == 0.0 ) return;
CPen *pOldPen = pDC->SelectObject(&m_penStift);
CBrush *pOldBrush = pDC->SelectObject(&m_brPinsel);
XFORM xfMatrix;
xfMatrix.eM11 = 1.0;
xfMatrix.eM12 = 0.0;
xfMatrix.eM21 = 0.0;
xfMatrix.eM22 = 1.0;
xfMatrix.eDx = 0.0;
xfMatrix.eDy = 0.0;
double dSinPhi = 0;
double dCosPhi = 1;
double dPhi = 0;
if( m_c != m_a ) dPhi = atan2(2*m_b,(m_a-m_c))/2.0;
dSinPhi = sin(dPhi);
dCosPhi = cos(dPhi);
xfMatrix.eM11 = dCosPhi;
xfMatrix.eM12 = dSinPhi;
xfMatrix.eM21 = -dSinPhi;
xfMatrix.eM22 = dCosPhi;
xfMatrix.eDx = m_ptZiehZentrum.x;
xfMatrix.eDy = m_ptZiehZentrum.y;
SetGraphicsMode(pDC->m_hDC,GM_ADVANCED);
pDC->BeginPath();
SetWorldTransform(pDC->m_hDC,&xfMatrix);
pDC->Ellipse(-(int)m_dR1,-(int)m_dR2,(int)m_dR1,(int)m_dR2);
pDC->EndPath();
if( m_bGeschlossen )
{ if( m_bOpaque ) pDC->StrokeAndFillPath();
else pDC->StrokePath();
}
else pDC->StrokePath();
pDC->SelectObject(pOldPen);
pDC->SelectObject(pOldBrush);
ModifyWorldTransform(pDC->m_hDC,NULL,MWT_IDENTITY);
SetGraphicsMode(pDC->m_hDC,GM_COMPATIBLE);
}
This function was used to draw a arbitrary rotated ellipse.
Of course, you have to do your own calculations for the centerpoints and that stuff.
The point of interest is the calculation of the transformation matrix. But this you should have alredy done if you have the coeffx of your ellipse.
Hope this helps
See also help for XFORM and CDC Path functions in your VC-Compiler
G. Steudtel
Even dwarves started small.
|
|
|
|
|
Well,
the first aproach might be to calculate the enclosing rectangle of your ellipse function by using the first degration( german:Ableitung) in x and y. for finding the minimum and maximum coordinates. But then you will find out, that the ellipse function will only draw parallel to the x- and y-axis.
The only way to draw an arbitrary ellipse is to use the path functions with transform parameters/matrices. These graphic functions are only supported in Windows NT/2000. With XP I can't tell. They are definitly not supported in Win95/98/ME.
G. Steudtel
Even dwarves started small.
|
|
|
|
|
Is it better, when designing visual components to register them with RegisterClass so that a user can place a custom control in the resource editor; or to simply use a CWnd derived class and treat the visual components as a simple C++ class entity ?
I think that RegisterClass is something that is more Win32 lingo than C++ (and/or MFC).
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Personally I'd go the RegisterClass route. There have been times I've used a custom control using straight Win32, no MFC or classes. It'll make your control usable than just MFC, you could use it from VB, Delphi, Python, who knows what else.
Joel Lucsy
|
|
|
|
|
Hy guys,
I'm building an application (Visual C++) that has to write the results of elaboration on a CD-ROM using the ISO9660 format (praticly creating the ISO-image and after burn a CD-R!!).
I know that in WindowsXP this operation is integrated inside the OS (or better the OS use automaticly the SW layer relative to burn CD)but in my case I'll use Windows2000.
Anyway,I suppose that will be necessary to include a library or buy a SDK but unfortunatly I have no ideas about where and how find it and eventually some explaination to how use it.
Someone have some suggests for me,please.
Thanks in advance
Andrea
|
|
|
|
|
Read all you can about the ISO format, cause you might have to code everything yourself. There are lots of open source rojects where you can learn about CD-ROM image creation.
Finally there are a few CD-ROM writing libraries and SDK like www.padus.com and others that might help you.
|
|
|
|
|
Hi,
I'm using GDI+ in my MFC based application and create GDI+ classes on the fly using the new operator as follows:
Bitmap* mybitmap = new Bitmap(320,24);
The above line compiles fine if I build the application in release mode, but in debug mode, compiler (VC++6.0 w. SP5, latest platform sdk) fails with:
error C2660: 'new' : function does not take 3 parameters
That is because of mfc's debug definitions on top of the file:
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif
and DEBUG_NEW is defined in afx.h as:
#define DEBUG_NEW new(THIS_FILE, __LINE__)
So, what exactly is wrong with calling a constructor with parameters? Does the "debug" version new operator handle the case incorrect or am I making a terrible mistake somewhere?
Any help would be appreciated.
P.S: Bitmap(320,200) is the same as Bitmap(320,200,PixelFormat32bppARGB) and neither case it didn't compile.
|
|
|
|
|
http://www.codeproject.com/vcpp/gdiplus/gdiplusspeed.asp#xx81095xx
Read the thread "Can't create bitmaps with new"
|
|
|
|
|
I found if you comment out the line #define new DEBUG_NEW it will work just fine. You just won't have any indications that you're leaking memory.
Joel Lucsy
|
|
|
|
|
Thanks for the comments, though I know that it works without defining DEBUG_NEW or with using the new operator from globalnamespace (i.e. ::new) as described in Benjamin's comment, but does anyone have any idea why it doesn't work with GDI+ classes? I mean there must be some error somewhere, since the debug_new operator seems to work fine with classes who take parameters in their constructors but not with GDI+.
For example I have created a class with
class CTest <br />
{<br />
public:<br />
CTest();<br />
CTest(int x);<br />
virtual ~CTest();<br />
};<br />
and it works fine by
CTest* test = new CTest(3);
and further testing.. tadaa I found the error!
if your class lacks a constructor without parameters (so do the GDI+ classes), as in:
class CTest <br />
{<br />
public:<br />
CTest(int x);<br />
virtual ~CTest();<br />
};<br />
the debug new operator fails on the following line:
<br />
CTest* test = new CTest(3);<br />
Must be a bug or a lazy implementation.
edit:
That wasn't true, I retested it and debug_new works with the CTest class in both cases.
I'm pretty confused by now..
|
|
|
|
|
Hope I can post this here. How do I disable/enable the message that comes up when you want to delete a file in general on windows? I'm not looking for tis info in Help in the right way so I cant find it...
Appreciate your help,
ns
|
|
|
|
|
Right click on your rec. bin and select properties, then check or uncheck the 'Display delete confirmation dialog' check box.
Or did you mean in code?
Dylan
|
|
|
|
|
Nope> Just mechanically like you informed me. Many thanks!
Appreciate your help,
ns
|
|
|
|