Home > Net >  C # Arc Engine "will object reference not set to an instance of an object"
C # Arc Engine "will object reference not set to an instance of an object"

Time:09-21


The purpose of this code are elements for a point layer query, and the query the elements that a point buffer analysis,
In IFeatureLayer pFeatureLayer=chuanzhi. J; This line of code, chuanzhi. J is to query point layer, is a village in the project layer
Want to use textbox input buffer analysis element
I suspect the problem in the grammar of the WhereClause, request to master bosses give directions!!!!!!

CodePudding user response:

Clearly is on a conversion fails, the converting point pTop failure,
Pay attention to see whether the type of point and empty,

CodePudding user response:

reference 1/f, Amon Amon response:
is obviously on a conversion fails, the converting point pTop failure,
Pay attention to see whether the type of point and is empty,

Point is empty, then how to convert? Small white don't really understand it

CodePudding user response:

To continue upward pFeat, should also is empty, empty, of course, you cannot convert

CodePudding user response:

reference Amon Amon reply: 3/f
continue upward pFeat, should also is empty, empty, of course, you cannot convert


Is this part isn't WhereClause errors caused by?

CodePudding user response:

reference 4 floor wx_44778309 response:
Quote: reference Amon Amon reply: 3/f

To continue upward pFeat, should also is empty, empty, of course, you cannot convert


Is this part isn't WhereClause errors caused by?

It cannot directly, a little bit up, eventually lead to empty place is good to solve the,

CodePudding user response:

reference 5 floor Amon Amon reply:
Quote: refer to 4th floor wx_44778309 response:
Quote: refer to 3rd floor Amon Amon response:

To continue upward pFeat, should also is empty, empty, of course, you cannot convert


Is this part isn't WhereClause errors caused by?

It cannot directly, a little bit up, eventually lead to empty place is good to solve the,

But why don't pFeat is empty, the following is empty?

CodePudding user response:

PFeat is Com object, and cannot be implicitly converted to IPoint

CodePudding user response:

refer to 7th floor Amon Amon response:
pFeat is a Com object, cannot be implicitly converted to IPoint

Then how to convert? Hope you not impatient, I am the true card here for a long time,

CodePudding user response:

Open pFeat point, check the specific information, IPoint not just one point, according to the pFeat midpoint coordinates instantiate a point is good, my QQ, 2430975806

CodePudding user response:

This kind of problem, debugged,
Point as ITop... See what the ponit is value

CodePudding user response:

references to the tenth floor is nu month god reply:
this kind of problem, debugged,
Point as ITop... See what the ponit is value

Point is null, the above pFeat is a COM object

CodePudding user response:

11 references wx_44778309 response:
Quote: reference to the tenth floor is nu month god reply:
this kind of problem, debugged,
Point as ITop... See what the ponit is value

Point is null, the pFeat above is COM object

Then continue to debug, see above village name='textbox1. Text' if there is problem here

CodePudding user response:

refer to 12th floor is nu month god reply:
Quote: reference 11 floor wx_44778309 response:

Quote: reference to the tenth floor is nu month god reply:
this kind of problem, debugged,
Point as ITop... See what the ponit is value

Point is null, the pFeat above is COM object

Then continue to debug, see above village name='textbox1. Text' whether have problem here

I guess there is a problem here, but I don't know how to change this, please advice

CodePudding user response:

reference 13 floor wx_44778309 reply:
Quote: refer to the 12th floor is nu month god reply:
Quote: reference 11 floor wx_44778309 response:

Quote: reference to the tenth floor is nu month god reply:
this kind of problem, debugged,
Point as ITop... See what the ponit is value

Point is null, the pFeat above is COM object

Then continue to debug, see above village name='textbox1. Text' whether have problem here

I guess there is a problem here, but I don't know how to change here, seek advice

Look at the SQL statements, and see if I can through the console output,
Or sqlprofile view directly

CodePudding user response:

 
//buffer
IGeometry pGeometry=pFeat. Shape;
ITopologicalOperator regarding=pGeometry as ITopologicalOperator;
IGeometry pGeometry1=regarding Buffer (1000);

CodePudding user response:

Your pGeometry just are defined, but not instantiate, at least, is the new one, or use assignment has some examples
  •  Tags:  
  • C#
  • Related