How to link a wrapper DLL to the target DLL

I appreciate your help!
Question:
In my project, I need to deal with a hybrid programming of C++ and Labview. The C++ part has been encoded into a DLL, which aims to do a complex mathematics. The main function in the DLL has the following form:
                          float RateEqCalculate(class CLaserPulse *Pulse, class CMaterial *Material, class CThresh *ThreshPara, class CRateResults &r);
The four arguments are all of the class type. The first three arguments are used to input parameters to the function and the last one is used to record the process of computation. For example: class CLaserPulse is composed by several numerics and two functions as the following form:
class CLaserPulse
public:
 float fDuration;  
 float fWave;  
 float fNA;   
 float fRefrIndex;                                     // Refractive Index
 float fAbsCoeff;                                     // Absorption coefficient [1/m]
 CLaserPulse();
 virtual ~CLaserPulse();
 virtual double Shape(double dTime);       // gives Temporal Shape
 float SpotDiameter();                            // Calculate Spotdiameter
As in labview "class" cannot be accepted as an argument of the "Library Function Node" directly, a wrapper DLL is required to translate the "class" to the type labview can understand. The following link is a good illustration of this process. http://labviewwiki.org/DLL/shared_library Given the argument class CLaserPulse has been converted into the wrapper DLL by the method from the link, how can I later link this wrapper DLL to the target DLL. My understanding is like this:
                                                                                             Target DLL
                                                                                float RateEqCalculate(
  class CLaserPulse  ->   wrapper DLL       .........linking.........        class CLaserPulse,
  class CMaterial      ->   wrapper DLL       .........linking.........        class CMaterial,
  class CThresh        ->   wrapper DLL       .........linking.........        class CThresh ,
  class CRateResults  ->   wrapper DLL     .........linking.........        class CRateResults );
Am I right? Four wrapper DLL to four class type arguments?
Many thanks!!!

Hello Rolf and Christian: 
Thank you for your suggestions! I'm now working on it. I appreciate your continuous help!! 
I'll briefly summarize my question here:
In the original DLL, which is compiled by VC++ 6.0 and named RateEquation.dll, three class types (CLaserPulse, CMaterial& CThresh) are inclueded to do parameter exchanges; one class type is designed to save the calculation results(CRateResults);one main function to do the calculation and save the results as following form:  
 float RateEqCalculate(class CLaserPulse*, class CMaterial*, class CThresh*, class CRateResults &r); 
My question now is the initialization of the struct type and the communication between this type with labview. 
I'll take class CMaterial as an example to show how I made it into wrapper DLL.Original class CMaterial is defined as following:
class CMaterial
public:
 float AbsorberGap;
 float BandGap;
 float CollTime;
 float ElDensity; float RefractiveIndex; 
 float AbsorptionCoeff;  
 float MoleculeMass;  
 float Density;  
 float HeatCapacity;  
 float HeatConductivity;  float TAmbient;  
 CMaterial();
 virtual ~CMaterial();
  In a wrapper dll it's like this: 
WrapperDll.h
 extern "C" { /*using a C compiler*/            //Using a C compiler to write the wrapper DLL
#endif 
struct RATEEQUATION_API CMaterial{                  
  //Electronical properties
  float AbsorberGap;
  float BandGap;
  float CollTime;
  float ElDensity;
  //Optical properties
  float RefractiveIndex;
  float AbsorptionCoeff;
  //Other properties
  float MoleculeMass;
  float Density;
  float HeatCapacity;
  float HeatConductivity;
  float TAmbient;
  typedef struct CMaterial CMaterial;                                             /* make the class opaque to the wrapper*/
 RATEEQUATION_API CMaterial* creat_CMaterial(void);           
RATEEQUATION_API void destroy_CMaterial(CMaterial* LV_ref);
#ifdef __cplusplus
#endif  
WrapperDll.cpp
RATEEQUATION_API CMaterial* creat_CMaterial(void)
       return new CMaterial();                              
RATEEQUATION_API void destroy_CMaterial(CMaterial* LV_ref)
       delete LV_ref;
 In function creat_CMaterial(), one can see the constructor of class CMaterial is called. As struct type CMaterial has the same memory layout as class type CMaterial, so it’s safe and possible to return a class CMaterial* to struct CMaterial* and it’s initialized by the default values in the class constructor. Now I’m confused by how one communicates between labview and struct CMaterial. For example, if I would like to change the parameter _CMaterial-> BandGap=6.5eV to 8eV. How to make it? My feeling is I need a cluster type from Labview as an input in the function creat_CMaterial:
                          CMaterial* creat_CMaterial(cluster_LV*)
Many thanks!
Message Edited by Kuo on 09-15-2009 09:56 AM
Message Edited by Kuo on 09-15-2009 09:59 AM

Similar Messages

  • TOC entries: is there a limit to how many links you can have to the same htm in TOC?

    TOC entries: is there a limit to how many links you can have to the same htm in TOC? I have an HTM that requires multiple links in the TOC. Now I can't compile a CHM. I have eliminated all other possible problems...

    Hmm, that would be a new one on me, but I see new things all the time and try to always keep an open mind.
    Okay, so one way past this might be to do the following.
    Create a snippet. Copy the content of the desired page and paste into the snippet.
    Create 30 different versions of the same topic by simply placing the Snippet into each topic. Then insert the different topics into the TOC.
    You should still be able to modify the content of the topic in the single place (the snippet) and by having discrete points from the TOC, there should be no issue and synchronization should work beautifully.
    Cheers... Rick

  • How to Link another JSP Page in the same portal component

    Hi Guys,
      I am a new guy to SAP, currently, I want to add href link to another JSP in the same component, so I used <a href="<%=webpath%>/jsp/AboutPage.jsp">, but obviously, the link can not display target page due to privilege restriction, does anyone know how to resolve this problem? thanks very much!
      Best Regards
      James

    Thanks srinivas,
       Sorry for late response, too busy yesterday.
       Currently, I want to create a URL link in the page which links another JSP page in the same portal component, but the problem is this JSP page is under PORTAL-INF folder, so due to privilege problem, I can not create the link like the following:
    <a href="jsp/test.jsp">Link</a>
       I konw if I move test.jsp out of folder PORTAL-INF, the above way should work, but then, I found the JSP page can not access componentRequest and get resource bundle object.
      Am I clear, please let me know, thanks!
    Regards.
    James

  • How to soft delete a row from the target table?

    Could someone help me on this requirement?
    How to implement the below logic using only ODI? I am able to implement the below logic with the "DELETE_FLAG" as "N".
    I want to make the latest record with the flag as "N" and all the previous other records with the flag as "D".
    Thanks a lot in advance.
    I have a source table "EMP".
    EMP
    EMPID FIRST_NAME
    1 A
    2 B
    First name is changed from A to C and then, C to D etc. For each data change, I would add a target row and mark the latest row as "N" and the rest as "D". The target table would contain the following data:
    Target_EMP
    EMPID FIRST_NAME DELETE_FLAG
    1 A D
    1 C D
    1 D N

    The problem is that I can't delete the row cause it demands from me to fill the mandatory field previously. It takes place when the key field is ROWID. In other cases delete is succesful.

  • How to instanciate/restore an object in the target JVM

    Hi,
    For the needs of a runtime project, I'd like to be able to interrupt the main method of my target VM as it starts (that, I can do), and call a static method that takes an object as parameter. At this point, obviously, the argument object is not defined, so I'd like to instanciate it from my runtime program (debugger). I don't know how to do that. I thought I could use the ClassType.newInstance() method, but the class I want to instanciate is not loaded yet, so I don't know how to get the right ClassType object.
    Actually what I'd like to do in the end is to be able to recreate an object (deserialize) to the target VM, so what I'm really looking for is a way of setting an entire object without having to invoke its constructor method. Does the redefineClass() method help here ? I'm not sure...
    Does someone knows a way of doing this ?
    Thanks

    Hi Tatayya,
    so I understand you right, that you want to launch a JSP from a different PAR file? You could do the following in this case.
    Create an additional JSP in the (first) PAR that simply does a redirect to the second iView (form the other PAR). In the contoller class of your first PAR, perform a this.setJspName("redirectMe.jsp").
    If you want to keep displaying the original JSP in the iView and simply display an additional popup, you could try:
    don't change the this.setJspName() (i.e. set it to the original page)
    Use a bean that stores a value like "showPopup yes/no"
    Query the bean in the JSP and render some javascript:window.open() code if "showPopup=true".
    Hope that helps,
    Dominik

  • How do I make Merge operation into the target table case insensitive?

    Hi All,
    We have a target table that has a varchar 2 column called nat_key and a map that copies over data from a source table into the target table.
    Based on wheteher the values in the nat_key column matches between the source and the target, an update or an insert has to be done into the target table.
    Let us say target table T has the following row
    nat_key
    EQUIPMENT
    Now, my source table has the same in a different case
    nat_key
    equipment
    I want these rows to be merged .
    In the OWB map, I have given the property of nat_key column in the target table as 'Match while updating' = 'Yes'. Is there a built in feature in OWB, using which I can make this match as case insensitive?
    Basically, I want to make OWB generate my mapping code as
    if UPPER(target. nat_key)=upper(source.nat_key) then update...else insert.
    Note: There is a workaround with 'Alter Session set nls_sort=binary_ci and nls_comp=linguistic', but this involves calling a pre-mapping operator to set these session parameters.
    Could anyone tell me if there is a simpler way?

    Hi,
    use an expression operator to get nat_key in upper case. Then use this value for the MERGE. Then nat_key will only be stored in upper case in your target table.
    If you have historic data in the target table you have to update nat_key to upper case. This has to be done only once and is not necessary if you start with an empty target table.
    Regards,
    Carsten.

  • How to link a css file in the xsl file

    Hi
               I would like to know how to include link to my .css file in my .xsl file.
    The scenario here is I want include a background color in my ShowForm.I am trying to do the same using css.
    This is the code snippet in my css file
    .outerbody {
         background-color: B1C1CF;
    This is how I tried to include a link in my xsl file
    <link href="/irj/go/km/docs/Testing/MyNewsDemo/css_test.css" type=text/css rel=stylesheet>

    Hi
              Thanks a lot. It would be very helpful if you send me an example.
    As of now I have found a solution,I would like to share it here.
    I added a link to my css file in xsl:
    <link rel="stylesheet" type="text/css" href="/irj/go/km/docs/Testing/MyNewsDemo/css_test.css">
    </link>
    I replaced the standard class name "body" with my class name "outerbody" specified in the css file.
    <body class="outerbody">
    Edited by: SRIVIDHYA RAGHUNATH on Feb 25, 2009 11:19 AM

  • Web link in Captivate 3 opens the target window and closes in 3 seconds

    Hi,
    I am encountering a strange problem with Captivate 3.
    I have linked an online document in a Captivate 3 slide, and have set to open in a new browser window. The link works absolutely fine when previewing in Captivate. In browser, the new window opens and then disappears automatically, without either opening the document or giving the open/save/cancel dialog box.
    Please help!
    Thanks,
    Saurabh

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • How to pass Current System time in the target field?

    Hi Experts
    kindly help me in mapping a field in which I have to map current system time.
    I think there is no standard function for time like the date so do i write a UDF for the same or any other way an in case a UDF than please help in that.
    Thanks
    Aprajita

    Hi Mathur,
    kindly help me in mapping a field in which I have to map current system time.
    I think there is no standard function for time like the date so do i write a UDF for the same or any other way an in case a UDF than please help in that.
    Mathur no need to write UDF for that..
    Use standard function Current date-------> In that (Target Format) u have to specify the time i.e: HHmmss
    Thats it..... Noe use this function as u like...
    Satya Kumar

  • How to link the menu to the function?

    When edit menu,I don't know how to link item of menu to the Labview Function,means the items of the menu have no use ,can't achieve any function. Please tell me the experts ,Thanks !

    I suggest looking at exsample code. In LabVIEW 6.1 you can go to help >> find examples >> building user interfaces >> menus and toolbars >> menu selection demo.vi. In LabVIEW 6i, goto help >> examples >> advanced >> customizing controls and VIs >> custom menubar examples >> menu selection(this is the VI).
    In the examples, the output of the VIs is usually sent to a case selector of a case structure. The code to be executed is in the appropriate case.
    Jeremy Braden
    National Instuments

  • Linking to an anchor within the same page

    Anyone know how to link to an anchor within the same page?
    For instance, im making a FAQ page. at the top of the page I would like to list all the questions. i would like the viewer to be able to click a question which brings them to the answer on the bottom of the page.
    looked in inspector couldn't find it. linking to anchors is pretty basic, so id be really suprised if iweb doesn't have this feature. so im assuming im missing it.......
    how do i do this?

    Anyone know how to link to an anchor within the same page?
    how do i do this?
    Linking to an anchor within the same page is no more than scrolling to it, and can be (easily) emulate with javascript window.scroll function.
    See my post here: http://discussions.apple.com/thread.jspa?messageID=7676908&#7676908
    All javascript is linked to the example page.

  • How to set the target property of hyperlink through formula

    Hi guyz,
    I have a problem in setting the target property of hyperlink field. I'm using CR XI R2 with asp.net.
    I want to set the target property of hyperlink as one of the frame on my webform. how can i do it through formula in crystal report.
    I want to set it through CR because i don't have any way to identify the link fields uniquely. these link fields are generated dynamically from data base. I have some other links on my webform. If i try to get all links through javascript and change the target property it may effect some other functionalities, so i'm avoiding using javascript to set the target property of hyperlinks.
    your help will be highly appreciated.
    Thanks in advance
    Deepak

    You may want to look at the HyperlinkTarget property of the CrystalReportViewer.  If you want all hyperlinks in the report to go to that frame, it should work for you.

  • Message Mapping on the  Target side

    Hi
    I am working on Proxy to SOAP in PI 7.1, and have node which is defined on the target side as Unbounded (table)
    Here is the structure of the table that has been defined on the target side,
    CodeList - 0- Unbounded (Table)
        Id                               XSD Id
        CodeList Name           String
        CodeList Version         String
        CodeListOwnerCd        String
    Source System(ECC) is not sending any values and the values which needs to be assigned to the above structure are fixed on the target side,
    how can I assign multiple values to the Code List table
    Ex CodelistName Should contain ClaimsPartyRoleCdList, PolicyTypeCdLis ,  PaymentTypeCdList
    Please let me know how can I assign Multiple values to the target side table
    Thanks
    PR

    Hey
    You can easily do this via advanced UDF.
    Map the root node to the below UDF.Make sure that you have set the Cache as Queue for this.There will be no input values to this UDF
    //write your code here
    result.addValue(" ");
    result.addValue(" ");
    Map the underlying Nodes to the below UDF.Make sure that you have set the Cache as Context for this.There will be no input values to this UDF
    //write your code here
    result.addValue("3");
    result.addContextChange();
    result.addValue("4");
    result.addContextChange();
    I was able to acheieve the below XML by using the above two
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MI_Multiple xmlns:ns0="http://fxp.com">
       <Record>
          <First>3</First>
          <Second>3</Second>
       </Record>
       <Record>
          <First>4</First>
          <Second>4</Second>
       </Record>
    </ns0:MI_Multiple>
    Hope this works for you.
    Thanks
    Aamir

  • Constant values to the target field

    Hi friends,
    how to assign three constant values to the target field in XI..?
    like :
    constant--->Trget field.
    There is one target field but 3 constant values have to be assigned....
    is it thr FixValue fuction..?
    Regards
    Sam

    Hi,
    Goto MM Editor
    Conversion --> FixValues
    Double Click
    Fill in the "Key" "Value" pair as per u r requirment
    Key          Value
    A                R1
    B                R2
    C                R3
    So from Source structure A comes it gets R1 in target
    hope this is helpful
    Srini

  • When starting Windows 7 Sync Notifier reports "The procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll." Any suggestions as to how to rectify this issue?

    When starting Windows 7 Sync Notifier reports "The procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll." Any suggestions as to how to rectify this issue?

    With Windows Explorer, navigate to your C:\Program Files\Common Files\Apple\Apple Application Support folder.
    Copy the SQLite3.dll that you should find there, navigate to the nearby Mobile Device Support folder, and Paste it in there also.
    Restart the programme all should be well
    In case that your OS is (64 bit)
    1. Open windows explorer, go to location C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    2. Copy file "SQLite3.dll"
    3. Now paste it in the folder  C:\Program Files (x86)\Common Files\Apple\Mobile Device Support
    4. Restart the programme, it should not display that message, it should be clear.
    Good Luck

Maybe you are looking for

  • How to only show just an email input when a user accesses ADFS for SSO

    Hello, I am trying to setup ADFS so that our external users just see an email address to login in with, and then it will redirect to the third party login page for that user.    Ideally, we'd like it to act like Office365/Dropbox/Salesforce where if

  • Reporting Services Generates HUGE nasty looking error

    "System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System

  • How can I shorten the "Open With" menu?

    Hi - When I Control-Click on a file, say  one with an HTML extension, and move down to "Open with" I see a list of about 24 apps - only 4 of which are of interest to me for opening this HTML file.  If I right-click an XML file - the apps I'm looking

  • Time Machine - "Can't Mount Device"

    Hi, recently my power went out and now my external HDD won't mount back to my Mac Mini! I have everything on here so any help would be great! My HDD was used as my "Time Machine" and did back ups every hour or so and now I tried restarting the comput

  • Does Database Studio work for anyone else on windows 64 bit?

    I followed the instructions to get Database Studio (http://wiki.sdn.sap.com/wiki/display/MaxDB/HowTo-Installationofa32-bitDatabaseStudioona64-bit+server).  After installing the 32 bit version of the jre, and starting the dbstudio executable using the