Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > COM Interface Question

Reply
Thread Tools

COM Interface Question

 
 
Olaf Meding
Guest
Posts: n/a
 
      04-29-2004
I am having trouble with the 'User' property (get and put), found near
the bottom of the IDL file listed below. The user get call seems to
return None, not sure why.

More importantly, is there another way to get the 'IUser' value
required for the user put call? (Perhaps I need to make the put call
before the get call).

Sorry for the long IDL file, tried to delete a lot of non-relevant
code. Thanks so much for your help on this one.

Olaf


// ERFile.idl : IDL source for ERFile.dll
//

// This file will be processed by the MIDL tool to
// produce the type library (ERFile.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

[
uuid(bf79b6c5-47be-11d2-bacd-006008060a3a),
version(1.0),
helpstring("ERFile 1.0 Type Library")
]
library ERFile
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");


[
object,
uuid(bf79b6c7-47be-11d2-bacd-006008060a3a),
dual,
helpstring("IERecord Interface"),
pointer_default(unique),
nonextensible,
hidden
]
interface IUser : IDispatch
{
[id(1), helpstring("method Login")]
HRESULT Login([in] BSTR Username, [in] BSTR Password);

code deleted here

};


[
object,
uuid(bf79b6c9-47be-11d2-bacd-006008060a3a),
dual,
helpstring("IERecord Interface"),
pointer_default(unique),
nonextensible,
hidden
]
interface IERecord : IDispatch
{
[propget, id(1), helpstring("property User")]
HRESULT User([out, retval] IUser* *pVal);

[propput, id(1), helpstring("property User")]
HRESULT User([in] IUser *newVal);

code delted here

};

code delted here
};
 
Reply With Quote
 
 
 
 
Mark Hammond
Guest
Posts: n/a
 
      04-30-2004
Olaf Meding wrote:

> I am having trouble with the 'User' property (get and put), found near
> the bottom of the IDL file listed below. The user get call seems to
> return None, not sure why.


Possibly as the property has no value yet. After a successful set, you
may find it works.

> More importantly, is there another way to get the 'IUser' value
> required for the user put call? (Perhaps I need to make the put call
> before the get call).


It depends on the application - there will generally be either a progid
(so Dispatch() can create one), or some technique in the object model
for creating one. The last alternative is that they expect you to
implement this interface, but with the limited information available
here, that sounds unlikely.

Mark.
 
Reply With Quote
 
 
 
 
Olaf Meding
Guest
Posts: n/a
 
      04-30-2004
Mark

The IDL shows a uuid for the IUser interface (bf79...). How would I use
IDispatch() to create an IUser as required by the put user call?

Here are excerpts from the IDL file:
[
object,
uuid(bf79b6c7-47be-11d2-bacd-006008060a3a),
dual,
helpstring("IERecord Interface"),
pointer_default(unique),
nonextensible,
hidden
]
interface IUser : IDispatch

interface IERecord : IDispatch
{
[propput, id(1), helpstring("property User")]
HRESULT User([in] IUser *newVal);



Again, your help is much appreciated.

Olaf




 
Reply With Quote
 
Mark Hammond
Guest
Posts: n/a
 
      04-30-2004
Olaf Meding wrote:

> Mark
>
> The IDL shows a uuid for the IUser interface (bf79...). How would I use
> IDispatch() to create an IUser as required by the put user call?
>
> Here are excerpts from the IDL file:


There is nothing in that IDL that implies it can be created by an
IDispatch call - it is just describing the interface. Generally a
CoClass entry in the IDL indicates it can be publically created, but you
haven't shown that - but in that case, the makepy code will include a
comment telling you the progid, so I doubt it exists.

Surely there is documentation or a sample (in any language) for this object?

Mark.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Going from higher security level interface to lower security interface- HELP!!! - AM Cisco 4 12-28-2004 09:52 PM
PCI interface or USB interface David Wireless Networking 4 09-16-2004 01:01 PM
allow ssh only on outside interface, but telnet on inside interface of router no-one Cisco 0 07-28-2004 04:17 PM
PIX: how to allow 1 host from outside interface to access another host on the inside interface? jonnah Cisco 1 04-21-2004 02:26 PM
static nat between phisical interface and virtual interface on same ethernet Andrea Cisco 0 04-19-2004 09:37 AM



Advertisments