06-13-2008 08:00 AM
int
error_query(System.IntPtr Instrument_Handle, out int Error_Code, System.Text.StringBuilder Error_Message);
Code snippet:
int
r = IVIDMM_Fetch(10000, out rValue); //This stmt throws an error because initiate() is not called before Fetch()int
errCode = 0; string errMsg = ""; StringBuilder sb = new StringBuilder(errMsg);IVIDMM_error_query(
ref errCode, ref errMsg); //This stmt does not get the error message/code of the previous error
What should be passed to the error_query() stmt to get the latest error message?
Thanks,
Priya.
06-16-2008 01:00 PM
06-17-2008 12:02 AM
Hi,
Thanks for the reply! Actually i do have the handle and have called the init before this method call. Basically i am calling the .Net wrappers created by Measurement studio. This is the method i am calling:
public
int error_query(out int Error_Code, System.Text.StringBuilder Error_Message){
int pInvokeResult = PInvoke.error_query(this._handle, out Error_Code, Error_Message); PInvoke.TestForError(this._handle, pInvokeResult); return pInvokeResult;}
The this._handle is already set. So i do have the handle but not able to get the error code and error message of the recent error 😞
StringBuilder
sb = new StringBuilder(errorMessage);int status = DmmClassDriver.error_query(
out errorCode, sb); //calls the method given above...
Thanks,
Priya.