Communicating between a window and a user object – PB Docs 150
Communicating between a window and a user object Often you need to exchange information between a window and a visual user object in the window. Consider these situations: You have a set of buttons in a custom user object. Each of the buttons acts upon a file that is listed in a SingleLineEdit control in…
Creating a new menu – PB Docs 150
Creating a new menu You build a new menu by creating a new Menu object and then working on it in the Menu painter. To create a new menu: Click the New button in the PowerBar. On the PB Object tab page, select Menu. Click OK. The Menu painter opens and displays the Tree Menu…
Processing PowerBuilder messages in C++ – PB Docs 150
Processing PowerBuilder messages in C++ You can open a PowerBuilder window from a C++ application or from an extension, but to make sure that events triggered in the window or control are processed, you need to make sure that the C++ application processes PowerBuilder messages. The IPB_Session ProcessPBMessage function lets you do this. Each time…
Call the PowerBuilder function – PB Docs 150
Call the PowerBuilder function Before you call the function, you must supply the integers to be multiplied. For the sake of simplicity, the following code sets them directly in the PBCallInfo structure.
|
1 |
   // Set IN arguments. The prototype of the function is<br>   // integer f_mult(integer arg1, integer arg2)<br>   ci.pArgs-> GetAt(0)->SetInt(123);<br>   ci.pArgs-> GetAt(1)->SetInt(45); |
Finally call the function, wrapping it in a try-catch statement to handle any runtime errors:
|
1 2 |
   // Call the function<br>   try<br>   {<br>      session->InvokeObjectFunction(pbobj, mid, &ci);<br> <br>      // Was PB exception thrown?<br>      if (session->HasExceptionThrown())<br>      {<br>         // Handle PB exception<br>         session->ClearException();<br>      }<br>   }<br>   catch (...)<br>   {<br>      // Handle C++ exception<br>   }<br> <br>   // Get the return value and print it to the console<br>   pbint ret = ci.returnValue->GetInt();<br>   fprintf(stderr, "The product of 123 and 45 is %i ",<br>      ret); |
Document get from Powerbuilder help Thank…
PBNI Types and Return Values – PB Docs 150
PBNI Types and Return Values About this chapter This chapter contains information about the datatypes, enumerated types, and error return values used by the PowerBuilder Native Interface. Contents Topic PowerBuilder to PBNI datatype mappings Types for access to PowerBuilder data PBNI enumerated types Error return values Document get from Powerbuilder help Thank you for watching.
InvokeRemoteMethod – PB Docs 150
IPBX_Marshaler interface: InvokeRemoteMethod method Description Used in PowerBuilder marshaler native classes to call remote methods. Syntax
|
1 |
InvokeRemoteMethod(IPB_Session *<span>session</span>, pbproxyobject <span>obj</span>, LPCTSTR <span>methodDesc</span>, PBCallInfo *<span>ci</span>) |
Argument Description session This IPB session obj The proxy object for the remote object methodDesc An arbitrary string stored as an alias name for the remote method in the proxy, for example: function int foo(int a) alias “This…
Where the wizards are installed – PB Docs 150
Where the wizards are installed When you install PowerBuilder, the setup program installs four directories into the PowerBuilder 15.0SDKPBNIwizards directory: VCProjects 7.0 VCProjects 7.1 VCProjects 8.0 VCWizards If Microsoft Visual Studio is already installed on your computer, the setup program also installs the appropriate files into your Visual Studio installation. Table A-1: Where wizard files…
Step 5: Export methods to create class instances – PB Docs 150
Step 5: Export methods to create class instances PowerBuilder creates nonvisual and visual class instances differently: For visual classes, the instance is created when the window or visual control in which the class is used is opened. See “Creating visual class instances”. For nonvisual classes, the instance is created when the PowerBuilder CREATE statement is…
IsFieldArray – PB Docs 150
IPB_Session interface: IsFieldArray method Description Returns true if the field of the specified object is an array; otherwise it returns false. Syntax
|
1 |
IsFieldArray(pbclass <span>cls</span>, pbfield <span>fid</span>) |
Argument Description cls A valid class handle for the class whose field is to be accessed fid The field ID of the specified object Return Values pbboolean. Examples This code tests whether…
Processing events sent to the parent of the window – PB Docs 150
Processing events sent to the parent of the window Some Windows messages, such as WM_COMMAND and WM_NOTIFY, are sent to the parent of an object and not to the object itself. Such messages cannot be caught in the visual extension’s window procedure. The PBVM calls the GetEventID method to process these messages, as follows: If…