前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于PowerBuilder的搜索

PowerBuilder 9.0 Code Samples - Sybase Inc MERCI DE PRENDRE NOTE: Notre site web utilise des cookies pour aider à améliorer votre expérience de navigation et nous fournir des informations afin de mieux comprendre votre usage de notre site. Cliquez ici pour voir les cookies que nous utilisons. Cliquez ici pour apprendre à supprimer et bloquer ces cookies (même si cela signifie que certaines parties de notre site Web ne fonctionneront pas). Si vous ne changez pas vos paramètres de cookies, nous comprenons que vous êtes satisfait de la valeur par défaut et que vous acceptez notre utilisation des cookies, comme décrit. Cocher la case pour fermer cette pop-up. switch to mobile view France [Modifier] Argentine Allemagne Australie Autriche Belgique Brésil Canada Chine Corée Danemark émirats Arabes Unis Espagne Etats-Unis Philippines Finlande France Hong Kong Hongrie Malaisie Inde Italie Japon Mexique Norvège Nouvelle-Zélande Pays-Bas Pologne Singapour Portugal Royaume-Uni République tchèque République slovaque Russie Afrique du Sud Suède Suisse Taiwan Turquie Contactez-nous / Mon Sybase / Produits | Support | Partner | Boutique | Search for in all of Sybase.com voir tous les résultats de la recherche Société Histoire Equipe dirigeante Carrière Implantations Actualité Presse Evénements Etudes d'analystes Cas clients Gestion de bases de données SAP Sybase Adaptive Server Enterprise SAP Sybase SQL Anywhere Advantage Database Server SAP Sybase Replication Server Analytique SAP Sybase IQ RAP - The Trading Edition Complex Event Processing Entreprise mobile SAP Afaria Sybase Unwired Platform SAP Sybase SQL Anywhere Messagerie mobile Sybase SMS 365 Sybase IPX 365 Sybase GRX 365 Sybase Operator Analytics 365 Commerce mobile Sybase mBanking 365 Sybase mPayments 365 Sybase mRemittance 365 Modélisation et développement PowerBuilder PowerAMC TOUS LES PRODUITS DE A à Z » Téléchargements Centre de téléchargement EBFs/Maintenance Téléchargements Assistance technique Assistance --> Cas résolus Gestion des cas Documentation du Produit Documents techniques Forums Développeurs/SDN Services Formation Conseil Services en mode « managé » Nos partenaires Rencontrer nos partenaires Rechercher un partenaire Partenaires mobiles et sans fil Distributeurs et revendeurs Business Solutions Alliance Program --> Ce qu’il faut savoir Présentation du programme de partenariat Devenir partenaire Portail des partenaires Ressources produit Fiches techniques Démos Livres blancs Podcasts Émissions Web sur demande Bibliothèque Cas clients Rapports analytiques Articles à la une Lettres d’information Centre d’inscription en ligne Guides Verticaux Médias sociaux Blogs Réseaux de médias sociaux Vidéos Gestion des informations Bases de données en mémoire Traitement de transactions en ligne Mise en cluster sur disque partagé Cloud Bases de données embarquées Gestion des données mobiles Analyse des informations Aide à la décision en temps réel Reporting Analyses prédictives Data Warehousing Market Data Analytics Mobilité des informations Services pour l’entreprise Services opérateurs Services de mCommerce Managed Mobility Gestion des appareils mobiles Plate-forme d’applications mobiles Écosystème d’entreprise mobile Industries Services financiers Secteur public Santé Telecommunications Services de mCommerce Sybase mBanking 365 Sybase mPayments 365 Sybase mTopUp 365 Sybase mRemittance 365 Services pour l’entreprise Services marketing mobiles Gamme de solutions CRM mobiles Transmission de SMS et MMS Solutions mPayment Création de rapports et analyse Sybase Push 365 Services opérateur Sybase SMS 365 Sybase MMX 365 Sybase GRX 365 Sybase IPX 365 Sybase Operator Analytics 365 Solutions mPayment PowerBuilder 9.0 Code Samples Oscilloscope Flags Weather Report PING LED XMLEditor EnumFont PB2Java EJB Client for WebLogic Server Oscilloscope Description The following PB 9 sample demonstrates the usage of a PBNI visual extension, simulating a simple cathode ray tube (CRT) of an oscilloscope that draws a sinus wave. The oscilloscope is basically a graph-displaying device - it draws a graph of an electrical signal and is widely being used in electrical engineering. Features PBNI – Visual Extension Setting up Your Environment PB 9 beta 4 (build 4510) or higher VC++ 6.0 (only if the visual extension workspace needs to be opened) Detailed Steps Unzip into a folder eg. c:\oscilloscope Open the workspace oscilloscope.pbw in the \debug directory with PB 9 and add the library path of the oscilloscope target to point to the visual extension oscilloscope.pbd Run the app using the running man Choose the Amplitude and frequency of the sinus wave that is displayed using the trackbars Choose the color of the sinus wave Choose to switch grid on and off Set a text into the CRT Optional: Open the VC++ 6.0 workspace oscilloscope.dsw and look at the main.cpp to see how it is implemented.. For more information The best source for information will be the PowerBuilder® Native Interface Programmer’s Guide and Reference. Also look for another simple Visual Extension sample called Flags. Click here to download - Oscilloscope Flags Description The following PB 9 sample demonstrates the usage of a PBNI visual extension, drawing different flags into the viewable region of the control. Features PBNI – Visual Extension Setting up Your Environment PB 9 beta 4 (build 4510) or higher VC++ 6.0 (only if the visual extension workspace needs to be opened) Detailed Steps Unzip into a folder eg. c:\flags Open the workspace flags.pbw in the \debug directory with PB 9 and add the library path of the flags target to point to the visual extension flagext.pbd Run the app using the running man Choose the different flags to be drawn using the radio button on the right side Optional: Open the VC++ 6.0 workspace flags.dsw and look at the main.cpp to see how it is implemented. The main code for the flags is implemented in the functions DrawFlagX(HDC hdc, RECT rc). For more information The best source for information will be the PowerBuilder® Native Interface Programmer’s Guide and Reference. Also look for another simple Visual Extension sample called Oscilloscope. Click here to download - Flags Weather Report Description This PowerBuilder® 9 sample demonstrates a simple Web services client application. The Web service presents reports on weather at airports and airfields that have a registered International Civil Aviation Organization (ICAO) number. The input to all methods is the ICAO designation, for example EIDW for Dublin Airport, Ireland, or KJFK for JFK Airport in New York, USA. The weather service data is provided by the U.S. Government's National Weather Service; this data is freely available and reusable, but cannot be copyrighted in its raw form. Features Web Services – PowerBuilder Web Services Client Save as PDF (using XSL-FO) Setting up Your Environment PowerBuilder 9 beta 4 (build 4510) or higher Connection to the internet Detailed Steps Unzip into a folder, for example: C:\weatherreport. Open the workspace with PB 9 beta 4 (build 4510) and change the library path of the weather target to point to your pbsoapclient90.pbd. This file is usually installed in the Sybase\Shared\PowerBuilder directory. Run the application using the running man. Select an airport from the list. Click Get Report. A report for the selected airport displays. (Optional) Click Save As PDF. The report is saved to a PDF file called weatherreport.pdf in the current directory. (Please refer to Notes below.) Notes Some small GIF files are provided with the workspace to indicate weather conditions, such as partly cloudy.gif and sunny.gif. GIF files are currently not available for all weather conditions. The workspace includes a second version of the DataWindow used to display the weather report that does not use GIF files (d_report_without_gif). In beta 4, DataWindow objects that contain external GIF files cannot be saved to PDF (CR 298510). To test the Save As PDF button, modify the w_report window to use d_report_without_gif instead of d_report. This CR will be fixed in PowerBuilder 9 GA. For more information For more info see http://www.capescience.com/webservices/airportweather/index.shtml The WSDL file: http://live.capescience.com/wsdl/AirportWeather.wsdl The best source for information will be the PowerBuilder Building a Web Service Client section of the Documentation. Click here to download - Weather Report PING Description The following PowerBuilder® 9 sample demonstrates a PBNI nonvisual extension that wraps CPing, a freeware MFC class to encapsulate the PING protocol. Features PBNI – Nonvisual Extension Setting up Your Environment PowerBuilder® 9 GA Visual C++ 6.0 (only if the extension workspace needs to be opened) Detailed Steps Unzip into a folder, for example c:\pbni_ping. Open the workspace pb_ping.pbw in the \debug directory with PowerBuilder 9 and add the nonvisual extension pbni_mfc_ping.pbd to the library path. Run the application using the running man. You can type in the dropdown ListBox a Hostname or IP address of your choice or you can simply choose from the the dropdown ListBox a network ip address or ftp server and press the Button Ping1. You should then get the reply from the host, including the time needed if successful, or a failure message and code otherwise. Optional: Open the Visual C++ 6.0 workspace pbni_ping_mfc.dsw and look at the pbni_ping.cpp starting in section CPING_USE_WINSOCK2 to see how the extension calls the MFC class Cping. The main code for the Cping class is in ping.cpp. For more information The best source for information will be the PowerBuilder® Native Interface Programmer’s Guide and Reference. Also look for other PBNI extension samples, eg. Visual extension called Oscilloscope and Flags. For information about the freeware MFC Cping class please look at http://www.codeproject.com/internet/cping.asp Click here to download - PING LED Description This PowerBuilder® 9 sample demonstrates a PBNI visual extension that displays an LED control. The Control is MFC based and wraps the freeware Cled class from http://www.codeguru.com/controls/StaticLed.shtml . The CLed class is a static control for a simple LED control and is derived from the CStatic class. Using a single bitmap of an LED array, the BitBlt function is used to index through the bitmap for the appropriate LED. Features PBNI – Visual extension Setting up Your Environment PowerBuilder 9 GA Visual C++ 6.0 (if you want to open the visual extension workspace) Detailed Steps Unzip into a folder, for example c:\led. Open the workspace pbni_led.pbw in the \debug directory with PowerBuilder 9 and add pbni_led.pbd to the library path of the pbni_led target. Run the application using the running man. If you run the debug version of the DLL, you get “debug assertion failed” error messages from Visual C++. You can ignore these messages (use the ignore option on the dialog box). After the window opens, select different colors and modes using the radio buttons to invoke the visual class's SetLed function. Clicking the Ping button invokes the visual class's Ping function. Selecting Help>About demonstrates a small Led animation. Optional: Open the Visual C++ 6.0 workspace pbni_led.dsw. Look at led.cpp to see how the base class for the LED is implemented. Look at the source and header files for pbni_led_Ctrl to see how the LED control is implemented as a visual extension. The pbni_led source and header files provide initialization routines. For more information The best source for information is the PowerBuilder Native Interface Programmer’s Guide and Reference. Also look for other simple visual extension samples called Flags and Oscilloscope. Click here to download - LED XMLEditor Description This PowerBuilder 9 sample demonstrates the usage of the PowerBuilder Document Object Model (PBDOM). The sample is a simple XML editor that lets you load an XML document into PBDOM, edit the PBDOM document using a PowerBuilder TreeView control, and save the modified document as a new XML document. Features PBDOM – PowerBuilder implementation of the Document Object Model. Setting up Your Environment PowerBuilder 9. Detailed Steps Unzip into a folder, for example c:\xmleditor. Open the workspace xmleditor.pbw with PowerBuilder 9. Add the file pbdom90.pbd to the application library search path. This file is located in the Shared/PowerBuilder directory. Connect to the EAS demo database using the EAS Demo DB V9 profile. Click the Run icon to run the application. You can load XML from a file or a DataStore or create it from scratch. To load from a file: 1. Specify the XML document to load in the Load XML File box, or click the Browse button to locate an XML file. An XML file called dept.xml is provided with this sample. 2. Click the Load XML button. This loads the XML file into PBDOM and into the TreeView control. To load from a DataStore: 1. Select the DataStore and XML Export/Import template to use in the Load XML DataStore group box. Two DataStore objects with templates are provided with this sample. 2. Click the Load XML button. This loads the XML file into PBDOM and into the TreeView control. To create from scratch: Click the Create New button. This creates a new document with a "root" element and loads it into the TreeView control. Double click the document in the TreeView control to expand it. Right click an item in the TreeView control to open a pop-up menu that you can use to edit the document. After editing the document, enter the name of the target XML file in the Save As XML File box or browse to locate the target XML file. Click the Save As button to save the changed XML to the target file. To validate an XML file, enter the name of the XML file in the Validate XML File box or browse to locate the XML file, then click the Validate button. This validates the XML file and displays the result in the MultiLineEdit box. For more information For information on PBDOM, refer to Chapter 13, "Using PowerBuilder XML Services," in Application Techniques, and Chapters 4 to 18 in the PowerBuilder Extension Reference or the online Help. For more information about W3C DOM, go to the W3C Document Object Model Web site at http://www.w3.org/DOM/. For more information about JDOM, go to the JDOM Web site at http://www.jdom.org. Click here to download - XMLEditor EnumFont Description The following PowerBuilder® 9 sample demonstrates a PBNI nonvisual extension that uses a callback function. The extension declares two nonvisual classes: FontCallback and FontEnumerator, both inheriting from nonvisualobject, which is a PowerBuilder system class. FontCallback declares only one event: onNewFont. FontEnumerator declares two functions: enumScreenFonts and enumPrinterFonts. The C++ class CFontCallback is for implementing the FontCallback class. The Invoke() function of CFontCallback simply return PBX_OK, meaning the fontcallback class is just an interface. CFontEnumerator implements FontEnumerator class. The Invoke() function calls the EnumScreenFonts and EnumPrinterFonts functions according to the method ID. The EnumScreenFonts and EnumPrinterFonts functions call Win32 API function EnumFontFamilies and pass the EnumFontProc function as the callback function. When the EnumFontProc function is called by Windows, it triggers a PowerBuilder event with the font name as a parameter. The PBX_CreateNonVisualObject function creates a CFontCallback or CFontEnumerator object according to the className passed into the function. Features PBNI – nonvisual Extension Setting up Your Environment PowerBuilder® 9 GA Visual C++ 6.0 (only if the extension workspace needs to be opened) Detailed Steps Unzip into a folder, for example c:\enumfonts. Open the workspace font.pbw in the \test directory with PowerBuilder® 9 and add the nonvisual extension enumfont.pbd to the library path. Run the application using the running man. A window with a button named Enum Fonts will show up. Click on the button, a message box for each new font name will pop up one by one. Optional: Open the Visual C++ 6.0 workspace enumfont.dsw and look at the main.cpp to see how it is implemented. Build the Visual Studio project enumfont.dsw with Visual C++, and you will get a DLL called enumfont.dll in the test directory. Go to the test directory and run the pbx2pbd tool with the following syntax : pbx2pbd90 enumfont.pbd enumfont.dll A PBD file, enumfont.pbd, will be generated. For more information The best source for information will be the PowerBuilder® Native Interface Programmer’s Guide and Reference. Also look for another nonvisual extension sample called Ping. Click here to download - EnumFont PB2Java Description The following PowerBuilder® 9 sample demonstrates a PBNI marshaler extension that allows you to call Java from PowerScript. This extension declares a native class, JavaVM, which has two functions, createJavaVM and createJavaObject. The CJavaVM class implements the JavaVM native class. The CreateJavaVm function of CJavaVM gets the classpath and properties from the PBCallInfo structure, and loads the JVM by calling the loadJavaVM function of the JavaVMWrapper class. The JavaVMWrapper class is a singleton class, encapsulating the JavaVM interface provided by JNI. The CreateJavaObject function creates an instance of a Java class based on the given class name, creates a PowerBuilder proxy object for the Java object, creates a JavaMarshaler object, and associates the marshaler object with the proxy object. The JavaMarshaler class implements the IPBX_Marshaler interface, which is responsible for translating a PowerBuilder function call into a Java function call and returning the result from Java to PowerBuilder. A JMethod object represents a Java method, which is responsible for translating PowerBuilder data types into Java data types, and invoking the Java function specified by method name and method signature. A JValue object represents a parameter or a return value passed to or from a Java function. Features PBNI – marshaler Extension Setting up Your Environment PowerBuilder® 9 GA Visual C++ 6.0 (only if the extension workspace needs to be opened) Detailed Steps Unzip into a folder, for example c:\pb2java. Open the workspace calljava.pbw in the \test directory with PowerBuilder 9 and add the marshaler extension pbjava.pbd to the library path. Run the application using the running man. Click on the button labeled "call Java Converter." You will see a message box showing the result of the function call. Tips: If you encounter error messages such as: “Error calling method of PBNI object” please check your PATH and CLASSPATH environment variables. PATH should include jdk\jre\bin\classic (where the jvm.dll is located) and jdk\jre\bin. The CLASSPATH environment variable should include jdk\jre\lib. For example when using JDK 122 in c:\program files\Sybase\shared\sun\jdk122: PATH: c:\program files\Sybase\shared\sun\jdk122\jre\bin\classic;c:\program files\Sybase\ shared\sun\jdk122\jre\bin CLASSPATH: c:\program files\Sybase\shared\sun\jdk122\jre\lib Optional: Open the Visual C++ 6.0 workspace pb2java.dsw and look at the different .cpp files included in the workspace to see how it is implemented. For more information The best source for information will be the PowerBuilder® Native Interface Programmer’s Guide and Reference. There is a section, called “Creating Marshaler Extensions” ie. Chapter 3, which has some more information about this sample. Also look for another sample called java2pb, that enables to call PowerScript from Java. Click here to download - PB2Java EJB Client for WebLogic Server Descriptio Page d'accueil / Contactez-nous / Aide / Emplois / Informations légales / Confidentialité / Code de déontologie ? Tous droits réservés 2014, Sybase Inc. - v 7.6 Sybase France SARL, (27, rue du Colonel Pierre Avia, 75508 Paris Cedex 15, France), société à responsabilité limitée au capital de 1.000.000 euros, enregistrée au Registre du Commerce et des Sociétés de Paris sous le numéro B 349 230 441.