Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: HowTo start Rhapsody framework from external app?
Topic Summary:
Created On: 5-Mar-2008 17:45
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 5-Mar-2008 17:45
User is offline View Users Profile Print this message


Michael Lettner

Posts: 16
Joined: 7-Dec-2007

Hi everybody,

I want to start the Rhapsody execution framework (oxf) from an external application (from within VisualStudio 6). Basically the same question got answered in the knowledge base at KB-Article: Use DLL built by Rhapsody in external program:
If you wish to call a DLL built with Rhapsody from a program external to Rhapsody, then you will need to make sure that you initialize the Rhapsody framework in order to successfully start and run a statechart in the DLL.

To do this, first make sure that you have copied the framework dll (MSoxfdll.dll) from Rhapsody (Share\LangCpp\Lib) to your
EXE project directory. Then you will need to execute OXF::start(); One way to do this would be to just copy the contents of
main() from the Rhapsody generated main file to your current project main file.


However, the suggested solution does not work in my case, because I'm using RiC whereas the article refered to RiCpp. So there's no such dll named "MSoxfdll.dll" under $(OMROOT)\LangC\lib.

Can anyone tell me how to do this in RiC?
  • I tried using MSoxfanimdll.dll instead, but that didn't work; a call to RiCOXFStart(FALSE) is still not recognized:
    C:\...\MainSimulator.c(12) : warning C4013: 'RiCOXFStart' undefined; assumption: extern with return type int
    Linker-Vorgang läuft...
    MainSimulator.obj : error LNK2001: unresolved external Symbol RiCOXFStart


  • I also tried adding the static library named "MSoxf.lib" (exactly: "$(OMROOT)\LangC\lib\MSoxf.lib"; for oxf without animation) to the linker settings in my project, which gives me following weird linker error:

    LINK : fatal error LNK1104: file "C:\Programme\Telelogic\Rhapsody.obj" couldn't be opened


    My setup is:
  • RiC v7.1.1.3, Win XP (SP2)
  • the external project is a simple Win32 project, no MFC, built in VS6


    Any help is appreciated!

    Rgds,
    Michael
  • Report this to a Moderator Report this to a Moderator
     6-Mar-2008 08:40
    User is offline View Users Profile Print this message


    Simon Morrish

    Posts: 127
    Joined: 17-May-2005

    Hi Michael

    You're right: RiCpp comes with DLL support and RiC doesn't...

    I can't offer you a bullet-proof solution - I don't use RiC - but if I was going to build DLL support for RiC, I'd start by looking at that for RiCpp. The makefiles LangCpp\msoxfanimtracedll.mak and LangCpp\oxf\oxfFiles_dll.list build msoxfdll.dll. By studying what they do, you may be able to implement a similar makefile for RiC.

    Even so, there is a large amount of DLL-related #ifdef code in the Cpp framework, so you may find that your task is not as simple as just writing a makefile...

    Sorry I can't be more helpful!
    Simon

    -------------------------
    Simon Morrish
    simon.morrish@eu.panasonic.com
    http://panasonic.co.uk
    Panasonic ideas for life
    Report this to a Moderator Report this to a Moderator
     6-Mar-2008 12:16
    User is offline View Users Profile Print this message


    Bernhard Gassner

    Posts: 15
    Joined: 27-Jun-2007

    Not sure if the solution I describe is exactly what you are looking for.

    I am using Rhapsody in C with IDF and usually Cygwin gcc and just sometimes VS.net
    I am using the generated code from Rhapsody and link it together with a realtime OS. In the OS I start the Rhapsody framework manually, after the system is done with startup.

    What has to be done to get it working:
    In the OS-file where I call RiCOXFStart() I need an include to the header file where this function is declared (should be RiCOxf.h in your case).
    Furthermore you need the startup code for the framework from the "Main<ComponentName>.c" file (just a few lines and includes)

    At the Compiler-settings you have to add an include path to the location of the header files of the framework.

    At the Linker-settings you add the framework library (in your case I think MSoxf.lib, or MSoxfinst.lib for animation).


    -Bernhard
    Report this to a Moderator Report this to a Moderator
     6-Mar-2008 22:56
    User is offline View Users Profile Print this message


    Michael Lettner

    Posts: 16
    Joined: 7-Dec-2007

    Thanks Simon, thanks Bernhard!

    Problem solved - basically I've a similar usage as in Bernhard's project. Yesterday I've already tried the same procedure as in your description. However, after your encouraging post I gave it another try and found out that my usage of environment-variables in the linker settings led to the weird linker error quoted above. Now that I changed it to absolute paths everything works fine!

    Thx,
    Michael
    Report this to a Moderator Report this to a Moderator
     11-Mar-2008 11:41
    User is offline View Users Profile Print this message


    Michael Lettner

    Posts: 16
    Joined: 7-Dec-2007

    Hi again,

    for the sake of completeness, I'd like to share my little "HowTo integrate Rhapsody into VS"-guide. See the attached text file. Maybe anybody finds it helpful some day.

    Best Regards,
    Michael


    Report this to a Moderator Report this to a Moderator
    Statistics
    20925 users are registered to the Telelogic Rhapsody forum.
    There are currently 1 users logged in.
    You have posted 0 messages to this forum. 0 overall.

    FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.