I have a problem when trying to create a session in my x86 application written in C#.
The result comes back as HAPI_RESULT_FAILURE when I try to create the session using the
CreateThriftNamedPipeServer function.
pipe_name = “hapi”
server_executable_path = “C:\Program Files\Side Effects Software\Houdini 16.5.496\bin\HARS.exe”
(which is the correct path to the .exe)
//HoudiniVersion.HAPI_LIBRARY = libHARC32.dll
[DllImport(HoudiniVersion.HAPI_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
private static extern HAPI_Result
HAPI_StartThriftNamedPipeServer(
ref HAPI_ThriftServerOptions options,
string pipe_name,
out int process_id);
private static bool startProcess (...){
...
int process_id;
HAPI_ThriftServerOptions server_options = new HAPI_ThriftServerOptions();
server_options.autoClose = true;
server_options.timeoutMs = 2000.0f;
HAPI_Result result = HAPI_StartThriftNamedPipeServer(
ref server_options,
pipe_name,
out process_id);
...
}
My questions is then:
1. Am I missing something in the code?
2. Does the pipe need to be named in a certain way for it to work?
3. I have tried adding HARS.exe (and basically everything else in the bin folder) in the same folder as my executable without any luck. Is there something special I need to do beside the code for it to work?
4. And is it even possible to link the API to a x86 application?