構造体の動的配列を返すC#でDLLに配置されたメソッドを使用しようとしています。何をしても、よく知られている「オブジェクト参照がオブジェクトのインスタンスに設定されていません」というエラーが表示されます。これが私の最後のコードですが、それでもそのエラーが表示されます。
string v_user = "kish";
string v_pass = "u";
string v_number = "p";
string v_address = "url has been replaced with this string";
string v_cid = "abc";
Cls_SMS.SMSReceive.STC_SMSReceive[] xts;
Cls_SMS.SMSReceive px = new Cls_SMS.SMSReceive();
// *** is the below line
xts = px.ExtendReceiveSMS(v_user, v_pass, v_number, v_address, v_cid);
int upper_bound = xts.GetUpperBound(0);
for (int counter = 0; counter < upper_bound; counter++)
{
Response.Write(xts[counter].Message.ToString());
Response.Write("<br>");
}
私の主な問題は、構造体タイプ名(Cls_SMS.SMSReceive.STC_SMSReceive)を持つ構造体の動的配列を受信することであり、リモートサーバーへの接続などの他の側面は私の問題ではないことに注意してください。ベンダー定義の構造体の動的配列を*行の代入演算子の左側に割り当てたいだけです。
私を助けてください。どうもありがとうございます。