YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
Download Evaluation
Pricing & Purchase?
E-XD++Visual C++/ MFC Products
Overview
Features Tour 
Electronic Form Solution
Visualization & HMI Solution
Power system HMI Solution
CAD Drawing and Printing Solution

Bar code labeling Solution
Workflow Solution

Coal industry HMI Solution
Instrumentation Gauge Solution

Report Printing Solution
Graphical modeling Solution
GIS mapping solution

Visio graphics solution
Industrial control SCADA &HMI Solution
BPM business process Solution

Industrial monitoring Solution
Flowchart and diagramming Solution
Organization Diagram Solution

Graphic editor Source Code
UML drawing editor Source Code
Map Diagramming Solution

Architectural Graphic Drawing Solution
Request Evaluation
Purchase
VX++ Cross-Platform C/C++
Overview
Download
Purchase
ActiveX COM Products
Overview
Download
Purchase
Technical Support
  General Q & A
Discussion Board
Contact Us

Links

Get Ready to Unleash the Power of UCanCode .NET



Knowledge Base

Our technical notes are small texts explaining the solution of the most commonly found problems. Although not as big as some our competitors pages, we tried to include as much information as possible. This page is updated constantly and new tips are added. Come back often and check if your problem is already solved .

From common programming problems to complete sample programs, entries are constantly being updated and expanded by our Technical Support team. Information can be accessed by entry number, product type, or by indexed search. No login process is required to access this information.


These articles answer the frequently ucancode.neted questions and problems reported by our users. Generally, the article 'expires' in the next version (problem is corrected), but you just might find the analogy with your current situation. 

XD++ Library Knowledge Base

Q: I installed the E-XD++ Library V18.0, but I cannot find any of the DLL or library files, where can I find them?

A:You need to build all of the E-XD++ Library DLL and library files. Open the E-XD++ Library  workspace from the start menu -> XD++ Library. You should generate both release and debug builds for your desired platform.
E-XDENG1700.dll
E-XDENG1700.lib
DLL - Win32 Debug
E-XDENGD1700.dll
E-XDENGD1700.lib
DLL - Win32 Release
E-XDStatic1700D.lib Static Library - Win32 Debug
E-XDStatic1700lib Static Library - Win32 Release

Note:
If you are using the evaluation version of the library, only the dStatic Library - Win32 Debug sx version of the DLL is supplied including associated lib files. You will not need to build the library.

Q: What do I need to do to begin using the XD++ Library, and how do I set up VisualStudio®?

A: In VisualStudio you will need to make the following changes, assuming that you have installed the XD++ Library in the directory "C:\Program Files\UCanCode.Net Software Inc\E-XD++ Visualization Enterprise Suite". If you installed the XD++ into another location you will need to adjust this accordingly:
  1. Select "Tools" then "Options" then "Directories" tab.
  2. Set "Show directories for:" to "Include files".
  3. Add "C:\Program Files\UCanCode Software\E-XD++ Visualization Enterprise Suite\Fo\Include" to the list.
  4. Set "Show directories for:" to "Library files".
  5. Add "C:\Program Files\UCanCode Software\E-XD++ Visualization Enterprise Suite\Lib" to the list.
  6. Set "Show directories for:" to "Source files".
  7. Add "C:\Program Files\UCanCode Software\E-XD++ Visualization Enterprise Suite\Fo\source" to the list.
  8. Add "C:\Program Files\UCanCode Software\E-XD++ Visualization Enterprise Suite\Fo\Include" to the list.
  9.  Now, add the XD++ resources from the View menu and select Resource Includes.

    In the Read-only symbol directives box, type the following code on the last line:
    #include "fores.h" 

    In the Compile-time directives box, type the following line:

    #include "fores.rc" 

    Click the OK button. A warning dialog appears. Click the OK button again.

    After you download and installed the library, to get started, open the XD++ Library project workspace (see above question, if you are using the evaluation version this does not apply to you). Depending on your platform, build both the debug and release versions of the library. After you have done this, open the AppWizard workspace and build the project. Now you can run the wizard the same way you normally would create a new MFC project using the standard AppWizard. Also, it may be a good idea to build the examples as well so you can see how your project may look. You can do this by opening the examples workspace.

Q: What do I use my program support Ole Drag and drop? 

A: To let your program support Ole Drag and Drop,you need add the following code at the CWinApp's InitInstance.Example:

BOOL CCustomSampleApp::InitInstance()

AfxOleInit();

Q: What do I need to do to set up my existing application to use the XD++ Library?

A: To get started to used the XD++ with your existing application, make you have included the following line in your stdafx.h file, make sure that the .\lib, .\bin and .\include directories where the XD++ was installed have been added to DevStudio's directories list:
#include <FO.H> // XD++ Library MFC extensions

Q:How can I build an application after installing the XD++ Library?

A:The instructions below explain how to build XD++ library using the Visual C++ project workspaces shipped with product.

1.Start Visual C++ Developer Studio.
2.Open the XD++ project from the …\FO\ directory.

3.From the Build menu in Visual Studio, select Set Active Configuration  and  then choose the build configuration that suits  your needs. By default, Debug is selected.

4.From the Build menu in Visual Studio, select Rebuild all to build the selected library.

5.Now you can try to build your own applications then.

Q:How to show all shapes?

A:Call the following code:

void CCustShapeView::OnObjectShowall() 
{
// TODO: Add your command handler code here
if(GetCurrentModel()->GetFormObjects()->GetCount() <= 0)
{
return;
}

CFODrawShapeList lstUpdate;

CFODrawShape *pShape = NULL;
POSITION pos = GetCurrentModel()->GetFormObjects()->GetHeadPosition();
while(pos != NULL)
{
pShape = GetCurrentModel()->GetFormObjects()->GetNext(pos);
if(pShape != NULL)
{
if(!pShape->IsVisible())
{
pShape->SetVisible(TRUE);
lstUpdate.AddTail(pShape);
}
}
}
UpdateShapes(&lstUpdate);
}

Q:How to hide selected shapes?

A:Call the following code:

void CCustShapeView::OnObjectHideall() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() <= 0)
{
return;
}

CFODrawShapeList lstUpdate;

CFODrawShape *pShape = NULL;
POSITION pos = m_listSelectComp.GetHeadPosition();
while(pos != NULL)
{
pShape = m_listSelectComp.GetNext(pos);
if(pShape != NULL)
{
if(pShape->IsVisible())
{
pShape->SetVisible(FALSE);
lstUpdate.AddTail(pShape);
}
}
}
m_listSelectComp.RemoveAll();
UpdateShapes(&lstUpdate);
}

Q:How to zoom to 200%?

A:Call the following code:

void CCustShapeView::OnObjectZoom300() 
{
// TODO: Add your command handler code here
SetZoomScale(200);
Invalidate(FALSE);
UpdateWindow();
}

Q:How to change grid color?

A:Call the following code:

void CCustShapeView::OnObjectGridColor() 
{
// TODO: Add your command handler code here
COLORREF crColor = GetCurrentModel()->GetGridColor();
CColorDialog dlg(crColor, CC_FULLOPEN | CC_ANYCOLOR);
if(dlg.DoModal() == IDOK)
{
GetCurrentModel()->SetGridColor(dlg.GetColor());
Invalidate(FALSE);
}
}

Q:How to change the selected shapes's caption?

A:Call the following code:

void CCustShapeView::OnObjectCaption() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() == 1)
{
CFODrawShape *pShape = GetCurrentSelectShape();
if(pShape != NULL)
{
CFOCompProperties *prop = (CFOCompProperties *)pShape->FindProperty(FO_DEFAULT_PROP_ID);
CFOCompProperties *propNew = (CFOCompProperties *)prop->Copy();
CEditCaptionDlg dlg;
dlg.m_strCaption = prop->GetObjectCaption();
if(dlg.DoModal() == IDOK)
{
propNew->SetObjectCaption(dlg.m_strCaption);
DoPropChangeAction(pShape,propNew);

GetCurrentModel()->SetModifiedFlag();
}

}
return;
}
else if(m_listSelectComp.GetCount() >1)
{
CEditCaptionDlg dlg;
if(dlg.DoModal() == IDOK)
{
CFOMultiCompsPropAction* pAction = new CFOMultiCompsPropAction(GetCurrentModel());

CFODrawShape *pShape = NULL;
POSITION pos = m_listSelectComp.GetHeadPosition();
while(pos != NULL)
{
pShape = (CFODrawShape *)m_listSelectComp.GetNext(pos);

CFOCompProperties *prop = (CFOCompProperties *)pShape->FindProperty(FO_DEFAULT_PROP_ID);
CFOCompProperties *propNew = (CFOCompProperties *)prop->Copy();
propNew->SetObjectCaption(dlg.m_strCaption);
pAction->AddShape(pShape,propNew);
}
GetCurrentModel()->Do(pAction);
GetCurrentModel()->SetModifiedFlag();
}
}
}

Q:How to rotate the selected shapes with 90 degree?

A:Call the following code:

void CCustShapeView::OnObjectRotate90() 
{
// TODO: Add your command handler code here
int nCount = 0;
CFODrawShapeList lstRotate;
CFODrawShape* pShape;
POSITION pos = m_listSelectComp.GetHeadPosition();
while(pos != NULL)
{
pShape = m_listSelectComp.GetNext(pos);
if(pShape != NULL && !pShape->IsLock())
{
if(pShape->IsOver4ResizeHandles() && 
(!pShape->IsKindOf(RUNTIME_CLASS(CFOLinkShape))) &&
(!pShape->IsKindOf(RUNTIME_CLASS(CFOStaticShape))))
{
lstRotate.AddTail(pShape);
nCount ++;
}
}
}

if(nCount > 0)
{
DoCompRotateAction(&lstRotate,900);
}
}

Q:How to reduce selected shapes's to 0.5?

A:Call the following code:

void CCustShapeView::OnObjectReduce() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() <= 0)
{
return;
}
DoCompSizeAction(&m_listSelectComp,0.5f, 0.5f, BeCenter);
}

Q:How to enlarge shapes's to 2.0?

A:Call the following code:

void CCustShapeView::OnObjectEnlarge() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() <= 0)
{
return;
}
DoCompSizeAction(&m_listSelectComp,2.0f, 2.0f, BeCenter);
}

Q:How to add start end arrow?

A:Call the following code:

void CCustShapeView::OnObjectLeftarrow() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() <= 0)
{
return;
}

CFODrawShapeList lstUpdate;

CFODrawShape *pShape = NULL;
POSITION pos = m_listSelectComp.GetHeadPosition();
while(pos != NULL)
{
pShape = m_listSelectComp.GetNext(pos);
if(pShape != NULL)
{
if(pShape->IsKindOf(RUNTIME_CLASS(CFOLineShape)))
{
CFOLineShape *pLine = (CFOLineShape *)pShape;
int nArrowType = 3;
pLine->SetStartArrowType(nArrowType);
lstUpdate.AddTail(pLine); 
}
}
}
UpdateShapes(&lstUpdate);
}

Q:How to add end line arrow?

A:Call the following code:

void CCustShapeView::OnObjectRightarrow() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() <= 0)
{
return;
}

CFODrawShapeList lstUpdate;

CFODrawShape *pShape = NULL;
POSITION pos = m_listSelectComp.GetHeadPosition();
while(pos != NULL)
{
pShape = m_listSelectComp.GetNext(pos);
if(pShape != NULL)
{
if(pShape->IsKindOf(RUNTIME_CLASS(CFOLineShape)))
{
CFOLineShape *pLine = (CFOLineShape *)pShape;
int nArrowType = 3;
pLine->SetEndArrowType(nArrowType);
lstUpdate.AddTail(pLine); 
}
}
}
UpdateShapes(&lstUpdate);
}

Q:How to move shapes to point(100,200)?

A:Call the following code:

void CCustShapeView::OnObjectMoveTo() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() > 0)
{
CRect rcPos = GetCompsMaxRect(&m_listSelectComp);
CPoint ptMove;
ptMove = CPoint(100 - rcPos.TopLeft().x,200 - rcPos.TopLeft().y);
DoMoveAction(&m_listSelectComp, ptMove.x, ptMove.y);
}

Q:How to move shapes down 50 pixels?

A:Call the following code:

void CCustShapeView::OnObjectMoveY50() 
{
// TODO: Add your command handler code here
if(m_listSelectComp.GetCount() >0)
{
int nMove = 50;
DoMoveAction(&m_listSelectComp, 0, nMove);
}

Q:How to create composite shape?

A:Call the following code:

void CCustShapeView::OnCreateComposite() 
{
// TODO: Add your command handler code here
CRect rc = CRect(50,50,250,300);
CFOCompositeShape *pReturn = new CFOCompositeShape;
pReturn->AddRef();
pReturn->Create(rc,"");

CFOStaticShape *pText = pReturn->AddText("My home","My Home",CRect(0,0,200,50));
pText->SetBrushType(1);
pText->SetBkColor(RGB(255,0,0));
pText->SetPenStyle(PS_SOLID);
pText->SetNullPen(FALSE);

CFOStaticShape *pText1 = pReturn->AddText("Father","Steven",CRect(0,50,200,100));
pText1->SetBrushType(1);
pText1->SetBkColor(RGB(255,255,255));
pText1->SetPenStyle(PS_SOLID);
pText1->SetNullPen(FALSE);

CFOStaticShape *pText2 = pReturn->AddText("Mather","Cindy",CRect(0,100,200,150));
pText2->SetBrushType(1);
pText2->SetBkColor(RGB(255,255,255));
pText2->SetPenStyle(PS_SOLID);
pText2->SetNullPen(FALSE);

CFOStaticShape *pText3 = pReturn->AddText("Brother0","John",CRect(0,150,200,200));
pText3->SetBrushType(1);
pText3->SetBkColor(RGB(255,255,255));
pText3->SetPenStyle(PS_SOLID);
pText3->SetNullPen(FALSE);

CFOStaticShape *pText4 = pReturn->AddText("Brother1","Jack",CRect(0,200,200,250));
pText4->SetBrushType(1);
pText4->SetBkColor(RGB(255,255,255));
pText4->SetPenStyle(PS_SOLID);
pText4->SetNullPen(FALSE);


pReturn->RemoveAllPorts();
pReturn->CreateDefaultPort(0.5,0.5);
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
GetCurrentModel()->InsertShape(pReturn);
pReturn->Release();
pReturn = NULL;
}

Q:How to creat e a line shape?

A:Call the following code:

CArray<CPoint,CPoint> ptArray;
ptArray.Add(CPoint(20,20));
ptArray.Add(CPoint(120,90));
ptArray.Add(CPoint(200,40));

CFOLineShape *pReturn = new CFOLineShape;
pReturn->AddRef();
pReturn->Create(&ptArray);
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:How to create a polygon shape?

A:Call the following code:

CArray<CPoint,CPoint> ptArray;
ptArray.Add(CPoint(20,20));
ptArray.Add(CPoint(120,90));
ptArray.Add(CPoint(200,40));

CFOPolygonShape *pReturn = new CFOPolygonShape;
pReturn->AddRef();
pReturn->Create(&ptArray);
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:How to create a rectangle shape?

A:Call the following code:

CRect rcTest;
rcTest = CRect(100,100,200,250);
CFORectShape *pReturn = new CFORectShape;
pReturn->AddRef();
pReturn->Create(rcTest,"");
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
pReturn->RemoveAllPorts();
pReturn->CreateDefaultPort(0.5,0.5);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:How to create a ellipse shape?

A:Call the following code:

CRect rcTest;
rcTest = CRect(100,100,200,125);
CFOEllipseShape *pReturn = new CFOEllipseShape;
pReturn->AddRef();
pReturn->Create(rcTest,"");
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
pReturn->RemoveAllPorts();
pReturn->CreateDefaultPort(0.5,0.5);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:How to create a emf shape?

A:Call the following code:

CRect rcTest;
rcTest = CRect(100,100,200,125);
CFOWMFShape *pReturn = new CFOWMFShape;
pReturn->AddRef();
pReturn->Create(rcTest,"");
pReturn->LoadImage("c:\\temp\\Arrows1.wmf");
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
pReturn->RemoveAllPorts();
pReturn->CreateDefaultPort(1,0.5);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:How to create text shape?

A:Call the following code:

CRect rcTest;
rcTest = CRect(100,100,200,125);
CFOStaticShape *pReturn = new CFOStaticShape;
pReturn->AddRef();
pReturn->Create(rcTest,"");
CString strCaption = GetCurrentModel()->GetUniqueCaption(pReturn->GetType());
CString strName = GetCurrentModel()->GetUniqueName(pReturn->GetType());
pReturn->SetObjectCaption(strCaption);
pReturn->SetObjectName(strName);
pReturn->RemoveAllPorts();
pReturn->CreateDefaultPort(1,0.5);
GetCurrentModel()->GetFormObjects()->AddTail(pReturn);
pReturn->Release();

InvalidateShape(pReturn);

Q:We have been delivering about your XD++ product and it suits to our needs, but we have one critical requirement for our project that we haven t seen in it. Our software has to be able to save its drawing, or export it, to a dxf file format, so we would like to know how can we get this functionality in your product or besides it.

A:For default serialization you need to override Serialize() in all of the objects, the view ob, the frame ob and the view/doc to work use this format. For export/import you could just add a SerializeDXF method to all of your objects. Either way is easy, but somewhat laborious since there are a fair number of properties to convert.

We are not working on the .dxf filters. It would be great to have them as a sample though if you wouldn't mind contributing them. That way we would probably maintain them if the XD++-object properties every change

Q:Can I offer component based on a XD++ source code as a competitor product?

A:No. We offer source code at a very special price.You cann't make a competitor product using any party of our source code.

Q:What is one developer license?

A:Developer license means the software can be installed on one developer's computer.
What does Team 4 and Team 8 stand for?
Team 4 stands for 4 developer licenses e.g. the software can be installed on 4 developer machines. Team 8 stands for 8 developer licenses.

Q:Is the XD++ UNICODE?

A:Yes, XD++5.0 and all of its standard classes fully support UNICODE.

Q:What's version of VC XD++ support?

A:XD++ can be compiled on VC++ versions starting from version 4 all the way to the upcoming VS.Net (with MFC 7) without any problems

Q:Can U give me a function where I'll pass CFOImageShape pointer and it'll make a list of all links only. Make sure that I won't use GetFormObject() function.

A:Try the following code:

CFODrawShapeList listAllLink;
 if(pObj->IsKindOf(RUNTIME_CLASS(CFOImageShape)))
 {
  CFOImageShape *pComp = (CFOImageShape *)pObj;
  POSITION posport = pComp->GetCompList()->GetHeadPosition();
  CFOPortShape *pPort = NULL;
  while(posport != NULL)
  {
   pPort = (CFOPortShape* )pComp->GetCompList()->GetNext(posport);
   CFODrawShapeList *pLinkList = pPort->GetCompList();
   POSITION poslist = pLinkList->GetHeadPosition();
   while(poslist != NULL)
   {
    listAllLink.AddTail((CFOLinkShape *)pLinkList->GetNext(poslist));
   }
  }
 }

Q:Want to prevent resizing of an image but make sure I don't want to lock
the control otherwise I won't be able to move the image. Is there any
function thought which I can enable and disable the control/image resizing?

A:You can use the following method to do it:
void LockWidthAndHeight(const BOOL bLock) it defined in class CFODrawShape

Q:  Is XD++ MFC  Library available for Visual Basic® or other ActiveX container?

A: Yes

Q: What is "Design Mode"?

A: By default,XD++ include "Design Mode" and "Runtime Mode",with "Design Mode" you can edit or change the shapes on the canvas,for "Runtime Mode",you can only HitTest shapes on the canvas.You can call the following method to change it:

GetCurrentModel()->SetDesignMode(TRUE/FALSE);

Q:  HOW TO: Get IntelliSense to work with Visual C++ 6.0

A: IntelliSense stores information about each project into a .ncb file.  This file is an inventory of classes and member data that are contained in the project's file structure.  The problem is that IntelliSense does not recognize class members outside of the immediate project, and therefore will not display information on these objects ( see INFO: Limitations of IntelliSense in Visual C++ 6.0 for more details ).

As a work around for this problem, you can include the XD++ MFC Library into your project.  This will update your project's .ncb file adding the IntelliSense information for the Library.  To do this, follow these steps:

  1. Open your project and select the File tab.
  2. Right click on the Workspace item in the tree display ( usually the first item ).
  3. Choose Insert New Project and browse to the directory where the XD++ project .dsp file is located.
  4. Select either FO.dsp or FOStatic.dsp and choose OK.
  5. Press the Save All button.

Now your project's .ncb file has been updated and you should see IntelliSense active for the XD++ objects.  You can now highlight the XD++ project in the File tree and remove it from your project workspace.

If any questions,fell free contact us.

 

Copyright ?1998-2024 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net