Modifying a string in a DLL

I am using the flexible DLL prototype adapter to pass a test stand string (local). I wish to modify the contents of the string within the body of my DLL 'C' Function.
When I try to use a type that will allow the code to make the modifications on the test stand variable, Test Stand generates an error when it checks my type library.
I have tried using the following string types in my code:
LPCTSTR* pszString
BSTR* pbstrString
Both types generate a type not supported message in Test Stand.
Is it possible to perform this action using test stand?

Hi C_Test,
A character string (char[]) can be modified inside a DLL call. Just as Ron said, to TestStand this is C String Buffer which is modifiable from the C DLL.
Attached is a zipfile containing a sequence file (teststring.seq) which calls a Visual C++ 6 DLL that contains one function takes one input parameter (char mystring[1024]). The input string is modified, and the sequence file displays before and after message popups to show that this works.
Regards,
David Mc.
National Instruments - Applications Engineeing
Attachments:
teststring.zip ‏261 KB

Similar Messages

  • The "write key" configurat​ion file vi use of "trim string" prior to writing the data can modify any string data written.

    I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
    I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
    After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
    1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
      and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
    2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
    or
    3)  You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
    Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like    key="\20Hello\20World\20"   while option #2 produces an entry that looks like   key=" Hello World "
    The attached PDF contains screenshots of all this.
    Attachments:
    Binder1.pdf ‏2507 KB

    Hi Warren,
    there's a 4th option:
    Simply set the "write raw string" input of the write key function to TRUE
    This option only appears when a string is wired to that function!
    Just re-checked:
    I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
    Message Edited by GerdW on 05-02-2009 08:32 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How do I keep from highlighting terms in the search bar when I modify a string in the search bar--other than by clicking three to five times?

    I'm not talking about terms in the search results; I'm talking about terms in the search string in the search bar in the upper right corner. (Mine is set to use only Google.) When I've searched on a string and decide to modify the string for a second search (say, changing "Spanish architecture" to "Spanish architectural style"), clicking at the end of the search string first highlights the entire string and then, as I keep clicking, highlights various parts of the string. Sometimes it takes five clicks to get the highlighting to go away so I can start back-deleting normally instead of by entire word or phrase. The Google homepage doesn't do this, whereas all search engines in Firefox do it, so it's clearly a Firefox annoyance.

    Left click ONCE to get it's attention. After a moment, then do your work.

  • How can i pass string from C++ DLL to Java via JNI?

    Hi everybody. I made a DLL with Borland C++. I must pass a string from this dll to Java via JNI.Namely i define a string variable in C++ DLL and i send this variable's value to Java via JNI.
    I can pass integers but i couldnt Strings. . How can i do this? is there any sample?

    Hi,
    So your function should be private static native String get_text();
    (It's often a good idea to make native methods private since when you change signatures you generally have to change java wrapper methods only).
    I know nothing about C++ strings but I'm pretty sure that you can convert it to char*, so
    do :
    char* szMyString = myString.toChar*();
    Then return from native with JNU_NewStringPlatform(env, szMyString)
    (see my 1st answer for JNU_NewStringPlatform() description).
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Modifying a string...

    I'd like to modify a string. I wanna replace a substring of the original string to another substring. I was looked for a method in Java API, but i didn't find the perfect, because there is a replace(char,char) method, but i don't want to replace just 1 character. Please, help me. Thanks.

    Since JDK 1.4 there is a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#replaceAll(java.lang.String, java.lang.String)]replaceAll method that performs regex matching. This will return a new String and will not change the original one since String is an immutable class
    Mike

  • Assign global array of structures of structures of std strings in a dll

    I have a dll which consists of three c files. Find bellow the c file of the loader and the three files of the dll. In dll, file 1 and file 2 are almost identical, static arrays names and sizes, structure names, Prepare_1() and Prepare_2() functions. There
    is a small difference in the function Prepare_1 in the way MuxStatusSupl[ u32Idx ].FileInfo.Name is assigned and there I get an exception. Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1. From this point
    I couldn't strip down even more the sample code because small changes make the problem disappear without, I'm afraid, really solving the problem. That's why I have put so much code here, I'm not even sure what is relevant and what not. For example, if I add
    in file 1 in the StructStatus the extra member u32ExitPoint (and, of course, I modify Status_Init accordingly), I don't see the problem anymore.
    ///////////////////////////////////////////////////// loader file begin ////
    #include "stdafx.h"
    int main(int argc, char* argv[])
    {   HINSTANCE hDLL = LoadLibrary( DLL_FQN_FILE_NAME );
        if( void ( * pCreateDllInterface )( void ) =
                (void(*)())GetProcAddress( hDLL, "CreateDllInterface" ) )
            pCreateDllInterface();
        FreeLibrary( hDLL );
    ///////////////////////////////////////////////////// loader file end //////
    ///////////////////////////////////////////////////// dll main file begin //
    extern void Prepare_1( void );
    extern void Prepare_2( void );
    extern "C" _declspec(dllexport) void CreateDllInterface( ) { Prepare_1(); }
    ///////////////////////////////////////////////////// dll main file end ////
    ///////////////////////////////////////////////////// dll file 1 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_1() 
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
                        { false, false, false, false, 0, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init ); //  this seems
                               // to overwrite MuxStatusSupl[ 3 ].FileInfo.Name
        for( uint32 u32Idx = 0; u32Idx < STORAGE_SIZE; u32Idx++ )
            MuxStatusSupl[ u32Idx ].FileInfo.Name = ""; // crash when u32Idx==3 
    ///////////////////////////////////////////////////// dll file 1 end ///////
    ///////////////////////////////////////////////////// dll file 2 begin /////
    #include <string>
    #include <sys/stat.h>
    #define STORAGE_SIZE  254
    typedef unsigned long  int uint32;
    struct StructFileInfo
    {   std::string Name; 
        struct stat FileStatus; 
    static struct StructStatus
    {   bool bDownloaded;      bool bDownloadedLast;
        bool bCalled;          bool bCalledLast;
        uint32 u32EntryPoint;  uint32 u32ExitPoint;
        StructFileInfo FileInfo;
    } MuxStatusMain[ STORAGE_SIZE ], MuxStatusSupl[ STORAGE_SIZE ];
    void Prepare_2()
    {   struct stat Stat_Init;
        memset( &Stat_Init, 0, sizeof(struct stat) );
        StructStatus Status_Init =
            { false, false, false, false, 0, 0xFFFFFFFF, { "", Stat_Init } };
        std::fill_n( MuxStatusMain, STORAGE_SIZE, Status_Init );
        std::fill_n( MuxStatusSupl, STORAGE_SIZE, Status_Init );
    ///////////////////////////////////////////////////// dll file 2 end ///////
    I get the crash with the message: Unhalted exception at 0x10001f90 in Test.exe: 0xC0000005: Access violation writing location 0x1006d320
    Another strange phenomena is that in watch window, expressions
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
        sizeof(MuxStatusMain)/sizof(MuxStatusMain[0])
    show both a value of 232 instead of 254 (but if I add in file 1 in the struct the missing member they show the correct values). On the other hand, if I printf those values, they are correct, 254.

    "Another difference is that the structure StructStatus in file 2 has an extra member compare to file 1."
    That's not going to work. It is possible to define the same struct in different translation units but the definitions need to be identical. Use different names for StructFileInfo and StructStatus.

  • Modify XML string of a view before output

    Hi!
    I'm still working in the view IUICMD/CreatePerson, when you're in the CreatePerson.htm, you will found  
    DATA lv_xml TYPE string.
      lv_xml = controller->configuration_descr->get_config_data( ).
    In the string I can se all the layout for my view, is there method to work around with this string to change the properties of the atributes so I can change the layout dinamically?
    Reward points will be granted for useful answers!
    Thanks N' Best Regards
    Luís
    Edited by: Luis pérez on May 7, 2008 9:25 AM

    Hello Luis,
    The XML string is the result of the View Configuration you made yourself
    In the BSP WD Component Workbench (BSP_WD_CMPWB) you can find for each view of that component a tab called 'Configuration' where you can modify
    - what fields are visible on that page (add/remove fields)
    - how the fields are ordered on the field
    - how the fields look like (display length, ...)
    The results of that configuration is stored as XML in the system and called in the view (.htm) by the code you mentioned (lv_xml = controller->configuration_descr->get_config_data( ).) So if you want to change the layout of that specific view, just open the configuration tab of that view!
    If you still want more flexibility you can totally disable that line of code and program everything yourself in the view with either <htmlb> <crm_bsp_ic> or one of the other (or a combination of) BSP tags, like it was in CRM 5.0. SAP still uses that way of programming for some components, maybe take a look at them, then you'll see what I mean. (Open component BT126H_MAIL in the BSP_WD_CMPWB; then double click on the 'send_screen' view and open the 'send_screen.htm' in the right pane by double clicking on it, here you see that no XML is used, instead all visible components are coded using HTML and SAP tags)
    If you're not used to program in BOL / HTMLB I strongly suggest to use the SAP 'Configuration' XML mechanism. It saves you a huge amount of coding (and time)!
    Hope this makes things clear!
    Reward points if useful!
    Regards,
    Joost

  • Pass String Array to DLL

    Hi,
     I m trying to pass a String Array to a DLL, but I can't found the type for the  "Char *heihei[ ]"
    Here I attached the screenshot here. Hopefully some expert here can help me to solve out this thing. Thanks a lot in advance.
    DLL input:
    int __stdcall RunDLLUI (char * pszMainPath, char * pszFileName, int * nArrayErrorRow, char * pszArrayErrorCol[], int nNumOfErrors, int nOffsetError);          
    Please refer to the pictures attached. Thanks again for your time.
    Attachments:
    code.JPG ‏29 KB
    front.JPG ‏40 KB
    DataType.JPG ‏49 KB

    You should post your LabVIEW question to the LabVIEW board.

  • Creating string pointer for dll

    I'm trying to use a DLL to access a Reflective memory board using LV6.i
    under Windows2000. The first call to the DLL takes a pointer to a string
    that contains the device name and it returns a handle to that has to be
    used in all other calls.
    The syntax is - RFMHANDLE rfmOpen( char devPath );
    The example in the documentation is;
    RFMHANDLE rh;
    char *devPath = "\\\\.\\RFM1"; This is the
    W2000 name for the board
    if( (rh = rfmOpen( devPath ) ) == NULL ){
    exit(1);
    All the other calls pass the handle rh as the calling parameter.
    My question is how do I create the string pointer devPath?
    Ed

    Ed,
    I'm a Labview DLL rookie but I think all you have to do is in the DLL
    configure define the arg Type as a "String" and the String Format as a "C
    String Pointer". Then when you wire that terminal up, just connect it to
    Sting Constant or Control. Then just pass that argument the device name
    string. Labview will take care of actually passing the that string pointer
    value to the DLL.
    I just done something similar with an array of 16 bytes. I am supposed to
    pass the function the pointer to the array and it will change the data in
    that array. I defined the arg as Type "Array" of Data Type "Unsigned 8-bit
    Integer", Dimension "1", and Array Format as an "Array Data Pointer". I
    then connected that terminal to the Build Array function of 16 bytes. The
    output terminal
    directly accross from that input terminal was connected to
    an array indicator. When I run the VI the data bytes were changed as
    expected.
    The point is that I never really had to deal with the pointer directly. So
    you don't have to create the string pointer, just create the string and
    connect it to the terminal defined as a string.
    - David
    Ed Bogart wrote:
    > I'm trying to use a DLL to access a Reflective memory board using LV6.i
    > under Windows2000. The first call to the DLL takes a pointer to a string
    > that contains the device name and it returns a handle to that has to be
    > used in all other calls.
    >
    > The syntax is - RFMHANDLE rfmOpen( char devPath );
    >
    > The example in the documentation is;
    > RFMHANDLE rh;
    > char *devPath = "\\\\.\\RFM1"; This is the
    > W2000 name for the board
    >
    > if( (rh = rfmOpen( devPath ) ) == NULL ){
    > ....
    > exit(1);
    > }
    >
    > All the other calls pass the handle rh as the calling paramete
    r.
    >
    > My question is how do I create the string pointer devPath?
    >
    > Ed

  • How to remove the "int len" of my return string on the DLLS header when building a DLL on LabVIEW 8.5

    Hi all.
    I'm building a DLL on LabVIEW and I choose a string as an output on the terminals connectors.
    But LabVIEW creates another output, the lenght of the return string.
    This is a problem because I have other DLLs and I need them to be compatible.
    How do I remove this length from the header? What is the difference between Pascal String and C string and String Handle Pointer?
    String Handle Pointer removes the length from the header but I don't know the difference between this data types.
    Thanks in advance for the help.
    Daniel Coelho
    Portugal
    Daniel Coelho
    VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
    Controlar - Electronica Industrial e Sistemas, Lda

    Daniel Coelho wrote:
    Hi all.
    I'm building a DLL on LabVIEW and I choose a string as an output on the terminals connectors.
    But LabVIEW creates another output, the lenght of the return string.
    This is a problem because I have other DLLs and I need them to be compatible.
    How do I remove this length from the header? What is the difference between Pascal String and C string and String Handle Pointer?
    String Handle Pointer removes the length from the header but I don't know the difference between this data types.
    Thanks in advance for the help.
    Daniel Coelho
    Portugal
    C string pointer is a pointer to a memory location whose string information is terminated by a 0 byte. Pascal String Pointer is a pointer to a memory location where the first byte specifies the number of bytes to follow. This obviously allows only for strings up to 255 character length.
    LabVIEW String Handle is a pointer to a pointer to a memory location where the first 4 bytes are an int32 value indicating the number of characters to follow. You can read such a String handle in a function without many problems, but you can only create, resize and delete such a handle by using LabVIEW memory manager functions. So this makes only sense if the caller of such a DLL is LabVIEW too as another caller would have to go through several hoops and tricks in order to gain access to the correct LabVIEW kernel that could provide the memory manager functions to deal with such handles.
    Last but not least output strings whose allocated length is not passed to the funciton as additional parameter are a huge secerity risk (talk about buffer overrun errors). LabVIEW DLL Builder does not support the creation of DLLs with output string (or array parameters)  without the explicit passing of an additional parameter telling the DLL function how large the allocated size is (so that the DLL function can make sure to never write over the end of the buffer).
    The additional length parameter only disappears for String Handles because LabVIEW will simply resize them to whatever length is necessary and that is also the reason why those handles need to be allocated by the same memory manager instance that is also going to execute the DLL function.
    Resizing of memory pointers is non-standardized and in normal circumstances not suited for passed function parameters at all.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-13-2008 12:28 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Have a JTextComponent directly modify a String

    I'm at a complete loss, here. What I need to do is have a JTextComponent basically display a String and any modifications to the text in the JTextComponent will mirror in the String - so it's like they're the same.
    I've tried several approaches to this...
    First try I used a custom DocumentListener (applied to the JTextComponent) which would intercept any changes and basically perform this:
    myString = documentEvent.getDocument().getText(0, documentEvent.getDocuiment().getLength());But this would cause dramatic slowdowns if the String contained in the Document was large, and on top of this, each time a character is inserted or removed in the Document, that code was run- even more slowdown!
    My second pseudo-try (I couldn't get it to work properly) involved PipedInput and PipedOutput streams. I read that it would be better to have a Thread dedicated to having the PipedInputStream receive data from the PipedOutputStream (configured to monitor the text in the JTextComponent). I didn't get this to work.
    Then I started reading up on StringWriter and StringReader. And then ByteArrayInput and Output classes.
    I couldn't get anything to work the way I need it to. If anyone has a way that can accomplish this, please let me know!

    Okay, so... OOP practices make me feel stupid sometimes. Heaven forbid I just create a Document and have it be a pointer to the JTextComponent's getDocument().
    /stupid

  • ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Invalid date string (7497) (pgoe1022.dll)

    I am selecting data from a Progress database using the Data Direct Open Edge 10.1.B driver. The target table stores the date values as varchar in this format "22-OCT-14" In the select statement I can use Progress statements or T-SQL to transform
    the varchar to a date - but cannot do the same in the WHERE clause 
    Select po_number, cast(po_date as date) as [po_date] from [po_table] 
    (no problem - the [po_date] field stored as "22-OCT-14" is returned as "2014-10-22 00:00:00"
    but when I include the cast in the where clause I get the error described in the title
    Select [po_number], [po_date] from [po_table WHERE cast([po_date] as date)<= '10/22/2014' - NO GOOD
    I have tried very many combinations of the date string format , different functions and sub-queries but cannot find an answer

    The sql strings I posted are working examples - I've tried the ISO format you included - any number of date formats will work when the target field is a "Date" field - but trying any kind of transform statment to processa date stored
    as a varchar in the WHERE CLAUSE throws the erro
    Storing dates in a varchar column is a bad idea on any platform. Apparently there are strings in that column which cannot be converted to dates.
    On SQL Server you could have found this with
    SELECT po_date FROM po_table WHERE isdate(po_date) = 1
    What you should use on Progress, I have no idea.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to modify a string (bolt, underlined, font) inside the XML code

    Hi all, I have this code (used inside BI Publisher)
    <?if:INDUSTRY_COMPETENCE_DESCR != ''?> Industry competencies: <?for-each:G_IND_COMP?><?INDUSTRY_COMPETENCE_DESCR?><?end for-each?><?end if?>
    Anyone knows how can I show the string "Industry competencies" bold and underlined ? and also how can I set the format (font style, font dimensions, font colors, etc...) ?
    Regarding the bolt feature I tried the <B> from HTML but it doesn't work.....
    Any help will be appreciated
    Thanks
    Alex

    Hi all, I have this code (used inside BI Publisher)
    <?if:INDUSTRY_COMPETENCE_DESCR != ''?> Industry competencies: <?for-each:G_IND_COMP?><?INDUSTRY_COMPETENCE_DESCR?><?end for-each?><?end if?>
    Anyone knows how can I show the string "Industry competencies" bold and underlined ? and also how can I set the format (font style, font dimensions, font colors, etc...) ?
    Regarding the bolt feature I tried the <B> from HTML but it doesn't work.....
    Any help will be appreciated
    Thanks
    Alex

  • Passing (byref) String from Java to C++ via JNI

    I wish to pass a string to a C++ Dll as a parameter in a function. The problem is that I don't know howto receive back the data after it is filled in the C++ dll. I am trying to do what is called passing parameters by reference.
    Java Code:
    public class ABKeyBoard {
    public native long leerBanda(int pista, String datos);
    public static void main(String[] args) {
    String datos=new String();
    System.loadLibrary("ABKeyBoard");
    new ABKeyBoard().leerBanda(1,datos);
    System.out.println(datos); //the content of datos here is empty.
    C++ Code:
    Java_ABKeyBoard_leerBanda(JNIEnv *env, jobject obj,jint pista, jstring datos)
         char buffer[2024];
         memset(buffer,     0x00,     sizeof(buffer));
         strcpy(buffer, "xxxx");
         datos = env->NewStringUTF(buffer);
    return;
    Thanks for your help.

    In java every parameter are always passed by value.
    The datos parameter is a local copy of the string
    reference you pass to the method.This is wrong. The String passed to the native method is the same String object you use in Java. Although everything is passed by value in Java, what is actually passed by value is the reference to the String. This means that you can modify the object you pass, but you are not allowed to change the reference to point to a totally different object. That is where the problem is coming in.
    The trouble is that it is illegal to modify a String, even from native code. If you need to make changes in-place to the text, pass an array of chars (if your native code uses Unicode), an array of bytes (if it uses normal 8-bit characters) or a StringBuffer. You can legally modify any of these data structures with the new data. But the StringBuffer object is the only one whose length can be changed after it is created. Unfortunately it is also the hardest to use from JNI.
    Generally I think you should always pass arrays of bytes/chars to native code instead of Strings when possible. They can be modified in place, and you can use String's methods to get a byte-array in the platform's proper encoding. Using the GetStringUTFChars method is problematic because UTF only maps directly onto ASCII in the case of characters which are in the set of 7-bit ASCII characters. Your code will do wrong things if your String happens to contain some other character, unless your native code expects UTF format strings.
    The good news is that C(++) functions which return results in their arguments do not ordinarily change the length. So you should be able to allocate a byte[] or char[] ahead of time of the appropriate size (don't forget to add the trailing null, which is not a component of Java strings). I think byte[] or char[] is the best answer because you can easily map those onto C-style arrays with Get[Primitive]ArrayRegion; the return of that is suitable for passing directly to native code, as long as you have remembered the null-terminator. For instance you could do (*env)->GetByteArrayRegion(env, javaArray, 0, arrayLength, CArray) and then your CArray would be changed to point at the contents of the javaArray (note: it does not copy data into CArray, it changes CArray to point at the array contents, so do not allocate memory for CArray first). Then when you do ReleaseByteArrayRegion the results will be propagated back to Java.

  • Pass an error cluster in and out of a C/C++ dll?

    Hi all,
    I'd like to know if it is possible to pass a LabVIEW error cluster to a C/C++ function from a dll. This would greatly help error handling in the different VIs.
    I am able to access and modify the first two members of the error cluster; the error status and the error code, which are, respectively, boolean and integer. But I cannot modify the string. LabVIEW crashes completely doing so.
    I first define a structure in C++ like this:
    const int N = 512;
    #pragma pack(push,1)
    typedef struct lvcluster {
    bool status;
    int code;
    char source[N];
    } lvcluster;
    #pragma pack(pop)
    Then, I define a function that will access the members status, code and source:
    int TestCluster(lvcluster *err)
    err->code = 1;
    err->status = false;
    sprintf(err->source, 'Test');
    I then use LabVIEW's "Call Library Function" to call this dll's function. I have set the parameter "err" to "Adapt to Type" and "Handles by Value". Trying to write characters to the source array crashes LabVIEW.
    Is this possible at all? How should it be done?
    Thanks!

    Thanks all for the comments.
    I've been looking at extcode.h where I saw the defeninition of a LStrHandle. It seems to be a pointer to pointer to "character array":
    typedef struct {
    int cnt; /* number of bytes that follow */
    unsigned char str[1]; /* cnt bytes */
    } LStr, *LStrPtr, **LStrHandle;
    The "character array" is different than a C character array, see http://www.ni.com/white-paper/4877/en/#toc4
    The first 4 bytes contain a signed 32 bit integer representing the number of characters. There is no NULL-termination character.
     So the error structure should be something like this (modulo the size of boolean, thanks rolfk):
    const int N = 512;
    #pragma pack(push,1)
    typedef struct lvcluster {
    bool status;
    int32 code;
    LStrHandle source;
    } lvcluster;
    #pragma pack(pop)
    From there, I was able to access a LabVIEW string from C. But I am unable to modify any of it. I might be able to change the characters from an alreay allocated string, but resizing or even creating a new string crashes LabVIEW. As reported by others, manipulating these strings would require linking against labview's library to access the string manipulation functions, but this is not possible as the library must be independant of LabVIEW.
    The only last possible way I can think of is to allocate a new cluster inside the DLL. Then I might be able to change the string in it, and hopefully LabVIEW would pick it up. I don't know how LabVIEW manages its memory; would it garbage collect the input cluster that is not used anymore?
    Thanks for all the feedback.

Maybe you are looking for

  • Flex DataGrid Component

    Can i extend the Flex DataGrid using ActionScript and create as  Add-On Component ?

  • AE linked composition looks different in Premiere

    Hi everyone! I'm working on a Premiere Pro project that has several dynamic links. When I apply the effects in After Effects the image looks just the way I want, but even before rendering when I visualise the linked composition in Premiere Pro, it lo

  • Suggested timeout config on pix for aaa cmds passing through

    Our tacacs sits on the other side of a pix firewall. As a result we are causing alot of xlate transactions on the pix as we enter commands on our devices. What are the suggested timeout values? Our conn count is max 2700 timeout xlate 3:00:00 (defaul

  • Trouble Downloading Driver Updates

     X( HELP! Whenever I try to download any of the driver/BIOS updates, it starts the download, gets about 200k downloaded, and then just stops with no error.  I've tried to download BIOS, drivers, VGA drivers, even the updated Live Update Utility.  I'v

  • What is the maximum amount of memory I can have for my computer?

    The specs are:   Model Name: iMac   Model Identifier: iMac7,1   Processor Name: Intel Core 2 Duo   Processor Speed: 2 GHz   Number Of Processors: 1   Total Number Of Cores: 2   L2 Cache: 4 MB   Memory: 1 GB   Bus Speed: 800 MHz   Boot ROM Version: IM