You are currently browsing all posts tagged with Powerbuilder OLE

PowerBuilder – Using C# Visual Objects in PB Classic Applications

Posted on June 18, 2012 at 5:16 pm in

This article will explain how to build a COM visual component in C# using Visual Studio 2010; it is an extension of my earlier example of using the Interop Forms Toolkit to build a Visual Basic COM object. First you need to install the Microsoft Interop Toolkit (available here). Then download the C# Interop Form…

PowerBuilder – Using C# Visual Objects in PB Classic Applications - the full story »

PowerBuilder – Timing Out a Windows Session

Posted on June 12, 2012 at 6:25 pm in

There are a variety of techniques to locking or timing out an application after a certain amount of inactivity. With earlier versions of Windows (XP and prior) a common approach was to invoke the screen saver via a Send command. send(handle(This),274,61760,0) This doesn’t work with Windows 7 (or Vista). Try the following: integer li_rc OleObject…

PowerBuilder – Timing Out a Windows Session - the full story »

PowerBuilder – Using .Net Visual Controls in PB Classic Applications

Posted on June 5, 2012 at 5:27 pm in

This article describes the techniques and code used during my presentations at the Carolina Code Camp 2012 and at the May 2012 meeting of the North Carolina PowerBuilder User Group. The techniques described here utilize Visual Basic .Net (coded in Visual Studio 2010) with the Interop Forms Toolkit available from Microsoft. The Interop Forms Toolkit…

PowerBuilder – Using .Net Visual Controls in PB Classic Applications - the full story »

PowerBuilder – Reading Outlook Items

Posted on September 1, 2011 at 8:20 pm in

Here is some code which reads data from Outlook (2007 was tested) into PowerBuilder. You basically need to create a window with a multiline edit and a button on it. Put this into the clicked event of the button. To run it, open Outlook, select something (email message, task, etc.) then click the button on…

PowerBuilder – Reading Outlook Items - the full story »

PowerBuilder – Add /Remove a Font at Runtime

Posted on January 12, 2011 at 8:20 pm in

Here is a way to add (and remove) a font to the user’s machine at runtime. You can also use this to check if a user has a particular font installed since the code also shows how to list all the installed fonts (need MS Word for this). Way back in my PB5 days I…

PowerBuilder – Add /Remove a Font at Runtime - the full story »

PowerBuilder – Locating Windows folders

Posted on December 29, 2010 at 8:20 pm in

Here is an easy way to find the paths to the various Windows folders. oleobject lole_wshell lole_wshell = create oleobject lole_wshell.connecttonewobject( "wscript.shell") is_mydocspath = lole_wshell.SpecialFolders("MyDocuments") IF IsValid(lole_wshell) THEN Destroy lole_wshell /* other folders: AllUsersDesktop AllUsersStartMenu AllUsersPrograms AllUsersStartup Desktop Favorites Fonts MyDocuments NetHood PrintHood Programs Recent SendTo StartMenu Startup Templates */

PowerBuilder – Locating Windows folders - the full story »

PowerBuilder – Getting Active Directory information

Posted on September 27, 2010 at 8:00 pm in

Here is a handy bit of OLE to retrieve Active Directory information. oleobject ads string ls_stuff ads = CREATE OleObject ads.ConnectToNewObject( "ADSystemInfo" ) ls_stuff = 'User: ' + String(ads.UserName) ls_stuff += '~n~r' + 'Computer: ' + string(ads.ComputerName) ls_stuff += '~n~r' + 'Domain: ' + string(ads.DomainDNSName) ls_stuff += '~n~r' + 'Domain short: ' + string(ads.DomainShortName) ls_stuff…

PowerBuilder – Getting Active Directory information - the full story »

PowerBuilder – OLE with Facsys to Fax a Document

Posted on October 2, 2009 at 8:23 pm in

Here is a old post I put on Tek-Tips.com way back in 2001. I have just implemented an OLE faxing solution in my PB7 app using Facsys. This code creates the session, addresses the fax message, then attaches a previously created MSWord document to the fax. lole_facsys = Create OLEObject li_rc = lole_facsys.ConnectToNewObject("facsys.faxsession") //Check for…

PowerBuilder – OLE with Facsys to Fax a Document - the full story »

Create Word Doc and attach to Outlook Email in PowerBuilder

Posted on September 23, 2009 at 10:47 am in

Here is some sample PowerScript from back in 2004. The word document created is saved from a template doc previously created with specific bookmarks used to format the text. oleobject lole_word OLEObject lole_item, lole_attach, lole_outlook string ls_file_name lole_word = CREATE oleobject lole_outlook = Create OLEObject TRY lole_word.connecttonewobject('word.application') CATCH (runtimeerror a) Messagebox('Error','Error connecting with MS Word.…

Create Word Doc and attach to Outlook Email in PowerBuilder - the full story »

Top