PowerBuilder 11 and .NET: Callback function that passes foreign types to PowerBuilder

Hi

I'm using a C# assembly to catch COM events (using IConnectionPoint
etc) from a particular API.  But instead of handling the events
in .NET, I pass the information on back to PB so it simulates a type
of callback.  It seems to work, but I don't know for how long.

This is the one the events that gets raised.  The _notifyItemMethod is
the name of the method on the PowerBuilder object.  The _pbSession is
obtained from the .Session property of the PowerBuilder object that I
pass to the constructor of the event handler.

        public void NtfyItem(string oper, int flags, IEOM_Object
father, IEOM_Object dep)
        {
            if (_pbSession != null && !
String.IsNullOrEmpty(_notifyItemMethod))
            {
                PBArgument operArg = new PBArgument();
                operArg.ParameterType = typeof(string);
                operArg.Style = ParameterStyle.ByValue;
                operArg.Value = new PBString(oper);

                PBArgument flagsArg = new PBArgument();
                flagsArg.ParameterType = typeof(int);
                flagsArg.Style = ParameterStyle.ByValue;
                flagsArg.Value = new PBInt(flags);

                PBArgument fatherArg = new PBArgument();
                fatherArg.ParameterType = typeof(IEOM_Object);
                fatherArg.Style = ParameterStyle.ByValue;
                fatherArg.Value = new PBOleObject(father);

                PBArgument depArg = new PBArgument();
                depArg.ParameterType = typeof(IEOM_Object);
                depArg.Style = ParameterStyle.ByValue;
                depArg.Value = new PBOleObject(dep);

                _pbSession.PostMethod(_pbObject, _notifyItemMethod,
                    new PBArgument[] { operArg, flagsArg, fatherArg,
depArg, });
        }

The problem is though that I can't seem to use the values in the
"father" and "dep" parameters in PowerBuilder.  They exist, and I can
call some of the methods on there without crashing the application,
but I never get a valid result.  I've confirmed that PowerBuilder does
indeed recognize the method names because if I enter names that don't
exist I get the "Name not found calling..." error.

This is the code in my PowerBuilder application:

public subroutine uf_notifyitem (string as_operation, integer
ai_flags, oleobject aole_container, oleobject aole_object);
String ls_ItemStatus = "Unknown"
OleObject lole_status, lole_ObjectInfo

// lole_ObjectInfo is always null after this operation.  It shouldn't
be.
// It also returns null with methods that return "string"
lole_ObjectInfo = aole_object.get_object_info()

// This line crashes
lole_status = lole_ObjectInfo.status_info

ls_ItemStatus = lole_status.name
mle_results.Text += as_operation + ": " +  "(" + ls_ItemStatus + ")" +
"~r~n"
end subroutine

Forgive me if my formatting is a bit off...
0
ilitirit
2/21/2008 5:40:59 PM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

1 Replies
1481 Views

Similar Articles

[PageSpeed] 27

I managed to figure it out.

Instead of passing the values back to PB as PBOleObject, I pass them
back as PBAny variables

Then, in PB I've got the following code:
#if defined PBWINFORM then
	System.Object l_intermediary
	EOMComLib.IEOM_Object l_objectInterface
	EOMComLib._EOM_ObjectInfo l_objectInfo

	// "Cast" the any variable into a System.Object - we cast directly
	l_intermediary = aole_object

	// "Recast" into the form we want
	l_objectInterface = l_intermediary

	// Get the object information
	l_objectInfo = l_objectInterface.get_object_info()

	// Save the status information for display
	ls_ItemStatus = objectInfo.status_info.name
#end if
0
ilitirit
2/22/2008 2:21:12 PM
Reply:

Similar Artilces:

Migrating PowerBuilder 8 to Powerbuilder 11
Hi, I am migrating a PFC based Powerbuilder 8 App. to PowerBuilder 11, I am getting errors like illegal data type. for a NVO n_cst_platformwin32 i am getting a syntax error, its not allowing me to open that object. Requesting your help thanks & regards Vimal Sanghvi If you're object (or any related object) failed to migrate successfully, you won't be able to edit it in a regular painter; you'll have to Edit Source to modify it. If you're migrating, a glance through my Migration Guide (see below) may help. The methodology there would allow you to identify...

Conflict
I have PowerBuilder 8 enterprise in my system for my existing packages. I would like to test my packages in PowerBuilder 11 Beta version. Is there any problem if I download and install the Beta version of PowerBuilder 11, to the system which contain the PowerBuilder 8? Thanks... The beta is over, but the evaluation version is available at http://response.sybase.com/forms/WW_PB11_Eval There shouldn't be any problem with multiple versions of PB on the same machine - different folder and dll names. Many of us have run 3 or 4 different versions concurrently! <Jemson Kuriak...

Powerbuilder 5 to Powerbuilder 10
Hi all We have migrated our application from powerbuilder 5 to powerbuilder 10. after migration to version 10, alignment in most of reports disturbed. please advice me some solution. On Fri, 29 Feb 2008 12:45:01 +0100, Adnan Jamil <adnanjamil@nji.com.pk> wrote: > Hi all > > We have migrated our application from powerbuilder 5 to powerbuilder 10. > after migration to version 10, alignment in most of reports disturbed. > please advice me some solution. Adnan, Is this a SQL Anywhere question? If not, you have posted to the wrong forum. If yes,...

Use PowerBuilder DLL in PowerBuilder
We use PB6.5. We would want to use a DLL create from PB in a PB application. We compiled an a PBL as DLL. After we tried to use DLL in a user object external, but without success. How can we do to use DLL create from PB or use in a new PB application some object (visual and no) before compiled with PB? Any help will be appreciated. Saul.Convalle@mail.cec.it Thanks When you create a DLL from a PB library it is not really a standard Windows DLL. I'm not sure what the difference is. If you are making calls from PB then just use the standard PB calling syntax the ...

PowerBuilder 11.Net
All; FYI ... Looks like the latest release of PB 11 seems to finally work with PowerDesigner 12.x (12.1 in my case) instead of only PD 10.x. This should make Dave Dichmann happy <lol>! So for you adventuresome testers out there with PB 11 and PD 12.x, please try and make some QA time to test drive this new symbiotic relationship <bg>. If you do not have PB 11.Net but would like to join the PB 11.Net Beta program, please follow this link: http://response.sybase.com/forms/ITSG06MayPowerBuilder110Beta Regards .. Chris Thanks for the update!!! I kno...

Problem registering dll created in Powerbuilder 8 and migrated to Powerbuilder 11
Hi, We have created a dll in Powerbuilder 8 as a com/mts application. This dll was then migrated to powerbuilder 11.1 build 8204. I am able to build the dll on my development machine and properly register the dll on my development machine on windows 7. When i deploy my dll and test application to a clean windows xp box, i am unable to register my dll using regsvr32. No error is displayed and the message box identifing that the registration was successful is never displayed. I have deployed all Powerbuilder 11 runtime using the powerbuilder runtime packager. I also deployed...

How to call AJAX function from a PowerBuilder 11.5 .NET Web Forms application?
Dear All, I would like to know if it is possible (if yes then how) to call AJAX function from a PowerBuilder 11.5 .NET Web Forms application. Any pointer or information is much appreciated. Thank you very much in advance. Thanks and Best Regards, Jessica The first thing you need to do is install the AJAX Extensions for ASP.Net. They can be downloaded here: http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en You write a client-side JavaScript event handler - say myScriptFile.js. Then, in the PowerBuilder ...

Upgrade to PowerBuilder 9 or PowerBuilder 10?
Hi, Our company is going to upgrade PowerBuilder. Currently we are using version 7, and we are going to upgrade either to version 9 or 10. Does anyone have any recommendations if we should go for version 9 or 10? What is the current release of version 10, and is it stable or is there a lot of bugs? Best regards, Ronald Ommundsen e-mail: ronald.ommundsen@gard.no Ron; If you have any hope of running the applications in the future on XP, W2003 or soon to be W2006 (LongHorn) you will have to jump over to UniCode - ie PB10. So personally, I would recommend starting with P...

PowerBuilder 10.5.2 Build 7826 differs from PowerBuilder 11.5.1 Build 4675
Apparently there's some data conversion issues that differ from PowerBuilder 10.5.2 and 11.5.1 (builds listed in subject). The following mini scrip results in different returned values: Byte lb_test Decimal ld_test lb_test = 48 ld_test = Dec(lb_test) MessageBox("Test", String(ld_test)) In PowerBuilder 10.5.2, the messagebox displays the value "48". In PowerBuilder 11.5.1 the messagebox displays the value "0.48". It appears that in PB 11.5.1, it's dividing the result by 100 for some reason. It appears to be a bug, just wanted to ve...

Powerbuilder
We're developing a to-sell-system for the restaurants industry. The system has PC and handheld (PocketPC) interfaces. I would like to use PowerBuilder to develop the UI, but I need to know if it is supported the development for the handhelds interface too?? and which specialized (good looking) forms or buttons I could use for the development?? This forum is for source code control questions - better to post in the general forum.. -- Evita R. Chapa Senior Systems Analyst II Command Technologies, Inc. <Mynor_Paredes> wrote in message news:F5DFEA0D01AB9EB700...

Powerbuilder
I am a new PB 6 developer. I want to create setup for my application exe. How do I do it using Installshield free. I have to copy sqlanywhere database to clients PC through the setup.I connect the DB through ODBC.Can anyone pl guide me. thanks. Shaikh moin If you are using ASA 6 then look in the Help... ASA User's Guide PART 4. Database Administration and Advanced Use CHAPTER 27. Deploying Databases and Applications Using a silent installation for deployment If you are using SQL Anywhere 5 try looking here... SQL Anywhere User's Guide ...

Version of PowerBuilder (ref: Creating database for PowerBuilder)
I'm using PowerBuilder v8.0 and would like to create a notification system for my practiculum project. I'd like to use Access to create the database. Please enlighten me on what should I create (e.g. tables, queries) for the usage of it. Thank You. Regards, Yang Ashra Don't double post, it's bad etiquette. Unless you have a very good reason to do so, we recommend you don't use Access. Use SQL Anywhere instead - it's more stable - and a far better database in my opinion. PowerBuilder (enterprise) supports just about every database out there, so if you...

Powerbuilder
long ll_rc dw_1.SETTRANSOBJECT(SQLCA) dw_1.retrieve() g_ole_crx_application = create oleobject g_ole_crx_report = create oleObject g_ole_crx_connection_info = create oleObject Resultset lrs_resultset ADOResultset lrs_adoresultset oleobject loo_AdoRecordset DataStore lds_temp lds_temp =create Datastore lds_temp.Dataobject="dw_print" lds_temp.settransobject(sqlca) lds_temp.retrieve() lrs_resultset=create resultset ll_rc=lds_temp.generateresultset(lrs_resultset) lrs_adoresultset = create adoresultset ll_rc = lrs_adoresultset.SetResultset(lrs_resultset) loo_AdoRecords...

PowerBuilder 9.0 and PowerBuilder 10.0
Hello NG ,,, I have a strange problem , installed both versions of PowerBuilder on the same machine having Windows XP. under Program files\Sybase9 - > PB9.0 was installed . under Program files\Sybase10- > PB10.0 was installed, I was working on XML workspace in PB9.0 where in the library list PBDOM90.PBD was included. By mistake , I opened the same workspace in PB10.0 and the application was migrated completed. Later coming back to PB9.0 and opening the same workspace , found that , in the system tree PDB files has zero object, It is not showing anything and the appl...

Web resources about - PowerBuilder 11 and .NET: Callback function that passes foreign types to PowerBuilder - sybase.powerbuilder.general

PowerBuilder - Wikipedia, the free encyclopedia
PowerBuilder is an integrated development environment owned by Sybase , a division of SAP . It has been in use since 1991, peaking around 1998 ...

Sybase PowerBuilder tool readied for Microsoft's .Net
... Win32 or newer style .Net development After several years of work, Sybase is ready to deliver on the final step in its plan to move PowerBuilder ...

Jim O'Neil (@jimoneil) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Open Directory - Computers: Programming: Languages
about dmoz - dmoz blog - report abuse/spam - help the entire directory only in Programming/Languages Description Top : Computers : Programming ...

The HP Booth Staff (Goons) Owe Me an Apology
... when you might need to use it. For instance, when I was in the WinRunner world there were plugins for driving terminal emulators and powerbuilder ...

Contact Us - Sybase Inc
Thanks for visiting the 主页 section of Sybase.com. Here you will find information about Contact Us. For more information about Business Intelligence, ...

热门搜索 - 我的异常网
... 我的异常网 » 热门搜索 sdpnet2 移动【A111】其它用户原因鉴权失败,是什么意思啊 http:// 192.168.1.102:22578 本网站服务器位于美国,受美国法律保护 MiniUI js 破解 http://192.168.1.103:8080/ powerbuilder ...

Mobile app security: Always keep the back door locked
The best way to keep mobile apps safe is to secure the services they connect to.

10 Tech Skills That Will Instantly Net You A $100,000+ Salary
... that let's developers run Java applications. Java is highly popular language for writing web apps and custom enterprise apps. No. 8: PowerBuilder ...

Top Ranked Articles
Top Ranked Articles - Free source code and tutorials for Software developers and Architects.; Updated: 23 Feb 2013

Resources last updated: 12/13/2015 7:05:57 AM