Einoss Posted December 3, 2020 Share Posted December 3, 2020 I have a C++ DLL with some functions and below is one of them: Quote int api_RequestFunction (BYTE *bIPAddress, BYTE *bPort, BYTE* inRBuff, int *inRLen, int txtype, BYTE* panNo, BYTE* purAmount, BYTE *stanNo, BYTE *dataTime, BYTE* expDate, BYTE* trxRrn, BYTE* aCode, BYTE* rCode, BYTE* tId, BYTE* sId, BYTE* mId, BYTE* adAmnt, BYTE* ecrrefno, BYTE* version, wchar_t* outresp, int* outRspLen) The first 5 paramters are the input: bIPAddress, bPort, inReqBuff, inReqLen, txtype ("192.168.1.1" , "5000" , "100;100;200!" , "12" , 0) The other paramters will contain the response. my question is how can I call this function and access the response paramters values? I have tries many ways and followed a nice DLL handling tutorial found here but no luck! I'am still not good and try to learn the DLL handling with autoit Thank you Link to comment Share on other sites More sharing options...
TheXman Posted December 3, 2020 Share Posted December 3, 2020 (edited) // Below is a reformatted version of what you originally posted, for readability. // No changes were made to the content. int api_RequestFunction ( BYTE *bIPAddress, BYTE *bPort, BYTE* inRBuff, int *inRLen, int txtype, BYTE* panNo, BYTE* purAmount, BYTE *stanNo, BYTE *dataTime, BYTE* expDate, BYTE* trxRrn, BYTE* aCode, BYTE* rCode, BYTE* tId, BYTE* sId, BYTE* mId, BYTE* adAmnt, BYTE* ecrrefno, BYTE* version, wchar_t* outresp, int* outRspLen ) In terms of trying to help you, I'm not sure where to start. Are you new to AutoIt, C/C++, or both? Since you didn't post any AutoIt code to show what you've tried, I have no idea how skilled you are in AutoIt or where to begin. Did you write the function that you posted? If so, why are almost all of the strings defined as BYTE* instead of wchar*? Why are some of the fields that appear to be numeric, defined as BYTE* instead of some numeric data type? Have you tested/debugged this function to confirm that it produces the expected results? If not, I suggest that you do that first. When you know it is working, then you can go about getting a DllCall() working in AutoIt. Since you are new to DLLs, I would also suggest starting with a small "test" exported DLL function that has only a few fields (of different data types) working before trying to work with a function that defines 20+ fields. That way you can more easily learn the intricacies of how to get & set different data type values using the DllCall() function in AutoIt. Edited December 4, 2020 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
JockoDundee Posted December 3, 2020 Share Posted December 3, 2020 57 minutes ago, TheXman said: Are you new to AutoIt, C/C++, or both? BYTE *bPort, BYTE* inRBuff, *see above TheDcoder and FrancescoDiMuro 2 Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now