Path: news.mathworks.com!not-for-mail
From: "Thomas " <thomas.schmelzer.nospam@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: starting engopen
Date: Fri, 23 Nov 2007 16:46:44 +0000 (UTC)
Organization: Winton Capital Management
Lines: 37
Message-ID: <fi705k$gau$1@fred.mathworks.com>
Reply-To: "Thomas " <thomas.schmelzer.nospam@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1195836404 16734 172.30.248.37 (23 Nov 2007 16:46:44 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 23 Nov 2007 16:46:44 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1136476
Xref: news.mathworks.com comp.soft-sys.matlab:439059


Folks,
I need some inspiration. On my private machine (Windows XP, 
MS Visual C++ Express) the following code works fine:

#include <stdio.h>
#include "engine.h"
int main()
{
Engine *ep;
if (!(ep = engOpen("\0"))) {
	fprintf(stderr, "\nCan't start MATLAB engine\n");
	return EXIT_FAILURE;
}
engClose(ep);
return EXIT_SUCCESS;
}

On my machine at work MATLAB doesn't start. At both 
machines I have the same MATLAB version (7.5). At work I am 
using Windows, too. MATLAB is an environment variable and 
can start from any path. I have used "matlab \regserver".
Here's the path of MATLAB on my machine

C:\Program Files\MATLAB\R2007b\bin

and here's my exe file generated by Visual C++ (it 
compiles, so no problems with the embedding of the header 
or the linking)...

C:\Documents and Settings\t.mysurname\winEngine\release

Maybe there is some more explicit way to start MATLAB. Or 
shall I use a *.bat file?
It also doesn't seem to work if MATLAB is already open...
Any ideas?
Thomas