|
Yeah. But he is saying the application is showing invalid numbers. That means it compiled.
Nibu thomas
Software Developer
|
|
|
|
|
I think we were both mistaken here. Here's the prototype for wsprintf :
int wsprintf( LPTSTR lpOut,
LPCTSTR lpFmt,
...
);
It's not UNICODE!
We were thinking of swprintf which looks like this:
int swprintf(
wchar_t *buffer,
size_t count,
const wchar_t *format [,
argument]...
);
There must be another reason for this problem.
Steve
|
|
|
|
|
Stephen Hewitt wrote: int wsprintf( LPTSTR lpOut, LPCTSTR lpFmt, ...);
I guess it's the TCHAR version of sprintf . But there is another one _stprintf .
Docs say it(wsprintf ) is implemented as Unicode and ANSI versions on Windows NT/2000/XP.
Nibu thomas
Software Developer
|
|
|
|
|
Nibu thomas wrote: I guess it's the TCHAR version of sprintf. But there is another one _stprintf.
wsprintf() is implemented by Windows, _stprintf() is the CRT version
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
The Oracle NUMBER data type is not an integer, so you can't use var.m_iVal like that. You should be checking the data type of the CDBVariant and using the correct field value appropriately.
NUMBER s map to the variant VT_DECIMAL type, which CDBVariant probably maps to a double - I generally don't use CDBVariant as it is too limiting.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
i changed all to double, but the problem still appear, it shows now 3516408 instead 500
Ryan may you tell me please about what you usually use instead of CDBVariant?
thanks to all for attention
|
|
|
|
|
I generally use COleVariant or just a plain VARIANT structure.
You mustcheck the type of data thats in the CDbVariant . Check the m_dwType field to determine the type of data - that is the only way you'll know which data member to use.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I need some help,could you help me?
In my program ,I create a other frame by myself:
pFrame = theApp.m_pDrawDocTemplate->CreateNewFrame(this, NULL);
theApp.m_pDrawDocTemplate->SetDefaultTitle(this);
pFrame->SetParent (NULL);
theApp.m_pDrawDocTemplate->InitialUpdateFrame(pFrame, this, TRUE);
the frame work well,but I can't debug it in step mode(the break point can't work).
this is all
|
|
|
|
|
Where did you put the breakpoint?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I put the breakpoint in OnDraw() event of the view (in the first line).but when run to here ,
the program will dead.
And if set the breakpoint in the menu event,the program will not response it.
|
|
|
|
|
I'm after a control like the one shown in this image. I'm considering putting a hyperlink control in a static text control, but was wondering if someone has already written such a non-MFC class ?
http://img136.imageshack.us/img136/9983/customcontrolwithcustomisableh.png
The control should have the following features:
1) allows you to mix normal text with hyperlink text (ie. blue in the screenshot).
2) mouse cursor should change to hand cursor when over link
3) should be possible to indent lines and long lines should wrap onto a new line if too long
4) text should not be selectable (although it would be nice if this could be enabled/disabled)
5) No text cursor should be displayed
6) should be dynamically resizable
7) Vertical scrollbar should be enabled and allow to scroll if there are too many lines
Does anyone know of an existing non-MFC class which can do this ?
Also, I'm considering using WTL (although not definite) and was wondering if it has an in-built class like this ?
-- modified at 19:31 Wednesday 26th April, 2006
|
|
|
|
|
Make one or Buy one! Thats the easiest way.
Nibu thomas
Software Developer
|
|
|
|
|
bool screen::addCube(cube* newCube)
screens[i].addCube(&cubeSet[i]);
Is there anything wrong with the way i have all the function.
I the screen obj has builds a linked list of displayable obj, well just my cubes really.
But later when draw gets called the some of the values of the cube from cubeSet are incorrect or null and the program halts.
The program starts with declarations,
cube cubeSet[4];
screen screens[4];
please help,
thanks
|
|
|
|
|
Try this:
screens[i].addCube(cubeSet[i]);
Ankita
|
|
|
|
|
that gives Error error C2664: 'screen::addCube' : cannot convert parameter 1 from 'cube' to 'cube *'
|
|
|
|
|
Sorry, I didn't see that you had static Array declaration for the cubeSet.
so you are saying some of the values being dispalyed are incorrect, but not all? could you post some more detailed code?
Ankita
|
|
|
|
|
You have not initialized the cubes properly.
Nibu thomas
Software Developer
|
|
|
|
|
how should i initialize cubeSet?
My loop goes like this.
cubeSet[i] = cube(); //cube::cube() is the constuctor
.
.
change side colors
.
.
screens[i].addCube(&cubeSet[i]);//ad cube to screen one cube to each screen
Then later in draw func
for(int i = 0;i<4;i++){
screens[i].draw();
}
Screen obj holds the cube in a node
and eventually calls drawNode->cubeItem->draw();
then when in the draw function during debuging i see that some of the cubes info is off
even though back in the setup function the info looked good.
thanks for the help
joe
|
|
|
|
|
how can make a cursor invisible in a certain application?
|
|
|
|
|
|
Kleser wrote: how can make a cursor invisible in a certain application?
ShowCursor( );
nave
|
|
|
|
|
Hi
Could I please get some help measuring the width of a character.
I am writing a simple app that draws text to the form and is it is possible to set the font differently for each char. It is within .NET 2003 and I am currently doing this to get the width of a character (each string is one character):
textSize = g->MeasureString(tempString, font);
This works but I have to optimise the code as much as possible and I have been informed by my C++ lecturer to 'hand write' another way to measure the width of a string/char.
Could someone please explain how this could be done by means of an example? Initial research has led me to GetCharWidth32 and GetTextExtent, but I'm buggered if I know how they work! For instance, GetCharWidth32 has 'hdc' (a handle to DC) -- That's all that MSDN tells you and I have absolutely no idea what it is!!!
Could someone please supply an example where you know what the char or string (with 1 character) is and simply get a float or int that is the width?
Thanks
|
|
|
|
|
GetTextExtent works with a device context, you need ot create a font and select it into the device context first.
Elaine
The tigress is here
|
|
|
|
|
Thanks for the reply(ies) everybody.
So it looks as though I am on the right tracks!
I would really like to be shown a little mor of how GetTextExtent works.
I have already created a font, like this:
<br />
System::Drawing::Font* font;<br />
String* fontType = S"Arial";<br />
font = new System::Drawing::Font(fontType, fontSize, FontStyle::Bold);<br />
Could somebody please explain how to 'first select the font into a device context'?
Thank you
|
|
|
|
|
GetCharABCWidths and GetCharWidth32 might be your friends
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|