use c++ dll with char for OMEGA RESEARCH PROSUITE 2000i

Discussion in 'App Development' started by flow12, Aug 17, 2014.

  1. flow12

    flow12

    I have created a dll in c ++
    I would like to pass as a parameter of the function a char [15] (then a char array)
    I lack the knowledge of TradeStation, but I hope it is a breeze to overcome this problem..


    in the dll:

    int __stdcall myfunction(int var,char cd[15])
    { ... }


    in the 2000i:

    DefineDLLFunc: "C:\mydll.dll", int, "myfunction", int,char;
    ...
    print(myfunction(1214,"text") ); <---" type mismatch"
     
  2. vicirek

    vicirek

    string literal "text" is const char[5] (4 + '\0') or you can try const char* as function argument and then pass string literals and deal with array size passing another argument or checking for end of const char array ('\0')
     
  3. vicirek

    vicirek

    another way to look at this is that the function expects:

    char exampletext[] ={'t','e','x','t'};

    and you pass exampletext as a second parameter