Author |
Topic |
|
elquin
Republic of Korea
7 Posts |
Posted - 02/04/2015 : 7:25:06 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2015 (64bit) Operating System: Windows 7 64bit
My group use Origin as plotting tool of huge data analysis with main program A. The program A is written in Visual C#(maybe) and Origin is called through DLL, as shown in ..\OriginLabs\Origin2015\Samples\Origin C Examples\Programming Guide\Calling C DLL. However when we try to close Origin after being called from program A, the error message comes as;
Origin cannot be closed because it is being controlled by another application
And we cannot close Origin. How do we solve this..??
|
|
Sophy
China
Posts |
Posted - 02/04/2015 : 10:32:11 PM
|
hi, Elquin:
I guess you are using Origin as COM server to be called within your program A, then you were referring to a wrong example, "Calling C DLL" means write extension module as a dll file, and to be invoked in Origin C.
From your description, I suggest you refer to the example at "\Samples\COM Server and Client\CSharp\Realtime Send Data To Wks\Realtime Send Data To Wks", which use Origin as COM server in a C# application.(When you connect to Origin, and leave the "Realtime Send Data To Wks.exe" running, try to close Origin will see the warning message "Origin...being controlled by another application", yet if you close that "Realtime Send Data To Wks.exe", then you can close Origin without any problem, can check the C# code to see how it release control of Origin COM Server, System.Runtime.InteropServices.Marshal.FinalReleaseComObject(m_originApp);) |
Edited by - Sophy on 02/04/2015 10:34:10 PM |
|
|
elquin
Republic of Korea
7 Posts |
Posted - 02/08/2015 : 7:46:38 PM
|
Thank you for your help. Also, it would be more helpful if there's guide or manual related origin c or c# for origin. |
Edited by - elquin on 02/08/2015 7:47:02 PM |
|
|
|
Topic |
|
|
|