How do I pass an array of structs to a C function using the dll flexible prototype adapter?

What I want to do is pass into a C dll function a variably sized Array of structs of type TPS_Data. My Code compiles but when I run it in TestStand, I get an error -17001; Program Error. "Cannot allocate 0 size buffer Error in parameter 2, 'OpenFrdData'."
I've allocated the Array of structs, and all of the information is there before I call my function, so is it my prototype? Or am I asking too much of the DLL Flexible Prototype Adapter to pass an Array of Structs?
I can pass in a single struct of type TPS_Data and that works, but not an array.
Here's the relevent code:
typedef struct TPS_DATA
char Report_Number[256];
char System_Name[256];
char Open_Date[256];
char UUT_Part_Number[256];
char UUT_Serial_Number[256];
char UUT_Name[256];
char Open_Employee_Name[256];
char Open_Employee_Number[256];
char Close_Employee_Name[256];
char Close_Employee_Number[256];
char Close_Date[256];
} TPS_Data;
typedef struct TPS_DATA_ARRAY
TPS_Data DataRecord;
} TPS_DataArray;
long __declspec(dllexport) __stdcall OpenDialog (CAObjHandle Context, TPS_DataArray *TpsData[], const char *psFaultStr, char *sComments, const int nCount);

OK,
I can pass the data to the DLL function, using the following types:
typedef struct StringArrayType
char string[10][256];
} StringArray;
typedef struct MultiStringArrayType
StringArray Record[10];
} MultiStringArray;
void __declspec(dllexport) __stdcall ATP_TestStructPassing(StringArray Strings)
return;
void __declspec(dllexport) __stdcall ATP_TestMultiStructPassing(MultiStringArray *Strings)
return;
But when the MultiStruct function Exits, TestStand reports an Error:
-17501 "Unexpected Operating System Error" Source: 'TSAPI'
There doesn't seem to be a way around this, and once the error occurs, I have to force quit TestStand. I've included the sequence file, and the dll code can be compiled from the fun
ctions shown above.
Any thoughts on how to get around this error would be greatly appreciated.
Attachments:
StructArrayPassing.seq ‏16 KB

Similar Messages

  • HT201250 how can i pass information from one mac to another mac by using the time capsule

    how can i pass information from one mac to another mac by using the time capsule

    If you want to transfer files, settings, etc., you must open Migration Assistant (Applications > Utilities) in the Mac that you want to transfer the files and follow the instructions

  • How do I pass an array of strings? (Help Me... Please!!! .Read Me....)

    Dear All.
    Help Me...
    English is not very good. Google translator is used.
     How do I pass an array of strings?
    Please refer to the VB program
     ===========================================
    Private Sub m_btn_Click()
        Dim nReturn As Long
        Dim sPpid As String
        Dim sMdln As String
        Dim sSoftRev As String
        Dim nCount As Long
        Dim saCCodes(2) As String
        Dim naPCount(2) As Long
        Dim saPNames(10) As String
        sPpid = "PPID001"
        sMdln = "Mdln"
        sSoftRev = "Rev001"
        nCount = 2
        saCCodes(0) = "1"
        naPCount(0) = 5
        saPNames(0) = "Param001"
        saPNames(1) = "Param002"
        saPNames(2) = "Param003"
        saPNames(3) = "Param004"
        saPNames(4) = "Param005"
        saCCodes(1) = "2"
        naPCount(1) = 5
        saPNames(5) = "Param006"
        saPNames(6) = "Param007"
        saPNames(7) = "Param008"
        saPNames(8) = "Param009"
        saPNames(9) = "Param010"
        nReturn = m_XGem.GEMReqSend(sPpid, sMdln, sSoftRev, nCount, saCCodes(0), naPCount(0), saPNames(0))
        If (nReturn = 0) Then
            Call Me.AddMessage("[EQ ==> XGEM] GEMReqSend successfully")
        Else
            Call Me.AddMessage("[EQ ==> XGEM] Fail to GEMReqSend (" & nReturn & ")")
        End If
    End Sub
    =================================================
    nCount, naPCount enough saCCodes, saPNames value must be sent.
    How to handle an array of strings in LabView is impatient.
    I want to VB program implemented in LabView.

    Have you actually tried to right click on the according node parameter and select Create->Constant or Create-Control??
    And I don't see any string array in the parameter list. That are all simple strings and the VB code in your first post clearly shows that the call to the function only indexes the first element of those arrays to be passed to the function, not the entire array.
    If the function really reads arrays despite being declared as only taking strings then it is using some weirdo VB trickery and there will be no way to replicate that in LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • HT3406 how can i pass "could not active iphone" when I want to use an old iphone 4 as ipod?

    I have old iphone 4 like to use as ipod.  How can i pass "could not active iphone", I just want to use it as ipod.
    thnak you.
    Vivo

    Using an iPhone without a wireless service plan

  • How do I pass an error status from my java code back to the Program Job Ser

    How do I pass an error status from my java code back to the Program Job Server?
    I have a jar program object that reports a scheduled status of "Success" even if the java code errors out.

    Exceptions thrown from the program object are ignored by the program job server.
    You need to configure the Program Object, then stream out a special string sequence to the stdout of the Program Object, to set the scheduled instance status to Failed.
    Look up SAP KBase  1201804 - How to programmatically set the status of a Program object to "Failed"
    Sincerely,
    Ted Ueda

  • How can I transfer photos from an IPhone 5 to an IPad 2 using a cable.  I have tried using the lightning to firewire adapter with my current lead but this only seems to allow a download from the Ipad to the Iphone and not the other way around.

    How can I transfer photos from an IPhone 5 to an IPad 2 using a cable.  I have tried using the lightning to firewire adapter with my current lead but this only seems to allow a download from the IPad to the IPhone and not the other way around.

    The devices are not designed for transfer of that kind.  Use Photo Stream as suggested by another poster, or transfer photos to your computer (a good idea anyway since they will be lost if your device needs to be reset), then use iTunes to sync them to the other devices.

  • How can i remove pictures from my droid turbo without having to use the touch screen on the phone at all?

    how can i remove pictures from my droid turbo without having to use the touch screen on the phone at all?  my screen is cracked and i am waiting on a replacement phone.  as far as i can tell in order to access the phone storage through my computer, i have to use the touchscreen to enable it so that the computer will see it as a camera.  I can't do that as the top half of the touschscreen is unresponsive.  any suggestions?  teaches me to use the backup services offered in the future, but i still need a short term solution for this time.

        I'm sorry to hear your screen is cracked spence425. I know its difficult to use the phone while its damaged. I'm happy you are receiving a replacement device. Have you saved any of your pictures and other data to the cloud? Here is a link about the cloud http://vz.to/1mF0GIx . Unfortunately, you will be unable to remove any data from the phone if the screen is unresponsive but if you are looking to transfer data to your new phone, it would have needed to be saved via the cloud first. Keep us posted.
    Kinquana_VZW
    Follow us on Twitter @vzwsupport

  • How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available.

    How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available. I'm using iTunes 11.3 on a MacBook Pro, OS X 10.6.8. I can't save my library in iTunes, the message just keeps popping up.

    From an OS9 reference, error -54 is a software lock on a file or a permissions error. (Although there is no formal list of OSX error code some of the old codes still apply to OSX .)
    First, try simply restarting your computer.
    Try quitting iTunes, then deleting the .xml (not .itl !) version of the library file in the iTunes folder (iTunes will generate a new one).
    iTunes Library cannot be saved (Error -54) - https://discussions.apple.com/thread/1912814 - various things to try.
    Unknown error (-54) while syncing ipod - https://discussions.apple.com/thread/1082953 - problem was locked files
    Why does iTunes keep showing a -54 error when I sync my iPad? - https://discussions.apple.com/thread/3727114
    Error -54 possibly related to Touch Copy - https://discussions.apple.com/thread/3727114 - cleared by deleting preferences on iPad.
    iTunes: Missing folder or incorrect permissions may prevent authorization - http://support.apple.com/kb/ts1277
    Troubleshooting permissions issues in Mac OS X - http://support.apple.com/kb/HT2963

  • I need to pass data from an Access database to Teststand by using the built in Data step types(open data

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1i need to pass data from an Access database to Teststand by using the built in Data step types(open database /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1
    When I tried the same thing on another cmputer the same thing
    happend
    appreiciate u"r help

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1Hello Kitty -
    Certainly it is unusual that you can still see the tables available in your MS Access database but cannot see the columns? I am assuming you are configuring an Open Statement step and are trying to use the ring-control to select columns from your table?
    Can you tell me more about the changes you made to your file when you 'changed' it with MS Access? What version of Access are you using? What happens if you try and manually type in an 'Open Statement Dialog's SQL string such as...
    "SELECT UUT_RESULT.TEST_SOCKET_INDEX, UUT_RESULT.UUT_STATUS, UUT_RESULT.START_DATE_TIME FROM UUT_RESULT"
    Is it able to find the columns even if it can't display them? I am worried that maybe you are using a version of MS Access that is too new for the version of TestSt
    and you are running. Has anything else changed aside from the file you are editing?
    Regards,
    -Elaine R.
    National Instruments
    http://www.ni.com/ask

  • How to use the DLLs which created from c++ in Java?

    And How to use the DLLs which created from JNI in C++?

    Huh?
    Are you asking how to do JNI - you should read the tutorial.
    Are you asking how to load it - then use System.loadLibrary()
    Are you asking what to do with the output from javah - put it in a C file and write some code, compile it into a dll.

  • I have a mac pro for work and they made it log on windows at start up.  how can i switch back to Mac as well so i will use the i cloud fetures ?

    I have a mac pro for work and they made it log on windows at start up.  how can i switch back to Mac as well so i will use the i cloud fetures ?

    Is a version of Mac OS running on this Mac? Reboot and hold down the option key.

  • How do I delete a row in Microsoft Access from a vi using the database toolkit

    Using the database toolkit 1.01 how can I delete a row from my vi

    Bambi,
    I know you already got the answer from Jeremy in the LabVIEW Forum, but I wanted to place this link here so that other users could see the answer.
    How do I delete a row in Microsoft Access from a vi using the database toolkit
    Evan

  • How to get rid of a window which says: CalendarAgent wants to use the "login" keychain

    How to get rid of a window which says: CalendarAgent wants to use the "login" keychain

    I would get free EasyFind (Spotlight will be a total waste of time), and search for caremefile and caremefile.info. If it comes up with anything, right-click and select move to trash, or just destroy. Since you didn't install anything, shouldn't be necessary to authenticate with the admin password before it will move to trash. Could also click on reveal in finder, which will allow you to see the actual location. Set it up as per the screenshot below.

  • How to stop my iphone 5 for flipping my photo when i use the front camera.

    How to stop my iphone 5 for flipping my photo when i use the front camera.

    You don't. Look in the mirror...now raise a hand...get the picture?
    Same thing applies with your phone.

  • How do I copy pictures from IPad Air to my laptop without using the Cloud?

    How do I copy pictures from IPad Air to my laptop without using the Cloud?

    See this link:  Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support
    http://support.apple.com/en-us/HT201302
    Import media to a Windows PC
    Before importing your media:
    Unlock your iOS device using your passcode, particularly if you've never synced your device with the computer before. Learn more about iOS passcodes.
    Makes sure your iOS device trusts the computer you want to import your media onto. Learn more about "Trust this Computer."
    Windows 8: Learn how to import photos and videos from a camera, phone, or DVD (Windows Help)
    Windows 7 and Windows Vista: Learn how to get pictures from your camera to your computer(Windows Help)
    If your computer doesn't recognize an attached iPhone, iPad, or iPod touch as a camera, and prevents you from importing photos to your computer, learn how to resolve the issue.

Maybe you are looking for

  • MacBook 2010 won't get past loading screen

    Hi everyone. I don't live anywhere near an apple store so am hoping I can get some help here. My MacBook won't get past the initial White loading screen with the grey apple logo. A loading bar (which I've never seen before) comes up, loads about 1/5

  • My Retina MacBook gets messed up display content.

    Whenever it awakes from standby or an application creates a lot of OpenGL data (games, blender, sometimes just chrome or other software after using it all day) I am getting random stuff displayed on parts of my screen or even the whole screen, like w

  • How do I get an app I paid for back on my phone

    I bought an app and it doesnt seemed to be saved in Itunes. I am loading my new phone up again and it is missing an app. I broke my old phone so I can not save my old info into Itunes. Any help is appreciated Thanks

  • How to Migrate my database from SQL Server 2000 to Oracle

    I want to transfer my database from SQL Server 2000 to Oracle, Can I do this without using Oracle Migration Workbench ?? Please help me. Thanks in advance Vicky... :-)

  • Vectorscope in Color 1.0.2

    Something is wrong with the Vscope on the new version of Color. I've been using a DSC labs chart (which requires 2x Vscope gain) and before the update clicking 50% on the Vscope put the colors where they should be. Now they're less saturated on the s