Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

Mixed mode exe (forms application)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Ginsburg - 05 Jul 2006 16:29 GMT
I have created a .NET C++ forms application. I would like to call some
functions in an unmanged class that provides access to some underlying API
functions. The underlying class needs access to ATL (for example the CString
class). I created the app, added an unmanaged C++ class, changed the
compiler from /clr:pure to /clr. I added includes in stdafx.h . The system
compiles but fails during runtime  (an assert fires on
_CrtIsValidHeapPointer  ) apparently due to the fact that the ATL statics
are not initialized. According to
http://msdn2.microsoft.com/en-us/library/ms173267.aspx, I no longer need to
deal with _vcclrit.h or its idosynchrocises to make this work. However it
does not appear to work correctly.

Interestingly, if I create a Win32 project, and add a managed form to it,
all appears fine..

Any and all insight, pointers or help is appreciated

-Robert
Jochen Kalmbach [MVP] - 05 Jul 2006 22:07 GMT
Hi Robert!
> I have created a .NET C++ forms application. I would like to call some
> functions in an unmanged class that provides access to some underlying API
[quoted text clipped - 7 lines]
> deal with _vcclrit.h or its idosynchrocises to make this work. However it
> does not appear to work correctly.

Does the following help you?
http://msdn2.microsoft.com/ms235211

Signature

Greetings
  Jochen

   My blog about Win32 and .NET
   http://blog.kalmbachnet.de/

Robert Ginsburg - 06 Jul 2006 12:22 GMT
No, that link focuses on adding CLR support to unmanaged applications. Which
I am successfully able to do. What I want to do is the reverse, I want to
add an unmanaged class, with access to ATL, to a .NET forms application.

> Hi Robert!
>> I have created a .NET C++ forms application. I would like to call some
[quoted text clipped - 11 lines]
> Does the following help you?
> http://msdn2.microsoft.com/ms235211
Jochen Kalmbach [MVP] - 06 Jul 2006 12:36 GMT
Hi Robert!
> No, that link focuses on adding CLR support to unmanaged applications. Which
> I am successfully able to do. What I want to do is the reverse, I want to
> add an unmanaged class, with access to ATL, to a .NET forms application.

It should be the same settings, regardless in which direction you "move"...

Do you have a small project which can be used to repor this problem?

Greetings
  Jochen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.