This Month
June 2005
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Login
User name:
Password:
Remember me 
Powered by BlogHarbor
BlogHarbor Badge
View Article  Debugging Plex Java application with Eclipse
One of the main problem you will face pretty soon after creating application in the Java variant is Debugging.

It is pretty easy to do the debugging of the Plex generated application with in Eclipse by following this simple steps:

1. Install and setup the Plex to use the Ant based process as defined in this thread on symposium. Make sure you have this up and running.
2. Install eclipse
3. If you do not know how to use eclipse, please spend some time to get used to this new IDE, you need not know how to code in java, just follow one of the tutorial for debugging. You just need to know how to use the debugger more than anything else.
4. Unzip the attachment PlexDebugger.zip. You have to modify the files .project and .classpath
5. Modify the values of "C:/TAXCALC/Server/ApplicationPackage" to your own server class folder and "C:/TAXCALC/src" to your source folder in these files.
6. Once the changes are made, import the project into eclipse.
5. Add external jar files, to the project. You need to add your jdbc jar files and obrun.jar file to the list. You also need to add your own jar file, if any to the list.
6. Start the dispatcher with in eclipse, in debug mode. (screen shots 4-6)
7. Once the dispatcher is running in debug mode you should be able to debug your class files with in eclipse.

8 Attachments
View Article  Browse For a Folder- Dialog (WinC)
{
    BROWSEINFO bi = { 0 };
//    bi.lpszTitle = _T("Browse for Folder");
    LPITEMIDLIST pidl = SHBrowseForFolder ( &bi );

    &(1:) = ""; //Initialize the folder name to blank
    &(2:) = "ERR"; //Expect the worst.


    if ( pidl != 0 )
    {
        // get the name of the folder
        TCHAR path[MAX_PATH];
        if ( SHGetPathFromIDList ( pidl, path ) )
        {
            //CString str = path;
            //&(1:) = str;
            &(1:) = path;
            &(2:) = "";
        }

        // free memory used
        IMalloc * imalloc = 0;
        if ( SUCCEEDED( SHGetMalloc ( &imalloc )) )
        {
            imalloc->Free ( pidl );
            imalloc->Release ( );
        }
    }
}

Parameters:
1.Directory
2.ReturningStatus
View Article  Browse For a File - Dialog (WinC)
{
//This code will open a browse window, and allow you get the file selected.
//Dialog will display csv, txt and all in a list
//Default selected values is csv
//Check for Returning Status before processing the file name
    &(2:) = "ERR"; //Expect the worst.
    &(1:) = ""; //Initialize the file name to blank
    char szFilters[]="Comma Delimited Files(*.csv)|*.csv|Text Files(*.txt)|*.txt|All Files (*.*)|*.*||";
    CFileDialog fileDlg (TRUE, "File Import", "*.csv",OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, ObPanelAPI::GetPanelCWndByName("*Current"));
    if( fileDlg.DoModal ()==IDOK )
    {
      &(1:) = fileDlg.GetPathName();
      &(2:) = "";
    }
}

Parameters:
1. FileName
2.Returning Status
View Article  Displaying a Create A File Dialog - WinC
{
//This code will open a Save AS window, and allows you to create a file.
//Dialog will display csv, txt and all in a list
//Default selected values is csv
//Check for Returning Status before processing the file name
    &(2:) = "ERR"; //Expect the worst.
    &(1:) = ""; //Initialize the file name to blank
    char szFilters[]="Comma Delimited Files(*.csv)|*.csv|Text Files(*.txt)|*.txt|All Files (*.*)|*.*||";
    CFileDialog fileDlg (FALSE, "Save as CSV", "*.csv",OFN_HIDEREADONLY | OFN_PATHMUSTEXIST |
      OFN_OVERWRITEPROMPT | OFN_CREATEPROMPT, szFilters, ObPanelAPI::GetPanelCWndByName("*Current"));
    if( fileDlg.DoModal ()==IDOK )
    {
      &(1:) = fileDlg.GetPathName();
      &(2:) = "";
    }
}

Parameters:
1. FileName
2. Returning Status
View Article  Adding Help to the application
We have inherited a pattern where the following API was used to call the help file in each function. The API is called from a subroutine.

#include "htmlhelp.h"
{
    HtmlHelp(NULL, &(1:), HH_HELP_CONTEXT, &(2:));
}

Where &(1:) is Help file name and
&(2:) is the surrogate of the panel function.

Sadly, the pattern was using a hard coded file name to pass  the first parameter. After almost 1/2 way through the project and after getting the Techinical Writer we realized the issue and it became a expensive issue. We had to fix the pattern and regenerate ALL the panels.

QA is not going to be happy about this and neither are the programmers as they need to re-test every thing (not exartly, when did we started testing ).

If the pattern was written in a way to call A function and then call the help with in the function, then we should not have had this issue.

Solution:
Create a WinC External function and then call this External Function from all the Client functions with Panels. This way if we ever need to make any changes to the way help file works, we just need to work on one function.

Following code is used for calling the help file:

#include "htmlhelp.h"
{
    HWND HWndApp  = ObPanelAPI::GetPanelHandleByName("*Active");
    HtmlHelp(HWndApp, &(1:), HH_HELP_CONTEXT, &(2:));
}

GetPanelHandleByName is used to show the help file until the active panel is open.

View Article  Is Alpha?
Following C++ source code will check if the string has only the characters between A-Z.
Is Alpha? Parameter FLD String
                Parameter FLD YesNo

{
 CString input = &(1:);
 &(2:) = "Y"; 
 char charVal;
 for(int i = 0;i< input.GetLength();i++)
 {
     charVal = input.GetAt(i);
     if((charVal < 'A') || (charVal > 'Z'))
     {
              &(2:) = "N";
             break;
     }
 }
}
View Article  Is Numeric?
Following code can be used to find if a string is numeric

Is Numeric?     Parameter FLD VaryCharacter
                        Parameter FLD  YesNo

{
 &(2:) = "Y"; 
 const char* psz = (LPCTSTR)&(1:);
    for (int i = 0; psz[i]; i++)
    {
        if (!isdigit(psz[i]))
        {
              &(2:) = "N";
             break;
        }
    }
}
View Article  Displaying ISO Date in Messages and Listbox
When you try to display the ISODate in Message file or Listbox it displays in the native format. This may be a problem when the user wants to see it. Following source can be used to display the ISODate in "Short Date Format" of your PC settings :

FormatDateType parameter FLD ISODate

                            parameter FLD ISODate Text

                            script engine   VBScript

source code:

&(2:) = FormatDateTime(&(1:))



View Article  Why my checkbox will not trigger when I press hot key?
Make sure you do NOT have another field with same hot key (posibbly it is hidden?)
View Article  Plex Tit bits (Meta) - Getting the length of a field
+Define Field: MyField
+Define Field: FIELDS/+Field
+Set Value Field: FIELDS/+Field, Field: MyField
For Defined Value Field: FIELDS/Field
+Set Value Field: FIELDS/+Field, FLD length NBR
+Name Defined Field: FIELDS/Field, Work
View Article  Using ImagXpress in Plex
1. Create a Header file (PlexImage.h), to use the ImagXpress files:

//Place this header file, in your include path list of Plex.
//All
the header file (.h files) and the cpp files should be in your include
path or Gen Path
//The cool thing about the import and namespace is,
we need not have a library ,as it uses the COM object to do the stuff.

#import
using namespace IMAGXPR6Lib;
#include
"ImagXpressEvents.h" //Image Express file
#include
   //Used for opening the printer dialog

#include "ix_open.cpp"   //Image Express file



2. Modify the IX_OPEN.CPP to add your serial number. (Parameter to the
lpfnDllFunc1 function)



3. In your Plex Model add the following VC++ Source Code. 



HINSTANCE hDLL = LoadLibraryImagXpr6DLL();  // Registered ImagXpress ATL
COM control.  see IX_OPEN.cpp



4. Call the Source code in the Initialize Subroutine within the Panel
Function where you are calling the ImagXpress ActiveX control. 



5. This should allow the ImagXpress not to display the "evaluation
version" dialog and properly register the ActiveX control.


Photo of the Day
Search
Search all blogs