xenose wrote:I'm trying to create a DLL that the other program can get data and set settings to my program by dll in the same PC.
Does your app have to be running at the time in order for the DLL to do its work? Or can the DLL do its work even if your app is not running? It makes a big difference in how you implement the DLL.
xenose wrote:1.Using function pointers that DLL can call function in B.exe
That will not work, as A.exe and B.exe will have loaded their own separate copies of xxx.dll and thus cannot (safely) share pointers with each other.
xenose wrote:2.Using VCL SocketClient in DLL and B.exe to communicate.
That is one option, if the DLL requires your app to be running in order to do its work. In general, any IPC (inter-process communication) mechanism will work, as there are many options available besides sockets, including:
- window messages
- named pipes
- mailslots
- RPC (remote procedure call)
- ActiveX/COM
Just to name a few.