T O P I C R E V I E W |
benner2 |
Posted - 12/19/2007 : 03:11:50 AM Origin Version (Select Help-->About Origin): 7.5G SR6 Operating System: Win XP Professional
Hi there,
I've written a program to calculate some data. After the calculation is finished, I want the program to open Origin. Origin should then display the data in a 2D diagram. The user shouldn't need to do anything except pushing a button to start the export. Is this possible at all? If it is, could anyone tell me how to do it? A useful link, a tutorial or something the like should do, I hope.
Sorry for my English, it's not the best =)
Regards benner |
11 L A T E S T R E P L I E S (Newest First) |
ML |
Posted - 01/15/2008 : 9:25:37 PM Hi benner2,
Please, see email.
Thanks.
ML
|
benner2 |
Posted - 01/15/2008 : 06:00:05 AM Correct. The example did not work when I compiled its code by myself, but the compiled binary worked. So I used the debugger on the COriginClient constructor.
After its initialisation, of course, hr is 0, or S_OK, which seems to be the same. The problem occurs in line 30:
hr = m_pOApp.CreateInstance( __uuidof(Application) );
After executing this command, hr has the value S_NOINTERFACE.
The command is defined in comip.h, after executing
hr = pIUnknown->QueryInterface(GetIID(), reinterpret_cast<void**>(&m_pInterface));
In line 630, hr changes its value to S_NOINTERFACE.
I tried both the compiled binary and the source code I had compiled by myself on another computer. Like my own, it's a computer installed by the IT of my company, so I was not surprised I couldn't find the registry entries on this computer, too. So I added them and then tried the programm. Just the same as on my own: the compiled binary worked in both cases, whereas the code I had compiled by myself did not.
|
ML |
Posted - 01/14/2008 : 8:40:05 PM Hi benner2,
I am assuming that you meant that the VC example SendNumericDataToWks did not work when you compiled it (you should use MSVC6 to load and compile the .dsw workspace file), whereas the compiled binary worked.
I guess you'll have to debug it. What matters is the class COriginClient (which you can use in your own projects as well). To see if the connection to Origin is established at all, put a breakpoint in the constructor COriginClient::COriginClient(int nOption), and run the case ALWAYS_CREATE_NEW. What is the value of hr? It must be 0. If not, then something strange is going on, since the compiled example does exactly the same thing.
By the way, have you tried it on another computer by any chance? The mere fact that the class did not get properly registered suggests that something strange is going on with your computer.
Edited by - ML on 01/14/2008 8:43:47 PM |
benner2 |
Posted - 01/14/2008 : 08:27:19 AM Thanks for your mail ML. I added the registry entries as you told me. So finally I could find them in the registry. Then I tried the automation example again. The compiled binary given in the automation folder worked properly (both "using existing instance" and "create new instance" succeeded).
Then I tried my own program, and again, it didn't work. To make sure I had not made a mistake with my code, I compiled the source code given in the automation folder...and it turned out not to work as well.
Do you still have any idea to help me or is this case a hopeless one? |
ML |
Posted - 01/14/2008 : 05:10:22 AM Hi benner2,
For some reason the registry entries necessary to create a new instance using automation are not present in your registry. We'll soon email you a file with instructions how to use it in order to try to restore the needed registry entries.
ML
|
benner2 |
Posted - 01/14/2008 : 03:59:45 AM Is there no one who has an idea? This is very important to me =( |
benner2 |
Posted - 01/10/2008 : 04:18:44 AM @ML I did as you told me. No matches were found. I read your text again and again to make sure I made no mistake and I am pretty sure I did not...so what to do now? |
ML |
Posted - 01/10/2008 : 02:07:29 AM Hi Benner2,
In order to try to diagnose the problem, please, do the following:
1. Start:Run:regedit.exe to start Registry editor.
2. Select the root node ("My Computer").
3. Do Edit:Find... . In the ensuing dialog check "Keys", "Values", "Data". Uncheck "Match whole string only". In the "Find what:" box paste this:
b0f21977-8aab-4632-a73d-528b909c5663
and hit "Find Next". Once something is found, right-click on the Key where the above string was found to bring up the context menu and execute "Copy Key Name". Then paste it into a message in this thread. Hit F3 to search for the next occurence and repeat the process to paste the key name.
After all the occurences are found and collected in a message, please, post the message here.
Thanks.
ML
|
benner2 |
Posted - 01/09/2008 : 07:37:41 AM So here I am again, having found some new problems =) As I mentioned in my post above, I found a very useful example in Origin75G\Samples\AutomationServer\VC\SendNumericDataToWks.
I also found a binary in this folder. This program offers 2 opportunities: either connecting to an existing instance of Origin or creating a new one. And there's the problem. Creating a new instance of Origin doesn't work. Connecting to an existing instance does work (if there is an instance open, of course).
Is there anything special I have to take care of using this binary? Any ideas about the cause of this problem?
One more thing: Of course I tried to insert some parts of the program into my own source code. This doesn't work either, with both "create new instance" and "use existing instance"...
Source code of the button handler:
void CV2View::OnBnClickedButtonorigin() { //m_nConnOption = ALWAYS_CREATE_NEW; m_nConnOption = USE_EXIST_FIRST; m_pClient = new COriginClient(m_nConnOption);
if(!IS_VALID_ORIGIN_PTR(m_pClient)) { MessageBox( "Es konnte keine Verbindung zu einer\nOrigin-Instanz hergestellt werden.", "Fehler", MB_OK);
if( m_pClient != NULL ) { delete m_pClient; m_pClient = NULL; }
return; } }
The compiler doesn't tell me anything about errors, so I think it should be alright. Still everytime I push the button I get this messageBox telling me that IS_VALID_ORIGIN_PTR(m_pClient) is false. I suppose the cause of this is the same as with the binary given in the samples folder...
So if anyone has an idea, I would be glad about it.
Regards, benner
Edit: I just noticed that the source code is not formatted properly. Didn't find a way to change it. Sorry about that...
Edited by - benner2 on 01/09/2008 07:44:41 AM
Edited by - benner2 on 01/09/2008 07:46:04 AM |
benner2 |
Posted - 12/21/2007 : 01:28:13 AM Hi Easwar,
thanks alot for your help. My program is VC, so I found a very useful example in the \Samples\Automation Server folder. I'll be on a holiday for two weeks or so, but just in case I have any further questions, I'll visit again.
benner
Edited by - benner2 on 12/21/2007 01:29:08 AM |
easwar |
Posted - 12/20/2007 : 11:21:43 AM Hi Brenner,
Origin 7.5 (both standard version and pro) can function as an automation (COM) server where other client applications can launch Origin and send data and commands to Origin programmatically.
Your program that calculates data - is that VC/VB?
You may want to look at examples in the product under the folder \Samples\Automation Server. You will find multiple subfolders with examples of client apps such as Excel, VB, VC etc.
Note that you can create an Origin project (OPJ) with required graphs using some test data, and then save the OPJ (after optionally clearing all data) as a "template". Then your client application can launch Origin, ask Origin to open that OPJ template, and push new data in and the graph can be updated by setting options in the graph and/or sending commands to Origin.
In the lastest version, version 8, we have expanded this template concept to what we refer to as "Analysis Templates". The idea here is that one can walk thru some test data and even perform analysis and generate nice reports, and then save all of that (either save the multi-sheet workbook or save OPJ with multiple windows). Then when new data is put into the source sheet (either manually or programmatically such as via COM), all analysis reports and graphs can automatically be updated. The demo version of Origin 8 is available in our download area.
Easwar OriginLab
|
|
|