|
Thanks!
I hoped there was a way to avoid this polling thing, but it looks like there is no way around it. Makes my real-time requirement a little bit difficult, though ....
|
|
|
|
|
Can it help you ?
CAsyncSocket::IsAborted
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I don't know. I just searched through my MSDN Library and could not find any documentation. Where did you find it?
I assume this call is supposed to handle a machine being shut down (leaving the network).
What about a new machine connecting to the network?
Thank U in advance!
|
|
|
|
|
I am trying to control how the scientific notation
in VC++ display when I call it. It seems that iostream
have a default behaviour how it should look like. I can't
seems to be able to control it. For example,
the scientific notation of the exponent have to be
3 digits long. There could only be 1.23E+003, where
I wanted it to display 12.3E+002 , I can't seems to
do that. Is there a library available that allows
this to be implemented easily, or I have to
write my own stream?I hope that is a easy way
to do it. Any suggest from anyone?
Just Danny
|
|
|
|
|
Have you tried using the iostream format flags?
Don't remember excatly but you could use the flags to format the output.
Eg. cout<<scientific<<25; etc.
where="" scientific="" is="" a="" format="" flag.
look="" up="" the="" iostream="" flags="" and="" stream="" manipulators="" in="" msdn="" i="" am="" sure="" there="" method="" to="" set="" precision="" as="" well.
=""
<i="">May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Thanks for the reply. I can set it using setprecision() and setw(), but I can't change it's behaviour. I mean I like my scientific notation to have 2 digits before the decimal points not the default( ie. 1.23E+010) , I was hoping to get 12.34E+009 . Hope u can understand what I mean.I am converting a code from FORTRAN which allows this to happen.
|
|
|
|
|
Do you have to use cout?? You could do what you want with printf()
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
can anyone help me getting the .fon file format
This is a Bitmap Font file
If anyone can tell me the format or links to it, i'll b thankful
surbinsho
|
|
|
|
|
The best place to look for file formats is
http://www.wotsit.org/[^]
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Just call Invalidate() when the mouse either leaves or enters your window.
_____________________
"They'd dearly make us pay
For laughing in their faces
And making it our way"
-Love My Way, Psychedelic Furs
|
|
|
|
|
Daniel Ferguson wrote:
when the mouse either leaves or enters your window
What do you mean by this statement? Where do you suggest I call
Invalidate()? I'm drawing those lines in the CView and if the user stay in the view, I think their mouse never leaves. I'm kind a new to this.
Newbies
|
|
|
|
|
keep the changed, message paint redraw old color.
|
|
|
|
|
You can save your line coordinate to a var. Then, handle your WM_MOUSEMOVE. If point in that rect, redraw with another color, Invalidate.
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
I have data thats got nulls and even though I replaced them with spaces Access still doesnt like it when I go to add these calues into the table.Says its a required property. How do we set this property in code?
Thanks,
ns
|
|
|
|
|
Use 'null' or 'NULL' instead of ' '
Todd Smith
|
|
|
|
|
Thing is - I created an access database with ADOX. By default it set all the fields as required. SOme of the values I want to insert are NULLS and it complains about that.
also, if the db is totallly blank why doesnt addnew work? It says its either eOF or BOF (its both) so it doesnt add any record. That seems like a limitation.
Thanks,
ns
'
Rs1.AddNew
For j = 0 To UBound(u)
For k = 0 To UBound(v)
' If Not Rs1.EOF Then
Rs1.Fields.Item(j + 2).Value = v(k)
Rs1.MoveNext
If Rs1.EOF Then
Exit For
'Rs1.MovePrevious
End If
' End If
Next
Next
Rs1.UpdateBatch
|
|
|
|
|
I just realized that by doing select* from tbl in an empty table returns a recordset with no records> So my question is how to poulate a blank db with values?
thanks,
ns
|
|
|
|
|
Here is my program.I compile it in Visual C++ .Net(VC7) and get a C2440:
<br />
#include "stdafx.h"<br />
<br />
<br />
<br />
using namespace std;<br />
<br />
<br />
class b<br />
{<br />
protected:<br />
int id;<br />
<br />
public:<br />
b( int i )<br />
:<br />
id(i)<br />
{<br />
cout << "ctor of id:" << id << " was called." << endl;<br />
}<br />
<br />
~b()<br />
{<br />
cout << "dtor of id:" << id << " was called." << endl;<br />
}<br />
<br />
b( const b & x)<br />
:<br />
id(x.id)<br />
{<br />
}<br />
<br />
const b operator=( const b & x )<br />
{<br />
id=x.id;<br />
return *this;<br />
}<br />
<br />
<br />
};<br />
<br />
typedef auto_ptr<b> pb;<br />
typedef vector<pb> vpb;<br />
<br />
<br />
int main( void )<br />
{<br />
pb t(new b(1));<br />
<br />
vpb v;<br />
<br />
v.push_back( t );
<br />
return 0;<br />
}
Is it a bug of VC7 or anything wrong in my codes?
You don't know what you've got till it's gone.
|
|
|
|
|
Only a shot in the dark (don't have my docs at hand):
I assume vector::push_back() takes a const reference to the object type (which is auto_ptr<b> in your case). An auto_ptr contains an ownership flag and if assigning auto_ptrs always the L-value takes ownership. For this the R-value (the auto_ptr you try to insert in your vector) has to be modified, because it's ownerhip flag has to be cleared. And this is not possible because it has been passed as a const reference.
The error message could be translated to:
error C2440: 'initializing' : cannot convert from 'const std::auto_ptr<_Ty>' to 'std::auto_ptr<_Ty>' with [ _Ty=b ]
which makes the problem a bit more obvious.
(BTW: Does anybody know why the the C++ standard comitee did not made the ownership flag of an auto_ptr mutable, so it could be modified even in const objects?)
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
You're dead right - it's because the auto_ptr copy constructor takes a non-const reference. The reason it's like that (i.e. not using mutable on the ownership flag) is that containers require that their content elements can be copied without altering the element being copied. For example (and I'm quoting Herb Sutter's Exceptional C++), sort algorithms (particularly those based on partitioning & sorting, I suspect) take copies of elements of containers. This would result in the element being deleted, but it's reference still being in the container.
auto_ptr is really best used as a scoped pointer container, i.e. without transfer of ownership. It does help make things easier then, especially with helping to ensure exception safety.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Thanks Stuart,
that surly makes sense and is, if one thinks a bit about it, rather obvious.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
You're right.
The error message confused me. I thought the compiler cannot translate 'pb' to 'std::auto_ptr<_Ty>' or doesn't support nested templates or anything like that.
It seems I should provide a const constructor for auto_ptr by myself.
Thanks.
--------------------------------
You don't know what you've got till it's gone.
|
|
|
|
|
Be careful later !
dlhson2001@yahoo.com
|
|
|
|
|
...
void _Insert_n(iterator _Where, size_type _Count, const _Ty& _Val)
{
_Ty _Tmp = _Val;
size_type _Capacity = capacity();
...
It seems that the compiler could not find the operator=, but a copy constructor and the operator= have been present in the header <memory>:
template<class _Ty>
class auto_ptr
{
public:
typedef _Ty element_type;
explicit auto_ptr(_Ty *_Ptr = 0) _THROW0()
: _Myptr(_Ptr)
{
}
auto_ptr(auto_ptr<_Ty>& _Right) _THROW0()
: _Myptr(_Right.release())
{
}
auto_ptr(auto_ptr_ref<_Ty> _Right) _THROW0()
: _Myptr(_Right._Ref.release())
{
}
...
auto_ptr<_Ty>& operator=(auto_ptr<_Ty>& _Right) _THROW0()
{
reset(_Right.release());
return (*this);
}
...
The compiler just ignored them.
-------------
You don't know what you've got till it's gone.
|
|
|
|
|
Did you read the posting of Stuart to this topic?
It is nearly impossible to use auto_ptr in STL containers (and any other kind of container), because you run into a bunch of problems
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|