mclInitializeApplication fails

26 visualizaciones (últimos 30 días)
Kenny
Kenny el 24 de Jun. de 2011
Editada: Alan Frankel el 18 de Jul. de 2023
Hi, I have compiled a DLL that needs to start MCR with the function mclInitializeApplication
all other codes I have written (which didn't use this yet) compiled and ran fine within metatrader (I am linking metatrader 5, a trading platform, with matlab)
the code that creates the error code is this:
bool __stdcall IsStartSMA(void)
{
if(bIsNeoStart == false)
{
if(!mclInitializeApplication(NULL,0) )
{
MessageBoxA(NULL, (LPSTR)"Can't start MATLAB MCR!",
(LPSTR) "MATLAB DLL: ERROR!", MB_OK|MB_ICONSTOP);
return false;
}else
{
bIsNeoStart = NeoSMAInitialize();
};
};
return bIsNeoStart;
}
It's pretty standard and every other thing I tried up till now worked perfectly but this is the first thing I attempted with mclInitializeApplication
  2 comentarios
Kaustubha Govind
Kaustubha Govind el 25 de Jun. de 2011
Use mclGetLastErrorMessage to examine the error message - this will gice us more information about what could be causing the failure.
Kenny
Kenny el 25 de Jun. de 2011
I did try that, but whenever I call that function I get an access violation writing to 0x000.....00

Iniciar sesión para comentar.

Respuestas (4)

Walter Roberson
Walter Roberson el 25 de Jun. de 2011
I searched and found other people reporting the same problem. One of them said they solved the problem but didn't say how. The others did not arrive at a solution. Steve Lord of Mathworks recommended contacting Mathworks Technical Support on this issue.

Stijn Helsen
Stijn Helsen el 5 de Jul. de 2011
I don't know if it has anything to do with it, but when I look to Mathworks demo code (matrixdriver), thy call "mclmcrInitialize();" (in the main routine) before calling the mclInitializeApplication routine. When I remove the first, I also get a similar problem. I don't see this documented. I'm trying the same from within DLL-code, but there it doesn't work.

Stijn Helsen
Stijn Helsen el 5 de Jul. de 2011
I'm convinced that what I've just write, I did yesterday, but trying it again (removing the call to mclmcrInitialize) doesn't make it working wrong....

Alan Frankel
Alan Frankel el 18 de Jul. de 2023
Editada: Alan Frankel el 18 de Jul. de 2023
There aren't enough details here to determine what could have caused the problem, which is now 12 years in the past. However, customers should not need to call mclmcrInitialize before calling mclInitializeApplication, and the documentation for mclmcrInitialize now states this. Calls to mclmcrInitialize have been removed from demo/example code.
It's also worth noting that mclGetLastErrorMessage is generally helpful only after mclInitializeApplication succeeds. It's used to report problems with functions that are called later, such as library initialization functions (as opposed to application initialization).

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by