|
Isn't there a way to view the number of running threads in one application? I forget where.
|
|
|
|
|
Yes. Use the Thread32First() /Thread32Next() pair.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Could someone please point me in the right direction to Canonicalise (c14n) an XML document in C++.
Thank you so much.
|
|
|
|
|
Hi,
How can i determine, if an specific project is using unicode character set or multibyte character set is there any macro.
Warm Regards,
Mushq
|
|
|
|
|
Mushq wrote: How can i determine, if an specific project is using unicode character set or multibyte character set is there any macro.
if UNICODE, _UNICODE is defined then it's unicode project.
|
|
|
|
|
Just to clarify, are you asking how to see if the application is going to be built as a UNICODE, ANSI/SBSC, or MBCS application? If so, then checking for the _UNICODE , or _MBCS preprocessor defs is the way to go.
However, an application that is built as an ANSI/SBCS app is more than capable of managing UNICODE data and using UNICODE APIs, and vice-versa, so I want to make sure exactly what you mean by "using".
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi all,
i want to know exactly why there will not be any Virtual Constructors but There exist a Virtual Destructor.
Please let me know the exact reason behind this.
Uday kiran
|
|
|
|
|
please search the board and some FAQs, this question has been asked bilions of times
|
|
|
|
|
Does the v-table exist at the time the class' constructor is invoked? I think a virtual constructor would actually be pretty pointless since it is used for derived classes. See here for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David, You have give a more valuable information.
thank you very much.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: You have give a more valuable information.
He didn't give "information" to you he gave you a "pointer" to it. Typical C++ nub... not understanding pointers.
led mike
|
|
|
|
|
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
I think you misunderstood what he wrote.
it should have been something like :
You have given me a most valuable information.
or something like that.
|
|
|
|
|
When an object is created you are specifying the exact object type.
It is constructed from the inside out so there is no need for a v-constructor.
Once an object exists it can be pointed to by a pointer to a parent class type.
Yet, the object needs to be destroyed from the outside in.
Without a v-destructor destruction would start with the type of the pointer not of the actual object.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
In Other words, When the First Step of construction takes place, we are constructing the Root Class, which has the V-Table of the Root Class.(No Idea yet of Your Classes' V-Table) If the language allowed you to declare a Virtual constructor, it would be in the V-Table of your final class, and only be available AFTER your class was constructed. Now that would be realy like mustard after the meal. Ofcourse someone could write a compiler which takes account of these things. The language it compiles would no longer be cpp though.
The long and short of it is therefore, If you need a Virtual Constructor, you are organising your code wrong. Look at your code and try again.
regards
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: The long and short of it is therefore, If you need a Virtual Constructor, you are organising your code wrong. Look at your code and try again.
Even if you need one, C++ is not going to let you have one. That would be a compile time error blunder.
The greater the difficulty, the greater the glory.
- Marcus Tullius Cicero
|
|
|
|
|
Hi all
In my project i am displaying a 3d model ( created by the marching cube
algoritham) composed of triangles. This model is constructed from the 2d images slices.
Now i need to select some polygons from that model. For example user drag
drop and created a bounding box , and i want to get those polygons inside that bounding box.It should be fast enough (At least don't take minutes ).
I think Opengl Picking may not work. because i can't name each polygon a unique name , because i have millions of polygons. So if i do that it may leads to statk overflow of name stack(glPushName).
Any idea will be Greatly appreciated.
Thanks in advance
krishnan
If u can Dream... U can do it
|
|
|
|
|
krishnadevank wrote: and i want to get those polygons inside that bounding box.It should be fast enough (At least don't take minutes ).
Several ways jump out. First You have the zone, you can render one more frame with a clip-buffer which isolates the polygons individually within the zones. You can identify which ones by coloring each differently, or split the work out, by doing so in each 2D image slice.
Remember that even at 20-60hz you can take a frame to do some work and then get back to the job of drawing. Multi-rendering methods make great shortcuts. You can also use the obscure test from the ARB and setup an obscuring object everywhere except the zone of interest, and get back only those triangles within the zone. You can also do the same test as you draw, using a multi-render cycle you can check the result of the projection and write to see if it should be clipped or kept with a stencil buffer and test the triangles you need.
Once again you can brute force it, or break it down, test slice by slice to see if any triangles are in the zone on cycle 0, then test those triangles in each slice one at a time for zone proximity, cycle 1+. Within a couple of frame cycles you can find all the triangles you need.
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
Hi
I am trying to pass by reference a variable. Below is the code.
In the class def I have
<br />
void OnLoseFocusDate( Date &jdtDate);<br />
and in the src file I have
<br />
<br />
void CEQSLowerInterestLeg::OnLoseFocusDate( Date &jdtDate)<br />
{<br />
<br />
if( jdtDate != Util::grdtNull) <br />
{<br />
Date adjust_date( jdtDate );<br />
const CCalendar *calendar = CHolidayMgr::GetInstance().GetEquityLegPaymentHoliday();<br />
if (calendar)<br />
{<br />
adjust_date = calendar->BusinessDayIf(adjust_date, (EnBusDayConvention)m_jcmBDC.GetSelectedObjectID(), &ToolUtils::PromptForBusinessDay);<br />
<br />
jdtDate = adjust_date;<br />
<br />
}<br />
}<br />
}
<br />
with the function call being
<br />
<br />
OnLoseFocusDate(m_jdtTerminationDate.GetValue());<br />
<br />
where GetValue()
is defined as
<br />
<br />
Date NewDate::GetValue(void)<br />
{<br />
if (::IsWindow(this->m_hWnd) && GetFocus() == this )<br />
{<br />
if( m_dateFormat == shortFormat )<br />
{<br />
SetError(!IsValid());<br />
}<br />
}<br />
<br />
return m_value;<br />
<br />
<br />
}<br />
<br />
and m_value is defined as Date m_value;
The error I am getting is
<br />
<br />
error C2220: warning treated as error - no object file generated<br />
C:\viewstr\ptp6970-DateChange\Swaps\ptp\src\eqslowerinterestleg.cpp(2039) : warning C4239: nonstandard extension used : 'argument' : conversion from 'class Date' to 'class Date &'<br />
A reference that is not to 'const' cannot be bound to a non-lvalue<br />
I dont understand why I get this error and I dont believe the solution is to pass in by const reference since I modify the argument in the function. Can someone please explain why I get this error and a solution?
I have found that if I do
<br />
Date xx = m_jdtTerminationDate.GetValue();<br />
OnLoseFocusDate(xx);<br />
<br />
then it is ok but I dont understand the difference between the 2 methods.
Many thanks !
|
|
|
|
|
The problem is that when you return something from a function (for example your GetValue function), a copy of your object will be made (you don't return the object itself but a copy). So in your case, passing it by reference would mean that the function (OnLoseFocusDate) will probably want to modify it. But in your case it is totally useless because the object is lost after the function is called (so, the modifications are lost).
One way to do it is to return a reference to your object in the GetValue function:
Date& NewDate::GetValue(void)<br />
{<br />
if (::IsWindow(this->m_hWnd) && GetFocus() == this )<br />
{<br />
if( m_dateFormat == shortFormat )<br />
{<br />
SetError(!IsValid());<br />
}<br />
}<br />
<br />
return m_value;<br />
<br />
<br />
}<br />
But honnestly, I don't really find this very elegant...
|
|
|
|
|
minkowski wrote: Date xx = m_jdtTerminationDate.GetValue();
OnLoseFocusDate(xx);
A Reference is in effect, a Compiler Generated and Guaranteed Pointer. Unlike Ordinary Poiners, they cannot be NULL, and in most cases, when you try to do something daft, the compiler will object. This happened in this case! A Reference implicitly points to a value in memory. The result of a Function is essentially not a value in memory, so the compiler objects, It is WRONG!
Your Second attempt works, because the reference is an implicit pointer to xx
LateNightsInNewry
|
|
|
|
|
hi,
I want to change the CLSID for an existng class .That is,i want to use the features of a class by giving different name and different CLSID to it.In which application .rgs file is generated.
Thanks in advance
Siddharth
|
|
|
|
|
siddharthsan wrote: I want to change the CLSID for an existng class .
This is bad idea. Why you want to do this ?
siddharthsan wrote: That is,i want to use the features of a class by giving different name and different CLSID to it
What is your problem then ?
|
|
|
|
|
Hello, tell as it is possible to catch occurrence of windows in the another's program, and then to block their occurrence. If it is possible an example. Thank.
-- Am be back --
|
|
|
|
|
Not sure what you want as your post is not very clear but it sounds like you may want to setup a WH_CBT hook.
Look up SetWindowsHookEx() in MSDN, payiny attention to the WH_CBT hook ID and the CBTProc hook procedure. Also see this article[^] on using global hooks.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|