PDS Extender in C#

S

S.H.

Hi there,

i have tried to create a simple pds extender in c# just for
some testing. this is my code:


using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly:AssemblyKeyFileAttribute(@"keypair.snk")]
[assembly:AssemblyDelaySignAttribute(false)]
[assembly:AssemblyVersion("1.0.0.0")]

namespace PDSExtender
{

[Guid("2A756DB4-376E-43e1-B10D-29969FD7182C"),
ComVisible(true),
ClassInterfaceAttribute(ClassInterfaceType.AutoDual)]
public class Test
{
public Test() {
}

[ComVisible(true)]
public string XMLRequestEx(string sXML, string sPDSInfoEx,
ref short nHandled) {

nHandled = 1;
return "<Reply><HRESULT></HRESULT><STATUS>0</STATUS><Test>extension
reply</Test></Reply>";
}
}
}



after registration for com and pds extension in registry, i verified
if the object is working by opening up an excel map and entered some
macro code:



Sub test()
Dim o
Dim x As Integer
Set o = CreateObject("PDSExtender.Test")
MsgBox (o.XMLRequestEx("test", "test", x))
End Sub


this works fine, but trying to access the extender via pds i got error
code 9008 from project server and the following error message is
logged:

Component: PDS
Line: 0
Error Number: 0x2330
Description: <Description><![CDATA[CMain.HandleUnknownRequest;
-2147024770 : Automation error]]></Description>


i have also tried to create a sample pds extension using vb 6.0 with
this
code snippet:



Public Function XMLRequestEx( _
ByVal sXML As String, _
ByVal sPDSInfoEx As String, _
ByRef nHandled As Integer) _
As String

nHandled = 1

XMLRequestEx = "<Reply><HRESULT>1234</HRESULT><STATUS>0</STATUS><Testi>Hallo</Testi></Reply>"
Exit Function

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top