home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!wupost!darwin.sura.net!jvnc.net!newserver.jvnc.net!newsserver.technet.sg!nuscc!papaya!suresh
- From: suresh@papaya.iss.nus.sg (Suresh Thennarangam - Research Scholar)
- Subject: C++/X11/Motif Problems
- Message-ID: <1993Jan6.130916.9037@nuscc.nus.sg>
- Originator: suresh@papaya
- Sender: usenet@nuscc.nus.sg
- Organization: Institute Of Systems Science, NUS
- Date: Wed, 6 Jan 1993 13:09:16 GMT
- Lines: 86
-
- Hi netters:
-
- I am using cfront3.0 on SGI, X11R4 and Motif 1.1.
-
- I have these problems .. I hope someone can help.
-
- Briefly:
-
-
-
- 1> Here is an excerpt from the file /usr/include/X11/ShellP.h
-
- ================================
- typedef struct {
- char *class; // -----> note this
- XrmClass xrm_class;
- int argc;
- char **argv;
- } ApplicationShellPart;
- ================================
-
- Note that there is a member declared by the name class which is a
- C++ reserved word. The X11 and Motif release header files contain
- several such code fragments which will prevent code from passing thro'
- the C++ compiler. Does anyone know any solution or workaround for this
- problem ?
-
- 2>
- I have some source lines in my program like so,
-
- #include <Mrm/MrmAppl.h>
- :
- :
- :
- if ( MrmRegisterClass ( MrmwcUnknown,
- "GlxMDraw" ,
- "GlxCreateMDraw",
- GlxCreateMDraw,
- glxMDrawWidgetClass ) != MrmSUCCESS )
- XtAppError( app_context, "Can't register GL widget.");
- ----------------------
-
- If I compile this source the compiler says:
-
- ==============================================================
-
- "iface2.c", line 89: error: bad argument 4 type for
- MrmRegisterClass(): Widget( *)(Widget, char *, ArgList, Cardinal)
- ( Widget(*)() expected)
- *** Error code 1
-
- ==============================================================
-
- How do I resolve this problem ? Do I just cast away like so ?
-
- if ( MrmRegisterClass ( MrmwcUnknown,
- "GlxMDraw" ,
- "GlxCreateMDraw",
- ((Widget(*)()) GlxCreateMDraw ,
- GlxCreateMDraw,
- glxMDrawWidgetClass ) != MrmSUCCESS )
- XtAppError( app_context, "Can't register GL widget.");
-
-
- This compiles but I'm not sure if it will cause any other problems.
-
- In fact several functions accept pointer to function arguments
- and the compiler always insists on checking if the argument types
- match .. isn't this rather unneccessary ?
-
-
- Thanks,
-
- __
- (_ / / o_ o o |_
- __)/(_( __) (_(_ /_)| )_
-
-
- ***************************************************************************
- * Suresh Thennarangam * EMail: suresh@iss.nus.sg(Internet) *
- * Research Scholar * ISSST@NUSVM.BITNET *
- * Institute Of Systems Science * Tel: (065) 772 2588. *
- * National University Of Singapore * Facs.: (065) 778 2571 *
- * Heng Mui Keng Terrace * Telex: ISSNUS RS 39988 *
- * Singapore 0511. * *
- ***************************************************************************
-