Re: Why MFC doesn't like /vmg?
- From: may <may@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Sep 2005 10:50:03 -0700
Hi KMA,
Thanks. but then How I can fix the problem? Is it true that I have to put
#pragma pointers_to_members best_case.
in front of every MFC code?
May
"KMA" wrote:
>
> IIRC
>
> /vmb, /vmg (Representation Method)
> Home | Overview | How Do I | Compiler Options
>
> These options select the method that the compiler uses to represent pointers
> to class members. You can also use #pragma pointers_to_members in your code
> to specify a pointer representation.
>
> Command Line Project Settings Description
> /vmb Best-Case Always Use this option if you always define a class
> before you declare a pointer to a member of the class.
> /vmg General-Purpose Always Use this option if you need to declare a
> pointer to a member of a class before defining the class. This need can
> arise if you define members in two different classes that reference each
> other. For such mutually referencing classes, one class must be referenced
> before it is defined. You must then choose an inheritance model from the
> General Purpose Representation drop-down list box.
>
>
> To find these options in the development environment, click Settings on the
> Project menu. Then click the C/C++ tab, and click C++ Language in the
> Category box. See the choices under Representation Method.
>
> If you define a class before declaring a pointer to a member of the class
> using the Best-Case Always option, the compiler knows the kind of
> inheritance used by the class when it encounters the declaration of the
> pointer. Thus, it can use the smallest possible representation of a pointer
> and create the smallest amount of code required to operate on the pointer
> for each kind of inheritance.
>
> With the Best-Case Always option, the compiler issues an error if it
> encounters the pointer declaration before the class definition. In this
> case, you must either reorganize your code or use the General-Purpose Always
> (/vmg) option. You can also use the pointers_to_members pragma or define the
> class using the __single_inheritance, __multiple_inheritance, or
> __virtual_inheritance keyword. These keywords allow control of the code
> created on a per-class basis.
>
> For the Best-Case Always option, the corresponding argument to #pragma
> pointers_to_members is best_case.
>
> For information on the use of the __single_inheritance,
> __multiple_inheritance, and __virtual_inheritance keywords, see Inheritance
> Keywords in the Language Quick Reference.
>
>
>
>
>
> "Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
> news:71ggi15hktgkfute99a1e4tr5u3m3p38ge@xxxxxxxxxx
> > I don't suppose you would bother to tell what /vmq means? I'm not heavily
> into doing
> > decryption as an exercise, and my MSDN is on a different machine than my
> email machine.
> > joe
> > On Tue, 13 Sep 2005 15:30:02 -0700, may <may@xxxxxxxxxxxxxxxxxxxxxxxxx>
> wrote:
> >
> > >I have some sytemc code require to set the /vmg compiler option, and
> found
> > >out it will make the MFC application work improperly. Then I setup some
> very
> > >simple test : just use the helloworld MFC application (from MFC samples),
> > >test it with and without the /vmg option, and found out the about window
> stop
> > >working if /vmg is set. But a similar simeple test with win32 application
> > >works fine.
> > >
> > >My question is why the MFC doesn't like this /vmg option? How can make it
> > >work with my MFC applications?
> > >
> > >Thanks,
> > >May
> > Joseph M. Newcomer [MVP]
> > email: newcomer@xxxxxxxxxxxx
> > Web: http://www.flounder.com
> > MVP Tips: http://www.flounder.com/mvp_tips.htm
>
>
>
.
- References:
- Re: Why MFC doesn't like /vmg?
- From: Joseph M . Newcomer
- Re: Why MFC doesn't like /vmg?
- From: KMA
- Re: Why MFC doesn't like /vmg?
- Prev by Date: Re: Output a string to the default printer
- Next by Date: Re: CMutex::Lock is re-entrant?
- Previous by thread: Re: Why MFC doesn't like /vmg?
- Next by thread: Re: Why MFC doesn't like /vmg?
- Index(es):
Relevant Pages
|