|
You should have asked in the first 30 minutes
Even though nobody answered, you would have solved it
and you could have taken 4 days off!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
_Russell_ wrote: Why are you telling this to me only now?
To rub it in (salt in the wound), of course
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please any one can tell me what is lfOrientation in LOGFONT structure. i can't find any visible difference by changing any values of it. output is mostly same. my code is as bellow,
for (int i=0; i<3600; i+=150) {
LOGFONT lf;
::ZeroMemory (&lf, sizeof (lf));
lf.lfHeight = 2400;
lf.lfWeight = FW_DEMIBOLD;
lf.lfEscapement = i;
lf.lfOrientation = 600; // No change of any value
::lstrcpy (lf.lfFaceName, _T ("Times New Roman"));
CFont font;
font.CreatePointFontIndirect (&lf);
CFont* pOldFont = dc.SelectObject (&font);
dc.TextOut (0, 0, CString (_T (" This is my Output")));
dc.SelectObject (pOldFont);
}
|
|
|
|
|
as far as i know, orientation refers to angle wrt. x axis.
not sure weather degrees or radians.
try it out by gradually incrementing the the values from 0 to 360 in a loop.
|
|
|
|
|
i tried it but it won't work and Angle is given by lfEscapement member of LOGFONT structure.
|
|
|
|
|
both refer to angle only but with some difference.
you can refer the following url
for more information.
http://msdn2.microsoft.com/en-us/library/2ek64h34(VS.80).aspx
|
|
|
|
|
Thnks, But still change of lfOrientation not making any difference...
|
|
|
|
|
Bhavesh Bagadiya wrote: Please any one can tell me what is lfOrientation in LOGFONT structure.
Straight from MSDN:
It specifies the angle, in tenths of degrees, between each character's base line and the x-axis of the device.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I just did a small test, and lfOrientation does barely anything.
lfOrientation changes the angle of the whole string.
lfEscapement
Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text.
Windows NT/2000/XP: When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string independently of the orientation angle of the string's characters.
When the graphics mode is set to GM_COMPATIBLE, lfEscapement specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.
Windows 95/98/Me: The lfEscapement member specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value
So, set both values to the same thing, Unless you want some very wacky effects under GM_ADVANCED.
I just had a play in my OnDraw method...
::SetGraphicsMode (*pDC, GM_ADVANCED);
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof (NONCLIENTMETRICS);
CString s;
s = "Hello";
ncm.lfStatusFont.lfOrientation = 450.0;
ncm.lfStatusFont.lfEscapement = -450.0;
pDC->TextOut (0,0, s);
and see the results!
One rotates the string, the other rotates individual characters.
If in doubt, do little test programs - it's the only way to learn.
Iain.
ncm.lfStatusFont.lfOrientation = 450.0;
ncm.lfStatusFont.lfEscapement = -450.0;
|
|
|
|
|
Thanks I'm really new to Visual C++ MFC Programming. so again Thanks for suggestion !!!!
|
|
|
|
|
How specify the order of files during compiling (using VS2003)?
Russell
|
|
|
|
|
I guess that the files are sorted via the alphabet. So you have to rename them. But it is no good idea.
If you have problems, this "isnt the solution it only cures the symptoms", a typical method in german politics.
I consider to emigrate.
Greetings from Germany
|
|
|
|
|
Why would you want such a thing ?
|
|
|
|
|
Only to put at the end files too long to be compiled (of course... I have a very big project), in this way I will compile for first the files that I'm probally editing and, if there is bugs, I'll get errors more soon.
Russell
|
|
|
|
|
this is probably because you rebuild all every time, no ?
why don't you just recompile only the units you just modified ?
|
|
|
|
|
|
_Russell_ wrote: But as you know, developing you compile many times per hour the same project and shorcuts are very fine.
i don't really get what you mean here...
|
|
|
|
|
|
i want to create a tool bar which should contain both text and bitmap. it should be done in dialog based application
like toolbars in any window(Ex. Back with left arrow, forward with right arrow, save with floppy symbol)
can anyone help me.plz.
thanks in advance
regards
sudhakar
|
|
|
|
|
You can find a lot of samples here in CP.
One sample here[^]
- NS -
|
|
|
|
|
Hi,
I'm using VC++ 6.0 and ODBC connection to SQL Server.
I need to handle the situation when network is disabled and enabled.
I'm applying a retry logic which will check for db connection and try to reconnect for specified number of times within specified time interval.
When the network is disabled during a db function like open/requery etc.,and enabled within specified time interval, it works fine.
When the network is disabled and enabled before a db call, it fails.
Retry logic is as below:
while(!CheckConnection())
{
Reconnect();
nRetries++;
Sleep(nTimeInterval);
}
if(nRetries < SpecifiedNum)
return TRUE;
else
return FALSE;
}
CheckConnection()
{
.........
SQLRETURN nReturnVal = ::SQLGetConnectAttr(m_hdbc,
SQL_ATTR_CONNECTION_DEAD,
(SQLPOINTER) &nConnectionStatus,
sizeof(SQLINTEGER),
NULL);
...........
}
Reconnet()
{
OpenEx(m_strConnectionString, dwFlags)
}
nReturnVal returns success. So it doesn't again open the DB. So it is failing.
If i check validation and reconnect in overdriven function of CRecordset::Open() it will be applied everytime, even if network was not disabled.
How do I check whether network connection has disabled and enabled before calling a db function?
Thanks & Regards,
Sanju
|
|
|
|
|
If you close the DB connection after each DB function youre out of it. So an Open should work.
Arent there thrown any exceptions? Handle them carefully.
Or write a simple SQL statement in a function to test alive-Status.
Greetings from Germany
|
|
|
|
|
Hi,
Thank you for the reply.
Actually I'm not closing the DB connection in between forcefully. Only when the application exits, i'm closing it.
When the network connection is disabled, the db connection goes of.
So when i open a recordset, i'm getting unhandled exception. It is not even going to the catch block.
So before opening the recordset, i checked for connection, using SQLGetConnectAttr(). When the network is disabled and enabled before caling CRecordset::Open(), SQLConnectAttr() returns SQL_SUCCESS. Since, when the network connection got disabled, i'll be out of DB and I'll have to open it again no?
I need to handle this situation.
Thanks & Regards,
Sanju.
|
|
|
|
|
Checking the DB connection should be enough.
If you loose the connection all of your handles are invalid, so you need new and VALID handles. For this you got to reopen!!!
Greetings from Germany
|
|
|
|