I'm writing a python interface for the CommitCRM low-level API. Currently, I'm working on read/update functionality, and I've successfully loaded the functions exported from CmtDbEng.dll.
I can connect to a test DB with CmtInitDbEngDll(), and the return status is 1.
However, when I try to call CmtInsUpdRec() with the same data and buffers as in the (C++ example), I get the return status of 1014, which, based on the CommitCRM documentation on (error codes), would indicate a problem with the record ID buffer.
According to the Python documentation, the create_string_buffer() function I use is the correct way to create a mutable buffer to be passed to a native function.
I had considered that there was an incompatibility between the way that Python was creating the buffer, and what CmtInsUpdRec() was expecting, so I used Cython to create the buffer in the exact same way that the C++ sample did, and compiled the whole program to machine code. I received the same error.
I tried looking for the "CmtDBEng.h" header that was included by the C++ sample for clues on what argument types the function was expecting, but I could not find it.
For anyone who is interested, my Python code is here: https://gist.github.com/jakogut/b18b40160b6b5390231b
I can connect to a test DB with CmtInitDbEngDll(), and the return status is 1.
However, when I try to call CmtInsUpdRec() with the same data and buffers as in the (C++ example), I get the return status of 1014, which, based on the CommitCRM documentation on (error codes), would indicate a problem with the record ID buffer.
According to the Python documentation, the create_string_buffer() function I use is the correct way to create a mutable buffer to be passed to a native function.
I had considered that there was an incompatibility between the way that Python was creating the buffer, and what CmtInsUpdRec() was expecting, so I used Cython to create the buffer in the exact same way that the C++ sample did, and compiled the whole program to machine code. I received the same error.
I tried looking for the "CmtDBEng.h" header that was included by the C++ sample for clues on what argument types the function was expecting, but I could not find it.
For anyone who is interested, my Python code is here: https://gist.github.com/jakogut/b18b40160b6b5390231b
Comment