[gme-users] Converting to managed code with BON2

Cong Zhang czhanga at gmail.com
Mon Nov 7 11:08:17 CST 2005


Hi, Zoltan,
  The following is your post on issue of converting unmanaged code
skeleton to managed. I am wondering if this issue has been  addressed
by GME 5 released in September.
  I am using BON2 to access models and because of user requirements,
we need to use windows forms. With BON, there was no problem after I
used the same approach as you mentioned in your post. However, with
BON2, I got the following compiling errors:

c:\program files\gme\sdk\bon\exceptions.cpp(161) : error C2349:
'BON::Exception::Exception' cannot be compiled using /clr: 'functions
containing both copy constructed arguments and inline asm are not
supported'; compile without /clr

thanks
Cong Zhang

PhD Candidate
EE-Systems, University of Southern California





Hi,

Currently components generated by CreateNewComponent.exe (interpreters,
plug-ins, add-ons) are plain unmanaged C++ code skeletons. That's why
you can't insert managed code, or new items from the Form designer  into
such a dll, unless you convert the whole project to compile with the
/clr flag, thus becoming managed.
This conversion process consists of the following settings in the
project properties dialog box:
1.in the General section: set 'Use Managed Extensions' to Yes (in
VStudio 2003)
2.in the C/C++ section/ Code Generation Subsection: Basic Runtime Checks
must be changed from 'BOTH (/RTC1)' to 'Default'

For BON2 components this is not enogh, needs some additional work, in
spite of MicroSoft stating it is 'It Just Works' technology.
For BON (version 1) components and for RAW Com components this migration
is feasible, so you can use the Windows Forms controls after that.
(Important to note: to implement a Raw Com interpreter the user needs
some COM technology knowledge.)

If you do NOT want to stick with managed code, you can benefit by
accessing your models with BON2 (instead of old-fashioned, slow BON or
difficult COM), but you'd have to use classes in MFC like CDialog for
implementing Dialog boxes (instead of Forms).

Br, Zoltan Molnar


More information about the gme-users mailing list