\CLR Mixed mode compilation woes!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Iv compiled my current C++ project as \clr as i want to start putting
in some specific C++\CLI code to serialize my MFC objects to .NET
equivalents.
The program crashes on startup, something to do with the stack frame
being corrupted.

My first concern is the program has ballooned in terms of the size of
the executable image.
When it attempts to run it fails and some report about stack frame
corruption.

Iv noticed any C files have to be converted to C++.

The program links to a DLL and Libs that have been compiled as C.

Is this a problem when compiling a program as /CLR that then links with
C libs etc and on startup loads C Dlls?

How can i specifically instruct the compiler to only compiler specific
functions/methods as managed(mixed mode) and to leave everything else
as native?
Is this possible?

Thanks in advance.

.



Relevant Pages

  • RE: Anyone looked at the canary stack protection in Win2k3?
    ... I wrote up a simple analysis of Microsoft's /GS compiler option for Visual C++ ... Compiler Security Optimizations ... In Chapter 1 you saw the simplest possible buffer overflow, ... checks to see that it is still alive when a vulnerable stack frame returns. ...
    (Vuln-Dev)
  • Re: Pure speed
    ... solution and rework it to be iterative you have much more information available than a compiler typically has. ... Compiler tail call optimization generally works by noting that there is no `further work' to be done when calling out to another function, so rather than waiting for the caller to return before discarding the stack frame, the stack frame is discarded immediately. ... need be (see Steele: Debunking the Expensive Procedure Call Myth or, Procedure Call Implementations Considered Harmful or, LAMDBA: The ...
    (comp.lang.lisp)
  • Re: Where are returned values stored?
    ... So the compiler might be forced to copy the return ... arrangement for non Ada calling conventions. ... obviously can't just re-extend the stack frame after ... place" concept) probably has the called function Foo, ...
    (comp.lang.ada)
  • Re: Startup code
    ... >That is still startup code, ... I could always use the start up code supplied by the compiler ... >written my startup code in a combination of C and assembler. ... On some MCU some people modify this start up assembler. ...
    (comp.arch.embedded)
  • Stack frames & static predecessors
    ... The variable is stored in the stack frame of the outer function ... only have a pointer to the stack frame of its dynamic predecessor. ... to the recursion bar cannot 'know' where the stack frame of foo ... This used to be a standard topic in compiler texts, ...
    (comp.compilers)