|
would it like to know how to divide at several quadrants a Form ? would like to know how to count Label of Panel, not Form? would it like to know how to divide at several quadrants a Panel?
All this using C++ Builder 6
I can learn mora about c++
|
|
|
|
|
Try "C++ Builder forums", like this[^].
Maxwell Chen
|
|
|
|
|
if i type code why doe it not work what would be the right way
int a;
a=5;
textBox1->text = a;
it does not display 5 it gives an error
thanks
morgus
|
|
|
|
|
your text box would be containing the sring value. you can assign
textBox1->text="5";
Cheers
"Peace of mind through Technology"
|
|
|
|
|
in addition to previous answer, you can convert an integer to a string using itoa[^].
-Saurabh
|
|
|
|
|
After assigning value, call UpdateData(false);
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Hi Scientest ,
you need to convert from int to string for use in CEdit
you can use:
CString str;
int i;
i=5;
str.Format("%i",i);
textBox1->SetWindowText(str)(if textbox is CEdit)
or
TCHAR Buffer[15];
itoa(i,Buffer,10);
textBox1->SetWindowText(Buffer);//(if textbox is CEdit)
|
|
|
|
|
Hi,
I have a problem using the delete operator on an object. I have been debugging the code for hours and have run out of ideas. My code is similar to the following:
MyClass *MyClassPointer;
MyClassPointer = new MyClass(PointerParam1, PointerParam2);
delete MyClassPointer;
The code "delete MyClassPointer" cause a Debug Assertion saying that line 1044 of dbgheap.c caused an error at the expression _CrtIsValidHeapPointer(pUserData).
I'm completely stumped as to why I can't delete this particular object. I am dynamically allocating and deleting lots of other objects without any problem but this one is causing me grief.
Any ideas as to what I should be looking for ?
Thanks
Ethann Castell
|
|
|
|
|
can you show us destructor for MyClass, it seems that in its destructor you are either trying to delete something that isn't allocated or already deleted.
-Saurabh
|
|
|
|
|
A failed assert in a delete call means you either already freed that memory, or you wrote outside the block of memory allocated for the object. Either way, it's a bug.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thank you both for your help.
The problem was caused by trying delete a non existant object in the destuctor of a base class. I got put off because I was tracing in the debugger but tracing into the delete does not seem to take you through the destructors. Once I put an explicit breakpoint in the destructor of the base class, the problem became clear.
Thanks again.
Ethann
|
|
|
|
|
this is not a VC question.
my friend gave me a video card - i am a dummy for hardware.
info on card is:
---------------------
MGI G4+ MDH4A32G
FC ... with FCC standards
CE N408 SA
405B
---------------------
do you know what the info mean (conpany etc)?
where to download driver of the video card?
thx
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
This really belongs in the hardware section... but since this is my area of expertise... I'll answer it and let someone else decide to move it.
MGI G4+ MDH4A32G is a Matrox Millennium G400
link to drivers if you need them: http://www.matrox.com/mga/support/drivers/latest/home.cfm[^]
It's pretty old, but it was one of the first dual head (dual screen) video cards produced which made it unique. You'd probably be better off with the lowest end of a current generation at about $50 cash, but that is up to you. It had limited performance even for its time, but for dual screen windows, artists, developers type stuff, it was great. My boss had one of the first ones released and had it for a very long time, and used it primarily for dual-screen Visual C development/debugging, not for graphics. For that it did him well.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
In my header file I am trying to declare and initialize an array,
float front[4][3] = {{1.0f, 1.0f, 1.0f},{-1.0f, 1.0f, 1.0f},{-1.0f,-1.0f, 1.0f},{1.0f,-1.0f, 1.0f}};
I have tried it with and without ',' between the rows.
I have even tried it with only {,} (commas between entry which should just fill up the array in order)
I get syntax error from visual studio .net
Error 1 error C2059: syntax error : '{'
thanks,
kuroiryu
|
|
|
|
|
Tried it on my VS2005 and it seems to compile without a problem. Are you sure the error is at the same line listed above?
gmileka
|
|
|
|
|
I think you doing this inside a class, which is not allowed. Instead initialize array in the constructor.
-Saurabh
|
|
|
|
|
if i declare variable in the header
float front[4][3];
can i still initialize it with {} in the constructor?
front = {{1.0f, 1.0f, 1.0f},{-1.0f, 1.0f, 1.0f},{-1.0f,-1.0f, 1.0f},{1.0f,-1.0f, 1.0f}};
kuroiryu
|
|
|
|
|
Static member arrays (whether const or not) can be initialized in their definitions (outside the class declaration). For example:
class WindowColors
{
public:
static const char *rgszWindowPartList[7];
...
};
const char *WindowColors::rgszWindowPartList[7] = {
"Active Title Bar", "Inactive Title Bar", "Title Bar Text",
"Menu Bar", "Menu Bar Text", "Window Background", "Frame" };
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/specl_32.asp
|
|
|
|
|
in case you dont want to make variable static you can do following in the constructor.
float _front[4][3] = {{1.0f, 1.0f, 1.0f},{-1.0f, 1.0f, 1.0f},{-1.0f,-1.0f, 1.0f},{1.0f,-1.0f, 1.0f}};
memcpy(front, _front, sizeof(float)*12);
-Saurabh
|
|
|
|
|
How do I implement this?
tCircle::tCircle( double fNewX, double fNewY, double fNewRadix )
: cCenter.fX( fNewX ),
cCenter.fY( fNewY ),
nRadix ( fNewRadix )
{
}
I get the error "error C2059: syntax error : '.'" at "cCenter.fX( fNewX )"
regards
hint_54
-- modified at 20:24 Friday 14th April, 2006
|
|
|
|
|
If your class looks like this:
class tCircle
{
double fX;
double fY;
double fRadix
public:
tCircle( double fNewX, double fNewY, double fNewRadix );
};
Constructor implementaiton could be:
tCircle::tCircle( double fNewX, double fNewY, double fNewRadix )
: fX( fNewX ),
fY( fNewY ),
nRadix ( fNewRadix )
{}
gmileka
|
|
|
|
|
No. I have
class tDot {
public:
float fX, fY;
};
class tCircle {
public:
tCircle( void );
tCircle( float, float, float );
tCircle( tDot, float );
public:
float fRadix;
tDot cCenter;
};
I'm having trouble with the 2nd constructor.
Thx
hint_54
|
|
|
|
|
I would add a constructor to tDot.
class tDot
{
public:
float fX, fY;
tDot(float newfX, float newfY){ fX=newfX; fY=newFY; };
};
class tCircle {
public:
tCircle( void );
tCircle( float, float, float );
tCircle( tDot, float );
public:
float fRadix;
tDot cCenter;
};
tCircle::tCircle(double newX, double newY)
: cCenter( newX, newY)
{
}
gmileka
|
|
|
|
|
That's it! thx
hint_54
|
|
|
|
|
You should either use cCenter(fNewX, fNewY), assuming tDot have a constructor accepting two arguments or move cCenter.fX and cCenter.fY within the function body.
-Saurabh
|
|
|
|
|