I am trying to initialize Houdini Engine in a C# built host with the default in-process session. When running the code I keep getting HAPI_RESULT_INVALID_SESSION as result. I know the .dll is correctly set up since I can call other functions correctly (such as HAPI_GetEnvInt()). How should I initialize Houdini Engine with the default in-process session?
Then I have another problem. The function HAPI_CreateInProcessSession does not exist in the libHARC32.dll. At least not that I can see by using VSs dumpbin. The function does exist in libHAPI.dll but since I get the BadImageFormatException when trying to use that .dll instead of libHARC32.dll I guess it is not made for a x86 application? Or am I doing something wrong when writing the code?
Yes, you'll need to import libHAPIL.dll as that contains all the HAPI function's you'll need to import.
If you want a C# reference, you can check out the Houdini Engine for Unity version 2, available on recent Houdini 16.5 daily and production builds. See more info here: http://www.sidefx.com/docs/unity/index.html [www.sidefx.com]
What would you recommend me to do if my application is x86 and not x64? I only get a BadImageFormatException when I am trying to load the libHAPIL.dll.
libHARC32.dll works fine but with all the others I get the same exception which makes me think that the others are x64 dlls?
Is there a reason why the CreateInProcess() function is not included in the 32bits version?
You're right, everything, but HARC32 is 64bits. This is why you cannot create an in-process session, since HAPI (and Houdini) are 64 bits only.
I've replied on your other topic, but linking to HARC32 on your 32 bits application, then connecting to an existing HARS process (x64) is the only solution to use Houdini Engine on x86.