[omniORB] Need help creating C interface to omniORB application on a Windows machine

Duncan Grisby duncan at grisby.org
Thu Jul 27 11:53:42 BST 2006


On Monday 17 July, W T Meyer wrote:

> I have developed a DLL that replaces the client's calls to NI routines
> (in C) with work-alike routines using omniORB.  I must compile the
> omniORB code with MSVC++ (version 6.0) and export it using 'extern
> "C"' in order for the CVI compiler to link to it.
> 
> I had all of this working until I added the ability to transfer
> arrays, which required adding _var variables. After that, the old
> method of compiling on MSVC++ still gave a DLL and gave no error
> messages, but neither CVI nor MSVC++ client programs were able to use
> it - the DLL was somehow corrupted.

What exactly was the problem?

> Following the advice in chapter 12 of the omniORB manual, I tried
> adding '#define USE_stub_in_nt_dll' before including my stub headers
> and this did not fix the problem.

I don't think that's relevant here -- I assume you're packaging all your
code that uses omniORB, including the generated stubs, into one single
DLL. In that case, you don't need to mess with the USE_stub_in_nt_dll
stuff.

DLLs on Windows are a total nightmare. Perhaps you are suffering from
the non-uniform memory model and allocating things in one DLL and
deallocating them in another. In that case, you need to make sure all
the DLLs are compiled with the same options, otherwise you get errors
when things are deallocated.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list