I've got a problem with simulation in CodeSys HMI.
I created an ActiveX component and in order to play a movie I made my own .dll library. It works fine in CodeSys simulation:
But when I start the program in CodeSys HMI simulation, it doesn't work. The movie isn't loaded:
Here is the code of dll library:
//dllmain.cpp:DefinestheentrypointfortheDLLapplication.
\#include "stdafx.h"
\#include <unknwn.h>
\#include <exdisp.h>//#include <wmp.h>
\#import "wmp.dll" no_namespace named_guidsBOOLAPIENTRYDllMain(HMODULEhModule,
            DWORD ul_reason_for_call,
            LPVOIDlpReserved
          ){
  switch(ul_reason_for_call)
  {
  caseDLL_PROCESS_ATTACH:
  caseDLL_THREAD_ATTACH:
  caseDLL_THREAD_DETACH:
  caseDLL_PROCESS_DETACH:
    break;
  }
  returnTRUE;}extern"C"__declspec(dllexport)voidExecuteActiveXCall(IUnknown*pUnk,char*pszId,char*pszParam){
  if(strcmp(pszId,"Wideo1")==0)
  {
    IUnknown*pNewUnk;
    IWMPCore*url;
    BSTRMyBstr=SysAllocString(L"put.wmv");
    pUnk->QueryInterface(IID_IWMPCore,(void**)&pNewUnk);
    url=(IWMPCore*)pNewUnk;
    if(url)
    {
      url->put_URL(MyBstr);
    }
  }
  elseif(strcmp(pszId,"Wideo2")==0)
  {
    IUnknown*pNewUnk;
    IWMPCore*url;
    BSTRMyBstr=SysAllocString(L"funnycats.mp4");
    pUnk->QueryInterface(IID_IWMPCore,(void**)&pNewUnk);
    url=(IWMPCore*)pNewUnk;
    if(url)
    {
      url->put_URL(MyBstr);
    }
  }}
Does anybody know how to solve this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Zitat:
How big are the movies? Is it possible to put them in the PLC's memory and have the PLC webserver provide them?
17MB~ and 4MB~. Yes, it's possible, but Windows CE 5.0 in my EATON XV102 controller doesn't support Windows Media Player so I can't even see a 'window' of WMP in a browser.
Zitat:
Or, is it possible that you are using relative paths and the active directory has changed? Can you try using absolute paths instead?
``` means that the movie is inside the directory of the project of course.
In CoDeSysHMI simulation when I'm clicking the button 'Wideo' it is showing "Multimedia processing.." for 0,5sec(and blinking) and then it is turning to "ready"("ready" means "gotowy" in the screenshot).
Any other solutions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
maasdamer88 hat geschrieben:
I've got a problem with simulation in CodeSys HMI.
I created an ActiveX component and in order to play a movie I made my own .dll library. It works fine in CodeSys simulation:
mov1.png
But when I start the program in CodeSys HMI simulation, it doesn't work. The movie isn't loaded:
mov2.png
Here is the code of dll library:
//dllmain.cpp:DefinestheentrypointfortheDLLapplication.
\#include "stdafx.h"
\#include <unknwn.h>
\#include <exdisp.h>//#include <wmp.h>
\#import "wmp.dll" no_namespace named_guidsBOOLAPIENTRYDllMain(HMODULEhModule,            DWORD ul_reason_for_call,            LPVOIDlpReserved          ){  switch(ul_reason_for_call)  {  caseDLL_PROCESS_ATTACH:  caseDLL_THREAD_ATTACH:  caseDLL_THREAD_DETACH:  caseDLL_PROCESS_DETACH:    break;  }  returnTRUE;}extern"C"__declspec(dllexport)voidExecuteActiveXCall(IUnknown*pUnk,char*pszId,char*pszParam){  if(strcmp(pszId,"Wideo1")==0)  {    IUnknown*pNewUnk;    IWMPCore*url;    BSTRMyBstr=SysAllocString(L"put.wmv");    pUnk->QueryInterface(IID_IWMPCore,(void**)&pNewUnk);    url=(IWMPCore*)pNewUnk;    if(url)    {      url->put_URL(MyBstr);    }  }  elseif(strcmp(pszId,"Wideo2")==0)  {    IUnknown*pNewUnk;    IWMPCore*url;    BSTRMyBstr=SysAllocString(L"funnycats.mp4");    pUnk->QueryInterface(IID_IWMPCore,(void**)&pNewUnk);    url=(IWMPCore*)pNewUnk;    if(url)    {      url->put_URL(MyBstr);    }  }}
Does anybody know how to solve this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got a problem with simulation in CodeSys HMI.
I created an ActiveX component and in order to play a movie I made my own .dll library. It works fine in CodeSys simulation:
But when I start the program in CodeSys HMI simulation, it doesn't work. The movie isn't loaded:
Here is the code of dll library:
Does anybody know how to solve this problem?
How big are the movies? Is it possible to put them in the PLC's memory and have the PLC webserver provide them?
Or, is it possible that you are using relative paths and the active directory has changed? Can you try using absolute paths instead?
17MB~ and 4MB~. Yes, it's possible, but Windows CE 5.0 in my EATON XV102 controller doesn't support Windows Media Player so I can't even see a 'window' of WMP in a browser.
Hmm, when I changed paths to absolute ones: ```
BSTR MyBstr = SysAllocString(L"C:\Users\Kamil\Desktop\project1\put.wmv");
``` there is no reaction in both simulations.
And
```
(L"put.wmv")
``` means that the movie is inside the directory of the project of course.
In CoDeSysHMI simulation when I'm clicking the button 'Wideo' it is showing "Multimedia processing.." for 0,5sec(and blinking) and then it is turning to "ready"("ready" means "gotowy" in the screenshot).
Any other solutions?
Does anybody know how to solve this problem?