Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
M

MarcelDijk

@MarcelDijk
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating a COM
    M MarcelDijk

    Hi Vidya, I actually misunderstood your problem. So you are not programming the DLL, but you are thinking about making something in COM for MATLAB. Am I right in assuming that the DLL has already got a COM interface with which other programs can access its data? I assume this is the case because otherwise there would be no use in writing anything in COM if you do not want to change the DLL. How is this event/notification done? Also through COM? Lets assume the DLL exports COM(ActiveX) automation objects then MATLAB can directly connect to these COM server objects in your DLL. Open you registry “Start-Run-regedit” then goto ”My Computer \ HKEY_CLASSES_ROOT \ CLSID”. Select CLSID and search for your DLL or application name. As an example search for “Microsoft Office Excel Application”. If I do this, regedit finds the key “My Computer \ HKEY_CLASSES_ROOT \ CLSID \ {00024500-0000-0000-C000-000000000046}”. Now you can find the subkey “ProgID” with value “Excel.Application.11” or something similar. Now you can connect to this COM server object by using its ProgID in MATLAB. Type in the command window: e = actxserver('Excel.Application.11'); methodsview(e); e.Help(); If actxserver() succeeds you can use methodsview() to see the functions you can access. As an example we can ask the Excel COM object to display help information by calling e.Help(); I hope this is what you are looking for. Regards,    Marcel

    COM com tutorial question

  • Creating a COM
    M MarcelDijk

    Hi Vidyarani, I am currently working on a similar problem it seems. See the message “out-of-process DLL”. If you are trying to transfer data to MATLAB and if you are trying to let your DLL tell MATLAB what to do with the data, then you can/should use the MATLAB engine. I suppose you are writing the DLL not the application, right? There are MATLAB engine library files, which you can link with your DLL project. The MATLAB engine library basically sets up a COM connection with MATLAB with the advantage that you do not have to worry about COM. The MATLAB engine library lets you transfer data to and from MATLAB. Your DLL should transfer data by creating MATLAB data-types (matrixes) using mx-functions, also included in the MATLAB engine library files. To create event driven operation you can first transfer data to MATLAB, and then you can execute .m-functions by letting the MATLAB engine, within your DLL, tell MATLAB which .m-function to execute. In this way, the .m-functions act as a kind of callback-functions. I hope this is the kind of event driven operation you are after. If you also want MATLAB to call back to your DLL in an event driven manner, then you should be looking at COM as well. But to do this from within a DLL is not straightforward. Things to look at in MATLAB help: MATLAB \ External Interfaces/API \ Calling MATLAB from C and Fortran Programs MATLAB \ External Interfaces/API Reference \ C Engine Functions MATLAB \ External Interfaces/API Reference \ C MX-Functions Things to look at in MATLAB root: ..\ MATLAB \ extern “MATLAB engine library files” I hope this will get you going. If it doesn’t and you really want to create COM functions in your DLL and you want MATLAB to call these functions, then you are facing the same problem I have. In that case we can discuss further. Kind regards, Marcel Dijkstra

    COM com tutorial question

  • Out-of-Process DLL
    M MarcelDijk

    Hi Gizzo, DLL surrogate is the thing I was looking for. I looked at the COM Architecture section and found articles on MSDN. I think this will keep me busy for some time. Thanks, Marcel

    COM question com sysadmin help tutorial

  • Out-of-Process DLL
    M MarcelDijk

    Dear COM programmers, I hope somebody can give me some thoughts about a problem I have. I am a complete newbie at COM programming and desperately trying to write a DLL library for a simulation program I am using. The simulation program allows me to write a DLL library with user defined functions. Now my plan is to write a general DLL library, which calls MATLAB to do the actual work. I am already using the MATLAB engine to let my DLL(simulation program) call user defined functions in MATLAB. But, I also need MATLAB to call functions in my DLL, from within the user defined functions written in MATLAB. For this I wanted to setup an out-of-process server within my DLL library. I succeeded at writing an out-of-process server in a normal EXE application and I could let MATLAB call functions and transfer data to my EXE application. But my real question is how to write an out-of-process server in a DLL? Is it at all possible, because usually DLL’s are in-process-servers? Kind regards, Marcel Dijkstra

    COM question com sysadmin help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups