Hi,
I recently attempted to build a simple forms application in Visual
Studio 2005 (Express) C++ edition. I built dcmtk package myself, as a
collection of static C++ libs. I then link with these libs from the
managed C++ forms application. Everything compiles fine, links great.
But there is a runtime access violation thrown as soon as the first
const is declared in a dcmtk file:
const OFConditionConst ECC_Normal( 0, 0, OF_ok,
"Normal");
I suspect it is because of mixing of unmanaged and managed C++ code. I did see similar posting earlier in the forum, relating to similar problems; but none of them discussed specific remedies.
If you have any expertise in this, please share.
FYI:
[1] All projects are built with /clr option and multithreaded dll
support, except dcmtk: multithreaded dll, but no clr. It wouldnt link
properly if built with /clr option.
[2] The application runs fine in release build, the access violation is in debug build.
Pixel.To.Life
[science.medical.imaging: http://groups.google.com/group/medicalimagingscience]
Linking with static dcmdata/ofst lib from a .Net application
Moderator: Moderator Team
Linking with static dcmdata/ofst lib from a .Net application
Last edited by Prash on Mon, 2011-02-14, 18:20, edited 3 times in total.
Re: using static dcmtk libs with managed forms application
Ok I found the fix. Apparently this is a known issue in VC2005 express
edition, so when using a static constructor in unmanaged code with a
managed forms application, the entry point of the managed app should
not be 'main'. Here is the link to the angelic description (I tried,
works like magic:-)
http://www.thescripts.com/forum/thread642179.html
Another reason I dont like Microsoft - they market more than they
perfect their products!
Thanks all anyways,
Pixel.to.life.
edition, so when using a static constructor in unmanaged code with a
managed forms application, the entry point of the managed app should
not be 'main'. Here is the link to the angelic description (I tried,
works like magic:-)
http://www.thescripts.com/forum/thread642179.html
Another reason I dont like Microsoft - they market more than they
perfect their products!
Thanks all anyways,
Pixel.to.life.
Last edited by Prash on Mon, 2011-02-14, 18:20, edited 3 times in total.
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi Prash,
thanks for sharing your solution
Did you already take a look at the clearcanvas project who built a NET wrapper around parts of DCMTK? I am not sure whether this is of any interest for you but maybe it could be interesting for the future.
Regards,
Michael
thanks for sharing your solution
Did you already take a look at the clearcanvas project who built a NET wrapper around parts of DCMTK? I am not sure whether this is of any interest for you but maybe it could be interesting for the future.
Regards,
Michael
Who is online
Users browsing this forum: Ahrefs [Bot], Baidu [Spider], Google [Bot] and 0 guests