How to mimic two classes generated by swig?

  • Thread starter Thread starter Stan Huang at Taiwan
  • Start date Start date
S

Stan Huang at Taiwan

Guest
My company developed some applications based on a vision company's SDK (say, Company 1). Now, we contacted with another vision company (say Company 2). I was requested to migrate my original applications from Company-1's SDK to Company-2's. I take a look on Company-1's SDK and found they are generated by SWIG. I got some trouble in moving it to my application to build. I got error in building. Below are snippets of the two classes, could you help me figure out why the VC# can't accpet 'global::System.IDisposable'?

Besides, I has some basic understanding of C#, but I can't fully understand the two classes. Could give me some material to help me understand them?


///==================

public class ExtractInfo : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;

internal ExtractInfo(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}

internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ExtractInfo obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}

~ExtractInfo() {
Dispose(false);
}

public void Dispose() {
Dispose(true);
global::System.GC.SuppressFinalize(this);
}

......

}

/// =============================

public class ExtractInfoArray : global::System.IDisposable, global::System.Collections.IEnumerable, global::System.Collections.Generic.IEnumerable<ExtractInfo>
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
protected bool swigCMemOwn;

internal ExtractInfoArray(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}

internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ExtractInfoArray obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}

~ExtractInfoArray() {
Dispose(false);
}

.......

public ExtractInfo this[int index] {
get {
return getitem(index);
}
set {
setitem(index, value);
}
}

......

}

Continue reading...
 
Back
Top