Hi Tom,<br> <br> Thanks for the reply. My plan is to write simple reference classes to wrap the unmanaged (itk) code. This should work just fine for incorporating unmanaged C++ code. For instance:<br> <br> //****Managed wrapper class*****<br> public ref class MikeWrapper<br> {<br> public:<br> MikeWrapper(Int32 initial);<br> void PrintValue();<br> private:<br> MikeClass<int> *pMike;<br> <br> //**Unmanaged C++ class****<br> template<typename T> <br> class MikeClass<br> {<br> public:<br> MikeClass(T value) {<br> myvec.push_back(value);<br> }<br>
void PrintValue(){<br> std::cout<< myvec[0] << std::endl;<br> }<br> <br> private:<br> std::vector<T> myvec;<br> };<br> <br> //********************<br> <br> At this point, the GUI can be written in a CLR language ( (C++/CLI, C#) and just access the wrapper class.<br> <br> My tripping point is the compiler settings. The header for the unmanaged class calls itkImage.h and thus needs to have the correct ITK compiler settings, include directories and libraries. I can't use CMake unfortunately because it only sets up normal unmanaged C++ projects. John Biddiscombe posted some tips back in 2004 on how to do this in this list, but I can't seem to make it work.<br><br>Thanks for reading again.<br><br><br><br><br><b><i>Thomas Lambertz
<thomas@hexerei-software.de></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hello Mike,<br><br>the difference between C++/CLI and conventional unmanaged C++ is much <br>more than only a compilerstep. For example there are no raw-pointer in <br>CLI and there are many other types that have changed. So it doesnt work <br>to set up a project for CLI by only changing some parameters in CMake. <br> From my point of view there´s no way to compile ITK as CLI without <br>rewriting nearly the complete code (but i am prepared to learn). <br>Resulting performance may be another contraindication.<br><br>Have you considered a mixedmode application ? I have approached it that <br>way. My GUI runs as a CLI-app while access to ITK is encapsulated in an <br>unmanaged DLL (you have to spent some attention on memory-management). <br>Needs some work on a wrapper but the benefits of the new gui-handling
<br>may pay of for you.<br><br>Statically linking the (conventional) ITK library against a mixedmode <br>application by using "#pragma (un)managed" and some marshalling may also <br>work.I am sure there are more suitable solutions...<br><br>Regards,<br>Tom<br><br><br>Mike Feur wrote:<br>> Hello,<br>><br>> I am trying to create a Common Language Runtime C++/CLI project that<br>> includes ITK code in Visual Studio 2005.<br>><br>> There is no Cmake file for me to use. I have tried manually copying<br>> over all the include directories from a Cmake created ITK project. I<br>> am getting linker errors such as<br>><br>> "error LNK2001: unresolved external symbol "public: virtual void<br>> __thiscall itk::EventObject::Print(class std::basic_ostream< ....."<br>><br>> I tried including the appropriate lib files by adding the<br>> "...\InsightBin\bin\debug" directory to the "Configuration<br>>
Properties\Linker\General\Additional Library Directories" dialog box<br>> in the Property Pages for the Solution, but still no luck.<br>><br>><br>> Any suggestions or instructions of how to integrate ITK into a CLR<br>> solution?<br>><br>> Best of all would be a Cmake file to use, similar to the one<br>> available for MFC.<br>><br>><br>> Thanks for taking the time to read this.<br>><br>t<br>_______________________________________________<br>Insight-users mailing list<br>Insight-users@itk.org<br>http://www.itk.org/mailman/listinfo/insight-users<br></blockquote><br><p>
                <hr size=1>Yahoo! Messenger with Voice. <a href="http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">Make PC-to-Phone Calls</a> to the US (and 30+ countries) for 2¢/min or less.