How to return parameters from DLL ?
-
Hi All, I have developed an HTTPS request DLL. I want to return the headers and message body to the calling application. The prototype of my DLL function is int. How can I pass the returned headers and message body ? Please help me. Thanks for your prompt reply. Nikhs Nikhil Trivedi
-
Hi All, I have developed an HTTPS request DLL. I want to return the headers and message body to the calling application. The prototype of my DLL function is int. How can I pass the returned headers and message body ? Please help me. Thanks for your prompt reply. Nikhs Nikhil Trivedi
Usually it's not a big problem, just return char pointers. :)
Nikhil Trivedi wrote:
The prototype of my DLL function is int
What do you mean? Cannot you change the function prototype, can you? :confused:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
-
Usually it's not a big problem, just return char pointers. :)
Nikhil Trivedi wrote:
The prototype of my DLL function is int
What do you mean? Cannot you change the function prototype, can you? :confused:
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
Is there any other way except changing the function prototype ? Thanks for your reply. Nikhs Nikhil Trivedi
-
Is there any other way except changing the function prototype ? Thanks for your reply. Nikhs Nikhil Trivedi
Oh yes, a bit contrived yet. If you function returns a 32-bit integer then you can interpeter it as a pointer (at least on 32-bit systems...). That stated, you may arrange the two buffer pointers in a struct and return the struct address to the caller. However, IMHO it's better to change the function prototype. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.