isKindOf()

isKindOf()

Anonymous
Not applicable
414 Views
4 Replies
Message 1 of 5

isKindOf()

Anonymous
Not applicable
I have a class that is derived from a combination of AcDbPolyline and a base
class that i've made. Up until today it seemed like everything was working
great. I have an extremely extensive application here, and I'm getting
really frustrated right now because functions that were working yesterday
seem to be returning information that is not correct. Before, i was using
the following code to determine if an object selected is one of my custom
entities:

MyPolyline *pLine = NULL;
pLine = MyPolyline::cast(pObj);
if(pLine)
acutPrintf("\nThis is one of my polylines.");

Foolproof, right? Well, now AutoCAD has decided that every polyline i click
on is actually one of mine. No idea why. I have restored backups of my
app, and it works just fine. How could this possibly be happening? The
same basic problem results results from this:

if(pObj->isKindOf(MyPolyline::desc()))
acutPrintf("\nThis is one of my polylines.");

It's lying to me again. Even stranger is that when i use the
AcRxObject::comparedTo( ) function, it returns a "Not Orderable" value.

So it thinks it is already one of mine, and when it returns and tries to
access members of my class, it obviously dies immediately, because it is in
fact NOT one of my entities. What do i do, short of backtracking a few days
and starting over? I'm totally lost as to how this could be happening.
0 Likes
415 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Ok, it gets crazier. I found out (sort of) what was causing it. It has
something to do with the OPM. If i don't register my properties, AutoCAD
still knows what's what. When i do register my properties, though, it
suddenly loses the ability to figure out what i'm clicking on. I guess this
just basically means my OPM is corrupting the heck out of AutoCAD or
something. Funny that for the past month my OPM has worked absolutely
flawlessly... Since my OPM implementation is pretty intensive, i'm going to
assume that nobody can answer this question for me. If anyone has any ideas
as to how registering properties could cause this, let me know.

"Justavian" wrote in message
news:EE893D75BE488D9672138AF74824D6BD@in.WebX.maYIadrTaRb...
> I have a class that is derived from a combination of AcDbPolyline and a
base
> class that i've made. Up until today it seemed like everything was
working
> great. I have an extremely extensive application here, and I'm getting
> really frustrated right now because functions that were working yesterday
> seem to be returning information that is not correct. Before, i was using
> the following code to determine if an object selected is one of my custom
> entities:
>
> MyPolyline *pLine = NULL;
> pLine = MyPolyline::cast(pObj);
> if(pLine)
> acutPrintf("\nThis is one of my polylines.");
>
> Foolproof, right? Well, now AutoCAD has decided that every polyline i
click
> on is actually one of mine. No idea why. I have restored backups of my
> app, and it works just fine. How could this possibly be happening? The
> same basic problem results results from this:
>
> if(pObj->isKindOf(MyPolyline::desc()))
> acutPrintf("\nThis is one of my polylines.");
>
> It's lying to me again. Even stranger is that when i use the
> AcRxObject::comparedTo( ) function, it returns a "Not Orderable" value.
>
> So it thinks it is already one of mine, and when it returns and tries to
> access members of my class, it obviously dies immediately, because it is
in
> fact NOT one of my entities. What do i do, short of backtracking a few
days
> and starting over? I'm totally lost as to how this could be happening.
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Have you tried "rebuild all"?

Paul Kohut

"Justavian" wrote in message
news:EE893D75BE488D9672138AF74824D6BD@in.WebX.maYIadrTaRb...
> I have a class that is derived from a combination of AcDbPolyline and a
base

<>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Yep. Actually, i decided to just save all of my new OPM stuff, and i
brought back my old files, which seemed to work. My old files were based on
the example "SimpleDynProps" in the SDK. The code in that example is
completely different from what the wizard produces. Not sure at this time
how the differences cause AutoCAD to have a seizure, but i'm going to worry
about that after the remainder of my app is finished. Until then i just
need something that works.

"Paul Kohut" wrote in message
news:DD07702B3E874DF2FAEB6D9DD06625D9@in.WebX.maYIadrTaRb...
> Have you tried "rebuild all"?
>
> Paul Kohut
>
> "Justavian" wrote in message
> news:EE893D75BE488D9672138AF74824D6BD@in.WebX.maYIadrTaRb...
> > I have a class that is derived from a combination of AcDbPolyline and a
> base
>
> <>
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
Are you using the ATL_NO_VTABLE macro in your
derived classes? If so look at the explanation of the
macro in ATLDEF.H.

Paul Kohut

"Justavian" wrote in message
news:59C84D61450B15A69006E9729E2B0C31@in.WebX.maYIadrTaRb...
> Yep. Actually, i decided to just save all of my new OPM stuff, and i
> brought back my old files, which seemed to work. My old files were based
on
> the example "SimpleDynProps" in the SDK. The code in that example is
> completely different from what the wizard produces. Not sure at this time
> how the differences cause AutoCAD to have a seizure, but i'm going to
worry
> about that after the remainder of my app is finished. Until then i just
> need something that works.
>
> "Paul Kohut" wrote in message
> news:DD07702B3E874DF2FAEB6D9DD06625D9@in.WebX.maYIadrTaRb...
> > Have you tried "rebuild all"?
> >
> > Paul Kohut
> >
> > "Justavian" wrote in message
> > news:EE893D75BE488D9672138AF74824D6BD@in.WebX.maYIadrTaRb...
> > > I have a class that is derived from a combination of AcDbPolyline and
a
> > base
> >
> > <>
> >
> >
>
>
0 Likes