Hi,
I'm using CreateProcess to start a c# application from a c++ MFC dll. The c# application is a report tool functionning with crystal report and the mfc dll monitor keypress. When a certain sequence of key is pressed a report is supposed to be printed.
Everything is working fine except when I try to execute the c# app. from the dll. When the c# application try to connect to the SQL database it alway receive this error:
System.Data.SqlClient.SqlException: Invalid connection.
at System.Data.SqlClient.SqlConnection.Open()
at (...)
When I execute my c# app. manually(not from the dll) everything is working fine. So I was wondering if I must use CreateProcessAsUser() instead of CreateProcess() to give the c# app. specific right, and if yes, how do I do this, I have some problem giving the correct access right the hToken argument of CreateProcessAsUser().
Any help would be appreciated Thanks!
Charles
I'm using CreateProcess to start a c# application from a c++ MFC dll. The c# application is a report tool functionning with crystal report and the mfc dll monitor keypress. When a certain sequence of key is pressed a report is supposed to be printed.
Everything is working fine except when I try to execute the c# app. from the dll. When the c# application try to connect to the SQL database it alway receive this error:
System.Data.SqlClient.SqlException: Invalid connection.
at System.Data.SqlClient.SqlConnection.Open()
at (...)
When I execute my c# app. manually(not from the dll) everything is working fine. So I was wondering if I must use CreateProcessAsUser() instead of CreateProcess() to give the c# app. specific right, and if yes, how do I do this, I have some problem giving the correct access right the hToken argument of CreateProcessAsUser().
Any help would be appreciated Thanks!
Charles