I am new to C#, Need help in the following situation
I have created an executable application (.exe) in C#. The application depends on certain C++ dlls. Hence I have used dllimport method - with the local path to execute the application. When I am executing the .exe as such (without C#) the application works if the dll are placed in the same level of .exe.
I want to place all the DLLs in an folder named DLL and place the folder next to .exe. Now the dllimport will not recognize the path. Now how do i write my code to pick the current path at run time for the .exe is executed independently.
I tried the below code it does not work. Basically it just throws compilation error. Since new to C#, though seen many online answers I am sorry not able to get a solution. Please help me with this
[DllImport(System.Windows.Forms.Application.StartupPath + "\\AP4600_SDK.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ReaderOpen")]