NewDecimal – PB Docs 2017
NewDecimal Description Allocates resources for a new decimal data object. Syntax
1 |
NewDecimal( ) |
Return value pbdec or null on failure. Examples
1 2 3 4 5 6 7 |
if (ci->pArgs->GetAt(i)->IsNull()) { pArguments[i].dec_val=Session->NewDecimal(); Session->SetDecimal(pArguments[i].dec_val,"1.0"); } else pArguments[i].dec_val = ci->pArgs->GetAt(i)->GetDecimal(); |
See also GetDecimalString ReleaseDecimalString SetDecimal Document get from Powerbuilder help Thank you for watching.
Step 3: Declare native classes and global functions – PB Docs 2017
Step 3: Declare native classes and global functions For each native class that the nonvisual extension supports, declare an ANSI C++ class that inherits from IPBX_NonVisualObject, which is the ancestor class for all nonvisual PowerBuilder native classes. The declaration of the class can be placed in a header file, and it must include Invoke and Destroy…
Add<type>Argument – PB Docs 2017
Add<type>Argument Description Adds an argument of a specific type in a variable argument PowerBuilder call. Syntax
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
AddArrayArgument ( PBCallInfo *ci, pbblob value, pbboolean IsNull ) AddBlobArgument ( PBCallInfo *ci, pbblob value, pbboolean IsNull ) AddBoolArgument ( PBCallInfo *ci, pbboolean value, pbboolean IsNull ) AddByteArgument ( PBCallInfo *ci, pbbyte value, pbboolean IsNull ) AddCharArgument ( PBCallInfo *ci, pbchar value, pbboolean IsNull ) AddDateArgument ( PBCallInfo *ci, pbdate value, pbboolean IsNull ) AddDateTimeArgument ( PBCallInfo *ci, pbdatetime value, pbboolean IsNull ) AddDecArgument ( PBCallInfo *ci, pbdec value, pbboolean IsNull ) AddDoubleArgument ( PBCallInfo *ci, pbdouble value, pbboolean IsNull ) AddIntArgument ( PBCallInfo *ci, pbint value, pbboolean IsNull ) AddLongArgument ( PBCallInfo *ci, pblong value, pbboolean IsNull ) AddLongLongArgument ( PBCallInfo *ci, pblonglong value, pbboolean IsNull ) AddObjectArgument ( PBCallInfo *ci, pbobject value, pbboolean IsNull ) AddPBStringArgument ( PBCallInfo *ci, pbstring value, pbboolean IsNull ) AddRealArgument ( PBCallInfo *ci, pbreal value, pbboolean IsNull ) AddStringArgument ( PBCallInfo *ci, LPCTSTR value, pbboolean IsNull ) AddTimeArgument ( PBCallInfo *ci, pbtime value, pbboolean IsNull ) AddUintArgument ( PBCallInfo *ci, pbuint value, pbboolean IsNull ) AddUlongArgument ( PBCallInfo *ci, pbulong value, pbboolean IsNull ) |
Argument Description ci The PBCallInfo to which the argument is to be added. value The value to be added to the arguments array. IsNull Indicates whether the argument is null. The default is false. Return value PBXRESULT. PBX_OK…
GetNumOfFields – PB Docs 2017
GetNumOfFields Description Returns the number of fields in the specified class. Syntax
1 |
GetNumOfFields(pbclass cls) |
Argument Description cls A valid class handle for the class whose field is to be accessed Return value pbulong. Examples This code gets the numbers of fields in the class clz:
1 2 |
pbclass clz = d_session->GetClass(d_pbobj); pbulong nf = d_session->GetNumOfFields(clz); |
See also GetFieldID Get<type>Field IsFieldArray IsFieldNull IsFieldObject SetFieldToNull Set<type>Field Document…
Error return values – PB Docs 2017
Error return values The following table shows the PBXRESULT return values and error codes returned from PBNI methods. Value of PBXResult Error code PBX_OK 0 PBX_SUCCESS 0 PBX_FAIL -1 PBX_E_NO_REGISTER_FUNCTION -1 PBX_E_REGISTRATION_FAILED -2 PBX_E_BUILD_GROUP_FAILED -3 PBX_E_INVALID_ARGUMENT -4 PBX_E_INVOKE_METHOD_INACCESSABLE -5 PBX_E_INVOKE_WRONG_NUM_ARGS -6 PBX_E_INVOKE_REFARG_ERROR -7 PBX_E_INVOKE_METHOD_AMBIGUOUS -8 PBX_E_INVOKE_FAILURE -9 PBX_E_MISMATCHED_DATA_TYPE -10 PBX_E_OUTOF_MEMORY -11 PBX_E_GET_PBVM_FAILED -12 PBX_E_NO_SUCH_CLASS -13…
GetRowCount – PB Docs 2017
GetRowCount Description Obtains the number of rows. Syntax
1 |
GetRowCount ( ) |
Return value Unsigned long. Examples This statement stores the number of rows in *numRows:
1 |
*numRows = d_rsAccessor->GetRowCount(); |
See also CreateResultSet GetColumnCount GetColumnMetaData GetItemData Document get from Powerbuilder help Thank you for watching.
Step 6: Build a PBX – PB Docs 2017
Step 6: Build a PBX Using your C++ development tool or the command line, build a PBX from your C++ classes. When you compile and link the C++ code, verify the following: The include directory for the PBNI SDK, typically PowerBuilder 17.0SDKPBNIinclude, must be in your include path. If you use any helper classes, make sure…
FindClassByClassID – PB Docs 2017
FindClassByClassID Description Searches for a class with a given name and a given ID. Syntax
1 |
FindClass(pbgroup group, pbint classID) |
Argument Description group The handle of the group in which the class resides classID The class name in lowercase Return value pbclass or null on failure. Usage This method searches for a PowerBuilder class with the given name and…
Using an event name with return type and arguments – PB Docs 2017
Using an event name with return type and arguments The following description uses the first syntax. The class has two events, onclick and ondoubleclick:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
PBXEXPORT LPCTSTR PBXCALL PBX_GetDescription() { Â Â Â static const TCHAR desc[] = { Â Â Â Â Â Â "class visualext from userobject " Â Â Â Â Â Â "event int onclick() " Â Â Â Â Â Â "event int ondoubleclick() " Â Â Â Â Â Â "subroutine setcolor(int r, int g, int b) " Â Â Â Â Â Â "subroutine settext(string txt) " Â Â Â Â Â Â "end class " Â Â Â }; return desc; } |
Capturing messages and mouse clicks The code in the extension captures the Windows messages that cause the window to be drawn, as well as mouse clicks and double clicks:
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
LRESULT CALLBACK CVisualExt::WindowProc(                                    HWND hwnd,                                    UINT uMsg,                                    WPARAM wParam,                                    LPARAM lParam                                    ) {    CVisualExt* ext = (CVisualExt*)::GetWindowLong(hwnd,       GWL_USERDATA);    switch(uMsg) {    case WM_CREATE:       return 0;    case WM_SIZE:       return 0;    case WM_COMMAND:       return 0;    case WM_PAINT: {       PAINTSTRUCT ps;       HDC hdc = BeginPaint(hwnd, &ps);       RECT rc;       GetClientRect(hwnd, &rc);       LOGBRUSH lb;       lb.lbStyle = BS_SOLID;  // Get color using the visual class's GetColor method       lb.lbColor = ext->GetColor();       HBRUSH hbrush = CreateBrushIndirect(&lb);       HBRUSH hbrOld = (HBRUSH)SelectObject(hdc,          hbrush);       Rectangle(hdc, rc.left, rc.top, rc.right-rc.left,          rc.bottom-rc.top);       SelectObject(hdc, hbrOld);       DeleteObject(hbrush); // Get text using the visual class's GetText method       DrawText(hdc, ext->GetText(),          ext->GetTextLength(), &rc,       DT_CENTER|DT_VCENTER|DT_SINGLELINE);       EndPaint(hwnd, &ps);       }       return 0; // Trigger event scripts in the PowerBuilder application    case WM_LBUTTONUP:       ext->TriggerEvent("onclick");       break;    case WM_LBUTTONDBLCLK:       ext->TriggerEvent("ondoubleclick");       break;    }    return DefWindowProc(hwnd, uMsg, wParam, lParam); } |
…
Installing ORCA – PB Docs 2017
Installing ORCA ORCA is available to code partners, tool vendors, and customers who develop companion products and tools that manipulate and manage objects in PowerBuilder libraries for use with PowerBuilder. To run ORCA programs To run programs that use ORCA, you need the ORCA DLL (called PBORC170.DLL in PowerBuilder 2017 R3). When you install PowerBuilder,…