moleary
Computer
- Mar 23, 2005
- 38
I'm attempting to get extract some data about cosmetic threads. A piece of my code is below. The last line in the if block is crashing and I was hoping someone could point out why. It can't be because spThreadFeature is not valid because it is used in two previous statements. Thanks for any help!
------------------------
if (strFeatureType.CompareNoCase(_T ("CosmeticThread")) == 0)
{
//access cosmetic thread
CComPtr<IUnknown> spUnknownFeature;
hr = spSubFeature->IGetDefinition(&spUnknownFeature);
CComPtr<ICosmeticThreadFeatureData> spThreadFeature;
spUnknownFeature->QueryInterface(&spThreadFeature);
//Get the type of the cosmetic thread diameter
long lDiameterType = 0;
hr = spThreadFeature->get_DiameterType(&lDiameterType);
double dDiameter = 0.0;
hr = spThreadFeature->get_Diameter(&dDiameter);
//traverse the circular edge to which this cosmetic thread is attached
CComPtr<IEdge> spEdge;
hr = spThreadFeature->get_Edge(&spEdge);
}
------------------------
if (strFeatureType.CompareNoCase(_T ("CosmeticThread")) == 0)
{
//access cosmetic thread
CComPtr<IUnknown> spUnknownFeature;
hr = spSubFeature->IGetDefinition(&spUnknownFeature);
CComPtr<ICosmeticThreadFeatureData> spThreadFeature;
spUnknownFeature->QueryInterface(&spThreadFeature);
//Get the type of the cosmetic thread diameter
long lDiameterType = 0;
hr = spThreadFeature->get_DiameterType(&lDiameterType);
double dDiameter = 0.0;
hr = spThreadFeature->get_Diameter(&dDiameter);
//traverse the circular edge to which this cosmetic thread is attached
CComPtr<IEdge> spEdge;
hr = spThreadFeature->get_Edge(&spEdge);
}