|
eusto wrote: What am i doing wrong? m_nCount gets read corectly but m_list is always filled whith 0's
This should work. Are you sure you are not writing an array of 0s?
m_list is declared as a "long *"?
void CMyObj::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << m_nCount;
for(int i = 0; i < m_nCount; i++)
ar << m_list[i];
}
else
{
ar >> m_nCount;
m_list = new long[m_nCount];
for(int i = 0; i < m_nCount; i++)
{
ar >> m_list[i];
}
}
}
|
|
|
|
|
HOW CAN I DISPLAY THAT NETWORK IS AVAILABLE OR NOT IN MFC ON CLICKING A BUTTON
pradeep
|
|
|
|
|
Do u mean Network means Internet connectivity?
Come online at:-
jubinc@skype
|
|
|
|
|
Please use
MultinetGetConnectionPerformance();
|
|
|
|
|
1) please read this[^]
2) then have a look here[^]
|
|
|
|
|
wrote: MultinetGetConnectionPerformance
don't shout.. what type of network connection are you looking for???
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Why *pBDLd = *pA3Ld; is not going into the function:
void CSpanLoad::operator=( const CCASObject &src )
{
//....
}
In VC6 it was going..In VC8 it s not going?
Thanx
|
|
|
|
|
I'm not sure exactly, but VC8 is a world away from VC6, in terms of standards compliance. I'd guess you've found a place where VC6 is non compliant. What if you put brackets around the dereferencing operators ? How about if you make the right hand value const ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Not working..
When i give *pBDLd = *pA3Ld it is showing error at compile time as:
error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'"
see declaration of 'CObject::operator ='
see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
|
|
|
|
|
You still haven't implemented an assignment operator for your CObject-derived class.
The CPtrArray class' assignment operator REQUIRES you to have good copy semantics on the class
you store in it.
|
|
|
|
|
How is CSpanLoad defined?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
class __declspec ( dllexport ) CCASObject : public CObject
{
public:
virtual void operator=( const CCASObject& ){}
};
class CSpanLoad : public CCASObject
{
public:
void operator=( const CCASObject& );
};
//spanload.cpp
void CSpanLoad::operator=( const CCASObject &src )
{
//....
}
|
|
|
|
|
who creat data base connectivity .NET.plz send me all information on that email "chandni1190@hotmail.com"
naveed
|
|
|
|
|
naveedakram86 wrote: who creat data base connectivity
Is this supposed to be a coherent question?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i need to write small aplication that return the angle of two clock poiners.
the function get the minute and hour and return the angle.
|
|
|
|
|
SOHCAHTOA
In other words, sin theta = the opposite over the hypotenuse, cos theta = the adjacent over the hypotenuse, and tan theta = the opposite over the adjacent.
In other words, use trig.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: SOHCAHTOA
Heh! I've never seen that one before!
|
|
|
|
|
*grin* I learned that in high school maths, and never forgot it. I've used a lot of trig in my programming over the years.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
No need for trig. First we'll just consider the hour hand. On a clock 12 hours is 360 degrees. So the angle of the hour hand (Ah) is given by the following formula (h is the hours):
Ah = 360.0*h/12.0
This formula assumes that Ah can be fractional so 1:30 would be represented as 1.5.
Now we’ll work in the minute hand (m is minutes). On a clock 60 minutes is 360 degrees, So the angle of the minute hand (Am) is given by the following formula:
Am = 360.0*m/60.0
Now we’ll put this together. First assume that we feed in the hours as an integer since the fraction part can be calculated from the minutes. In this case we should adjust h as follows:
h = h+m/60.0
After this we just use the above two formulas. I’ll leave the rest to you. There are some gotchas.
Steve
|
|
|
|
|
A small addition to the Formulae....
1. Calculate Hour Angle : Ah = (hrs*60+ Min)/2. (half degree /minute advancement).
2. Calculate Minute Angle : Am = 6*Min.
3. Angle between Hr an Min : Ah - Am.
4. Absolute position of Hr hand (90 -Ah) Degrees (Cartesian Co ordinate system with 12 at top, Clock direction - Clock Wise )
5. Absolute position of Min hand (90 -Am) Degrees (Cartesian Co ordinate system with 12 at top, Clock direction - Clock Wise )
|
|
|
|
|
Hello all,
I am trying to log the system date and time in the log file in my win 32 application.
I have used below code.
outf.open("C:\\Log.txt",ios::app); <br />
SYSTEMTIME st;<br />
::SendMessage(hwnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&st);<br />
LPTSTR lpDateTime = new TCHAR[21];<br />
_stprintf(lpDateTime, _T("%02u/%02u/%04u %2u:%2u:%2u"),<br />
st.wMonth, st.wDay, st.wYear,st.wHour, st.wMinute, st.wSecond);<br />
outf << "Current selected time: " << lpDateTime;<br />
delete []lpDateTime;<br />
outf.close();
and I am getting out put as :-
Current selected time: 52428/52428/52428 52428:52428:52428
Can anyone help me with this why I am not getting the proper time and date ???
And also this code has no compiler errors I am getting run time error for this line
delete []lpDateTime;
debug error :-
Microsoft Visual C++ Debug Library
Debug Error !
Damage : after normal block (# 45) at 0X0071DAO
Why I am getting the debug error ???? delete []lpDateTime; is correct way right ??
Thanking you,
Suresh HC.
|
|
|
|
|
Suresh H wrote: ::SendMessage(hwnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&st);
this message is used to get time or date from a datetime control. Not from other windows. You should use GetLocalTime to get the current time.
Suresh H wrote: new TCHAR[21];
this buffer is too small. try a value of 50
nave
|
|
|
|
|
Thanks Naveen for the response and the Information its very useful.
|
|
|
|
|
Naveen R wrote:
this buffer is too small.
How so?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
sorry i dont understand your question. What I mean is a buffer of 21 will not be enough for a statement like
_stprintf(lpDateTime, _T("%02u/%02u/%04u %2u:%2u:%2u"),
st.wMonth, st.wDay, st.wYear,st.wHour, st.wMinute, st.wSecond);
So i said him to increase the buffer. I found you too suggested the same to him. Then why a question like this?
nave
|
|
|
|