|
I've to develop a SNTP server. I know the SNTP packet structure, and the SNTP port.
Is the SNTP server a simple server socket that replies to clients with an updated SNTP packet or there is something
more ???
Thanks a lot.
|
|
|
|
|
|
Good morning everyone,
I am developing a small application at my work that reads data from a SQL Server database using CDatabase.
The problem that I am having is that it works fine on 9 out of 10 computers (some are Windows XP w/out SP2, another has SP2, another has W2K). There are three Windows 2000 machine that I have tested this out on, and one of them does not work. All of the machines are joined to the domain, and can physically see and ping the server that the DB is on. The one machine that is not working out of the whole bunch is getting an error message. The code is -1 and the error string is "SQL Server Not Found". I have tried fully qualifying the domain name in the connection string (ie, SSV001.mydomain.com) but that one machine cannot connect to it. (The machine can access other servers on the network, so I know the network connection is good). Here's what I am using to connect
strConnection.Format("Driver={SQL Server};Server=SSV001.mydomain.com;Database=TESTDB;Uid=blah;Pwd=blahblah;"
CDatabase myDB;
TRY
{
myDB.OpenEx(strConnection,CDatabase::noOdbcDialog);
}
CATCH (CDBException,e)
{
CString errMsg.
errMsg.Format("Error code: %i. Error string: %s",e->m_nRetCode,e->m_strError);
}
9 of the machines open it fine, one of the machines triggers the catch block and shows the SQL Server not found error message.
Any help to resolve this would be appreciated a whole lot.
|
|
|
|
|
What if you use the IP address instead of the host name (SSV001.mydomain.com)?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thanks so much for the quick response.
I just tried replacing the host name w/ the IP address. It still does not work on that one PC (It does work on the other ones though, so I know I have the IP Address correct).
One correction: The error message is actually "Specified SQL Server Not Found"
|
|
|
|
|
If you change noOdbcDialog to forceOdbcDialog , you should get an ODBC dialog. Is the information in it correct?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello to all.
I use functions FindText() and FindText2() for class CHtmlView to organize searching for text on current page. But I need to search on different pages (I have their URL's).
Had anybody faced with this problem before?
I'll be very appreciate for every post below.
Aleksey.
Sorry for my poor English
|
|
|
|
|
the type of Report for ListCtrl
LVCFMT_CENTER have been setted ,but the first colum shows like LVCFMT_LEFT
How can I make the text to the center of the head?
Thanks a lot!
E-mail:
wushlimail@163.com
|
|
|
|
|
How are you inserting that column?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Remember that the CListCtrl methods are zero based. So the first column starts at 0.
Maybe thats the problem.
I Dream of Absolute Zero
|
|
|
|
|
This is a well-known bug with the list control. The first column is always left-justified. Solution? Create an extra column as the first, and then delete it after you've added the second. Now the second is the first, actually uses the alignment you set for it, and everyone is happy.
(For reference: Microsoft's wonderfully-helpful writeup )
Shog9
I'm not the Jack of Diamonds... I'm not the six of spades.
I don't know what you thought; I'm not your astronaut...
|
|
|
|
|
I have a problem making a program, that takes one fraction and simplifies it....
for example the fraction (2/4) is simplified to (1/2)....
that´s my small problem..
my larger problem is then adding/substracting two fractions....
With previous thanks...
JohnnyIce
C++ Beginner
|
|
|
|
|
you need to define a "fraction" structure to hold the numerator and the denominator, and do basic operations as defined there link at mathworld[^]
and to reduce the fraction you need to find the greatest common divisor of the numerator and denominator.
( I will let you have a look at it ... since my connection to mathworld is really slow this morning)
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
thanks..
but i know the mathmatical definitions of fractions.....
my largest problem is to put it on C++ form...
So that i can simplify fractions.....
My weakest link in this chain, is the programming it self...
Having the program figuring out the smallest fraction of f.example (2/4).
with previous thanks..
JohnnyIce
C++ Beginner
|
|
|
|
|
To simplify, or reduce, 2/4, you must divide both the numerator and denominator by their greatest common divisor, which is 2. To simplify 12/16, you must divide both the numerator and denominator by their GCD, which is 4, yielding 3/4.
Here is a code snippet:
CString strFraction = "12/16";
int nSolidus = strFraction.Find('/');
int nNumerator = atoi(strFraction.Left(nSolidus));
int nDenominator = atoi(strFraction.Mid(nSolidus + 1));
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
well.....actually tis the programming part that comez to be easy.....
letz split that up ur problem into small functionalitiez.....
like said above u r to find the GCD.....
so from thiz u can conclude that there are three thingz u ought to do .....
1)
(a)write a function to find all the possible factorz of the numerator(place the factorz in an array say a[])
(b)write a function to find all the possible factorz of the denominator(place the factorz in an array say b[])
2)write a function which findz the greatest comman factor from the arrayz a & b
3)divide the numerator and denominator with this GCD......and voila....
u did it.....
Happy Programmin....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
or u could just
compare the two (the denominator and the numerator) .....find out which one is the greatest......and find all the factorz of the greatest number.....then divide these factorz with the other number(which happenz to be the smaller one).....the greatest factor for whch u get no reminder will be ur GCD.....
Happy Programmin.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
When I need to call my function
<br />
<br />
CreateSplitters(int nRows, int nCols, int m_actRow, int m_actCol, CCreateContext*<br />
pContext)<br />
<br />
I need to give parameter CCreateContext* pContext. How can I do it?
Thanks in advance, bilas.
|
|
|
|
|
Without knowing what CreateSplitters does with a CCreateContext struct!
CCreateContext context;
CreateSplitters(nRows, nCols, nActRow, nActCol, &context);
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Is there any difference between private: and private:\ in c++/vc++?
rajesh
|
|
|
|
|
Do you mean private:\ as in
<code>
class CClass
{
private:\
public:\
};
</code>
then the \ is used as a continuation character. Usually used to continue the current line, if it gets too long.
I Dream of Absolute Zero
|
|
|
|
|
Rajesh_K_Sharma wrote:
Is there any difference between private: and private:\ in c++/vc++?
'vc++' is a compiler to compile 'c++' codes.
suhredayan There is no spoon.
|
|
|
|
|
Hi,
how can i change the arrow cursor to hand cursor when the mouse is on the button?
i tried this:
HCURSOR m_hCursorHand;
m_hCursorHand = AfxGetApp()->LoadCursor(IDC_HandCursor);
m_ExitButton.SetCursor(m_hCursorHand);
and this:
m_TestButton.SetCursor(::LoadCursor(NULL,"IDC_CURSOR1"));
but its not working.
Thanks,
Eli
|
|
|
|
|
the prob is that when u set the cursor to an another type.....and when u move the Onmousemove getz called and the previous cursor getz put it.....u can sove this by overriding the OnSetCursor function
all mouse messages that are recieved call the in the end the OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) function.....make sure that in this function you specify the code that in this function(it is better).....
if(m_DragOn==FALSE)
{
hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
}
else
{
hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );
SetCursor( hIcon );
}
Like for example declare the variable say m_DragOn and keep setting/clearing this variable in places where u want the handcursor(assume handcursor is IDC_CURSOR2 and is set when m_DragOn is TRUE)
hope that helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
hi, anyone got any idea how to convert a bitmap to a jpeg without using an already made libary? (please explain it, because i dont know visual c++ very well)
Thanks
|
|
|
|