How do I set up for vs2013 Community MFC

88 views
Skip to first unread message

majho...@gmail.com

unread,
May 24, 2015, 8:25:13 AM5/24/15
to glg...@googlegroups.com
I am having trouble just getting started.
I set up a new solution using MFC, add glgclass.cpp and glgclass.h and I get about 50 unresolved link errors.
Is there a step by step guide somewhere that shows you how to start a project and integrate glg drawings into your app?

glg_devel

unread,
May 26, 2015, 2:19:06 PM5/26/15
to glg...@googlegroups.com
In the MFC Project Property Pages, add the GLG library "GlgEx.lib" to Linker, Input, Additional Dependencies:
<glg_dir>\lib\GlgEx.lib,  where <glg_dir>  is your GLG installation directory.

GlgEx.lib is the GLG Extended C/C++ API, which is the highest version of all GLG APIs provided.
Other available GLG APIs for C/C++ are: Standard API (Glg.lib) and Intermediate API (GlgIn.lib).
If you intend to obtain a commercial GLG license and want to determine which GLG API to purchase,
you can try linking with <glg_dir>\lib\Glg.lib or <glg_dir>\lib\GlgIn.lib. In this case,
add the following preprocessor definition to C/C++, Preprocessor, Preprocessor Definitions in the
project Property Pages:

a) If linking with Glg.lib (Standard API), add GLG_CPP_STANDARD_API preprocessor definition.
b) If linking with GlgIn.lib (Intermediate  API), add GLG_CPP_INTERMEDIATE_API preprocessor definition.

GLG MFC examples and projects may be found in <glg_dir>\examples_mfc directory.
GLG animation example uses GLG Standard API.
GLG SCADAViewer example uses GLG Intermediate API.
GLG ObjectPosition example uses GLG Extended API.

More information regarding the GLG C/C++ libraries may be found in the GLG Programming Reference Manual,
section "Using C/C++ version of the Toolkit", "GLG C++ Bindings" (page 171):
http://www.genlogic.com/doc_html/glgcpp.html#1013656


 

majho...@gmail.com

unread,
May 26, 2015, 8:16:07 PM5/26/15
to glg...@googlegroups.com
Thanks, I was able to get the the program to compile but no luck in getting a drawing to display.
I notice in the MFC examples, windows shows the drawings as GLG drawings
but when I try to save a GLG drawing, it doesn't save as a GLG drawing, it just shows "file". Is there a setting I am missing?

Is there any sample code for a simple dialog app that shows how to display a simple control/drawing ?

glg_devel

unread,
May 27, 2015, 3:36:08 PM5/27/15
to glg...@googlegroups.com
An example of the GLG MFC DialogApp project may be downloaded from:

 http://www.genlogic.com/examples/MFC_DialogApp.zip

The example uses a GLG custom control to display and animate a
GLG drawing "controls.g" which was created in the GLG Builder.
The control is instantiated as GlgControlsPanel class derived from
GlgControlC and added to the dialog.

The example doesn't handle save/load operations, but rather loads a
drawing using a file name specified in the code, i.e. "controls.g".




zapp...@gmail.com

unread,
May 28, 2015, 10:46:28 PM5/28/15
to glg...@googlegroups.com
OK so I downloaded your example, its not a dialog app, its an SDI app. I was able to get it running but the graphics don't display properly (check the attached file.

I still have had no luck trying to run a dialog app using the GlgControlC class.

Here is the code I have tried placed in the OnInitDialog() method:

    GlgControlC Tanks;

    Tanks.Create("controls.g", this);

    // Callbacks must be enabled before setting up the hierarchy or drawing.
    Tanks.EnableCallback(GLG_INPUT_CB);
    Tanks.EnableCallback(GLG_SELECT_CB);

    // Display the GLG drawing in a control.
 
    Tanks.InitialDraw();

It compiles OK but when I run the code, the control doesn't display, just the dialog box empty. Does the dialog box need a control like a picture control or something that the glg control can display in?


Example.png

glg_devel

unread,
May 29, 2015, 12:44:35 PM5/29/15
to glg...@googlegroups.com
In the example we provided, OpenGL renderer is used to render the the graphics
by default. If your machine uses a graphics card other than NVIDIA or ATI,
the OpenGL renderer will not work correctly due to the buggy OpenGL drivers
installed on systems with other graphics cards (such as Intel). This will
cause the graphics not being displayed correctly.

You can disable OpenGL render and use GDI render instead, using one of the
following methods:

1) Defined GLG_OPENGL_MODE environment variable on your desktop and
set it to False.

2) Use command line -glg-disable-opengl argument for your executable.

It is also possible to disable OpenGL in the application code.

Regarding the problem you are experiencing in your program, you need to
set size of the GLG control, as shown in the example we provided.
Reply all
Reply to author
Forward
0 new messages