Visual Studio 2008
(1)
Visual Studio 2005
(1)
Windows 7
(1)
IMSFlexGrid
(1)
CMSFlexGrid
(1)
GetTitleFont
(1)
GetGridFont
(1)
CRowCursor
(1)

COleFont wrapper not generated when adding FlexGrid activeX control

Asked By Marc
07-Feb-10 06:21 AM
Hello.

Using Visual C++6, when we add the Microsoft FlexGrid activeX control to our
project, we have the 4 wrapper classes :
- CMSFlexGrid
- CRowCursor
- COleFont
- CPicture

but using Visual Studio 2005, there is only the wrapper for the IMSFlexGrid
interface.
How to automatically generate the missing classes COleFont, CPicture... ?

With many thanks.

Marc

"Marc" <no_spam@free.fr> ha scritto nel messaggio[...

Giovanni Dicanio replied to Marc
07-Feb-10 10:52 AM
[...]

I am not sure, but this may be a bug of VS2005.

You may want to generate the wrappers using VC6, and then import code in a
VS2005 project.

In addition, you may want to consider other quality (and freely available)
C++/MFC grid components:

http://www.codeproject.com/KB/miscctrl/gridctrl.aspx
http://www.codeproject.com/KB/MFC/UltimateGrid.aspx

Giovanni

This is not only for the flexgrid control, but for all controls.

Marc replied to Giovanni Dicanio
08-Feb-10 03:37 AM
This is not only for the flexgrid control, but for all controls.
If you have another VS version (for example Visual Studio 2008), could you
please try to add an wrapper class for such an activeX control (which may
integrate wrapper classes for COleFont or CPicture) and tell me if Visual
does its job correctly.

Marc

"Marc" <no_spam@free.

Giovanni Dicanio replied to Marc
08-Feb-10 04:04 AM
Unfortunately, I cannot find the MS Flex Grid control installed on my system
(the corresponding ActiveX is not shown in the list of registered controls,
and I cannot find the msflexgrid.ocx file either).

With VS2008 SP1 on a Win7 x64 PC, I tried creating a wrapper class for the
Microsoft Calendar Control, and I noted that a couple of methods are exposed
by the wrapper:

void put_DayFont(LPDISPATCH newValue)
LPDISPATCH get_DayFont()

Do you expect COleFont to be exposed directly?
It seems to me that late-binding IDispatch interface is used instead...

Unfortunately, I do not have VS6 installed on this machine so I cannot verify
and compare VS2008 result vs. VC6 result.

Giovanni
With my Calendar Control 8.0 (C:\windows\system32\mscal.
Marc replied to Giovanni Dicanio
08-Feb-10 06:05 AM
With my Calendar Control 8.0 (C:\windows\system32\mscal.ocx) :

VC++6 generates 2 wrapper classes CCalendar and COleFont
Opening the calendar.h generated file, I can see :
COleFont GetDayFont();
COleFont GetGridFont();
COleFont GetTitleFont();

VS2005 SP1 generates only one class CCalendar
Opening the calendar.h generated file, I can see :
LPDISPATCH get_DayFont()
LPDISPATCH get_GridFont()
LPDISPATCH get_TitleFont()

So, it seems that you have the same problem as me.
Is there a way to automatically create these COleFont or CPicture (or ...)
wrapper classes ?
I am not supposed to use VC++6 anymore !

Marc
"Marc" <no_spam@free.fr> ha scritto nel messaggioIndeed.
Giovanni Dicanio replied to Marc
08-Feb-10 06:28 AM
Indeed.


Not anything I am aware of.


The first thing that comes in my mind is to use VC6 to create the wrapper,
and import VC6 generated source code in VS2005/2008.

Giovanni
That's what I do, and it works great.
David Ching replied to Giovanni Dicanio
08-Feb-10 08:51 PM
That's what I do, and it works great.  By "import", it just means add the
generated files to the VS2005/2008 project.

-- David
"Marc" <no_spam@free.
Giovanni Dicanio replied to Marc
23-Feb-10 10:06 AM
I opened a bug on Connect for that:

https://connect.microsoft.com/VisualStudio/feedback/details/534458/visual-studio-mfc-wizard-does-not-create-proper-wrapper-classes-to-activexs

Giovanni
Post Question To EggHeadCafe