Converts a string index into an pre-defined null-terminated ASCII string.
NOTE: These strings are a part of the tape, not the dll, so on older tapes you may have less indexes available than on newer tapes, but the resulting values will be the same.
NOTE: Defined strings are loaded after NxCORESTATUS_INITIALIZING status callback.
#define cszNxCoreGetDefinedString "sNxCoreGetDefinedString" typedef const char* (__stdcall *NxCoreGetDefinedString) (int ixTable, int ixString); const char* GetDefinedString( int ixTable, int ixString );
Parameters
ixTable
One of values as defined in reference_Tables.html
ixString
A zero-based number that indexes into one of the String Tables indexed by ixTable.
Here's an example of printing the first exchange as soon as we're sure that the string tables are loaded
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include "NxCoreAPI.h" #include "NxCoreAPI_Wrapper_C++.h" NxCoreClass NxCore; int __stdcall nxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreMessage* pNxCoreMessage) { if( pNxCoreMessage->MessageType == NxMSG_STATUS && pNxCoreSys->Status == NxCORESTATUS_RUNNING && pNxCoreSys->nxTime.MsOfDay != 0 ) { printf("%s\n", NxCore.GetDefinedString(NxST_EXCHANGE, 1)); return NxCALLBACKRETURN_STOP; } return NxCALLBACKRETURN_CONTINUE; } int main(int argc, char** argv) { if (!NxCore.LoadNxCore("NxCoreAPI64.dll") && !NxCore.LoadNxCore("NxCoreAPI.dll")) { printf("loading library failed\n"); return -1; } NxCore.ProcessTape(argv[1], 0, NxCF_EXCLUDE_CRC_CHECK, 0, nxCoreCallback); return 0; } |
import net.nanex.NxCoreClass; class GetDefinedStringSample extends NxCoreClass{ @Override public int OnNxCoreCallback(NxCoreSystem nxCoreSys, NxCoreMessage nxCoreMsg) { if( nxCoreMsg.MessageType == defines.NxMSG_STATUS && nxCoreSys.Status == defines.NxCORESTATUS_RUNNING && nxCoreSys.nxTime.MsOfDay != 0 ) { System.out.println(String.format("%s", GetDefinedString(defines.NxST_EXCHANGE, 1))); return defines.NxCALLBACKRETURN_STOP; } return defines.NxCALLBACKRETURN_CONTINUE; } public static void main(String args[]) { GetDefinedStringSample nxCore = new GetDefinedStringSample(); if (nxCore.LoadNxCore("NxCoreAPI64.dll") != 0){ nxCore.ProcessTape(args[0], 0, defines.NxCF_EXCLUDE_CRC_CHECK, 0); } else System.out.println("loading library failed"); } } |
import NxCore tapePath = "" def OnNxCoreCallback(NxCoreSys, NxCoreMsg): if NxCoreMsg.MessageType == NxCore.NxMSG_STATUS and NxCoreSys.Status == NxCore.NxCORESTATUS_RUNNING and NxCoreSys.nxTime.MsOfDay != 0: print("{}".format(NxCore.GetDefinedString(NxCore.NxST_EXCHANGE, 1))) return NxCore.NxCALLBACKRETURN_STOP return NxCore.NxCALLBACKRETURN_CONTINUE if NxCore.LoadNxCore("NxCoreAPI64.dll"): returnValue = NxCore.ProcessTape(tapePath, 0, NxCore.NxCF_EXCLUDE_CRC_CHECK, 0, OnNxCoreCallback) else: print("loading library failed") |