LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LABVIEWV.LIB was not called from a LabVIEW process

I'm working toward calling a dll created from a vi in a LabWindows/CVI application. The dll requires an LStrHandle so I'm using code I found here.

static LStrHandle MakeLStrHandle(char * text)
{
    LStrHandle lvStringHandle; 

    lvStringHandle = (LStrHandle)DSNewHandle(sizeof(int32) + strlen(text) * sizeof(char));

    // Empty the buffer
    memset(LStrBuf(*lvStringHandle), '\0', strlen(text));

    // Fill the string buffer with stringData
    sprintf((char*)LStrBuf(*lvStringHandle),"%s", text);

    // Inform the LabVIEW string handle about the size of the stringData
    LStrLen(*lvStringHandle) = strlen(text);
   
    return(lvStringHandle);
}

At first it failed to link. I tried adding labview.lib and labviewv.lib and either one allows it to link (What's the difference between them?)

But when I run the program, I get an error creating the DSNewHandle. I get the same type of error regardless of whether I use labview.lib or labviewv.lib.

It looks like I'm not initializing something, but what?
0 Kudos
Message 1 of 3
(3,879 Views)
jtdavies,

what is the error you get when calling DSNewHandle()?
Regards,


Marty H.
National Instruments
0 Kudos
Message 2 of 3
(3,858 Views)
I went away for a long weekend, and this morning my problem had disappeared.

So I guess I don't have a problem anymore.

Thanks for looking at it.

John
0 Kudos
Message 3 of 3
(3,818 Views)