CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Apr 23, 2019 3:06 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Nov 30, 2012 3:28 pm 
Offline

Joined: Thu Nov 29, 2012 2:03 pm
Posts: 2
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:
Attachment:
mov1.png


But when I start the program in CodeSys HMI simulation, it doesn't work. The movie isn't loaded:
Attachment:
mov2.png


Here is the code of dll library:
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <unknwn.h>
#include <exdisp.h>
//#include <wmp.h>
#import "wmp.dll" no_namespace named_guids

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                )
{
   switch (ul_reason_for_call)
   {
   case DLL_PROCESS_ATTACH:
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
      break;
   }
   return TRUE;
}

extern "C" __declspec (dllexport) void ExecuteActiveXCall(IUnknown* pUnk, char* pszId, char* pszParam)
{
   if (strcmp(pszId, "Wideo1") == 0)
   {
      IUnknown* pNewUnk;
      IWMPCore* url;
      BSTR MyBstr = SysAllocString(L"put.wmv");

      pUnk->QueryInterface(IID_IWMPCore, (void**) &pNewUnk);

      url = (IWMPCore*) pNewUnk;
      if (url)
      {
         url->put_URL(MyBstr);
      }
   }
   else if (strcmp(pszId, "Wideo2") == 0)
   {
      IUnknown* pNewUnk;
      IWMPCore* url;
      BSTR MyBstr = 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?


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Fri Nov 30, 2012 7:13 pm 
Offline

Joined: Thu Nov 15, 2012 11:22 pm
Posts: 24
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?


Top
   
PostPosted: Sat Dec 01, 2012 1:33 am 
Offline

Joined: Thu Nov 29, 2012 2:03 pm
Posts: 2
Quote:
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.

Quote:
Or, is it possible that you are using relative paths and the active directory has changed? Can you try using absolute paths instead?

Hmm, when I changed paths to absolute ones:
Code:
BSTR MyBstr = SysAllocString(L"C:\Users\Kamil\Desktop\project1\put.wmv");
there is no reaction in both simulations.

And
Code:
(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?


Top
   
PostPosted: Wed Jan 23, 2019 1:17 pm 
Offline

Joined: Wed May 31, 2017 8:31 am
Posts: 1
maasdamer88 wrote:
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:
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <unknwn.h>
#include <exdisp.h>
//#include <wmp.h>
#import "wmp.dll" no_namespace named_guids

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                )
{
   switch (ul_reason_for_call)
   {
   case DLL_PROCESS_ATTACH:
   case DLL_THREAD_ATTACH:
   case DLL_THREAD_DETACH:
   case DLL_PROCESS_DETACH:
      break;
   }
   return TRUE;
}

extern "C" __declspec (dllexport) void ExecuteActiveXCall(IUnknown* pUnk, char* pszId, char* pszParam)
{
   if (strcmp(pszId, "Wideo1") == 0)
   {
      IUnknown* pNewUnk;
      IWMPCore* url;
      BSTR MyBstr = SysAllocString(L"put.wmv");

      pUnk->QueryInterface(IID_IWMPCore, (void**) &pNewUnk);

      url = (IWMPCore*) pNewUnk;
      if (url)
      {
         url->put_URL(MyBstr);
      }
   }
   else if (strcmp(pszId, "Wideo2") == 0)
   {
      IUnknown* pNewUnk;
      IWMPCore* url;
      BSTR MyBstr = 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?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited