comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Problem concerning accessing external library in IDL6.0
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problem concerning accessing external library in IDL6.0 [message #47746] Thu, 02 March 2006 09:55 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
yingjie, Peng wrote:

> Thanks for your kind reply. I think the problem is that the library
> which I used (DirectX.Capture.dll) is COM object, but it is not an
> ActiveX library. It is a .NET library. In .NET framework, you do not
> need to (or simply you can't) register the .NET library. This
> function is used to simplify coding within the .NET framework, such as
> C#. However, for us, the IDL user, we can't use ActiveX control to
> access this kind of library any more since we can't get the CLSID.

Are you *sure* you can't get the CLSID? Again, I am not a .NET guy, but
I see a ".NET Category" in my COM/OLE browser. I can then look for
something that I might be able to find docs or guess a method... I see:

"System.Random"

I use the COM/OLE browser to get the CLSID and then create the IDL COM
object:

test=obj_new('IDLcomIDispatch$CLSID$4E77EC8F_51D8_386C_85FE_ 7DC931B7A8E7')

I then try to guess a method or two, and fail. Then I go to the VS .net
docs, find the .net random class, see that the method to get a random
number is "next" and voila!

IDL> print, test->next()
1957853535
IDL> print, test->nextdouble()
0.80895216
IDL> print,test->tostring()
System.Random
IDL> print,test->gethashcode()
54267293

So I think you should at least *try* to find the CLSID using the COM/OLE
browser. I mean it will only take a few minutes and you may save
yourself a lot of time.


If you do find the CLSID, you still may not be "out of the woods" as we
say. I have had mixed success with IDL's COM interface. Simple things
tend to work, but more complex methods can run into problems. For
example, the nextbytes method of our aforementioned system.random object
seemed very straightforward. It fills a byte array with random bytes.
So you would think it would be as easy as:

IDL> a=bytarr(5)
IDL> print, test->nextbytes(a)
IDLCOMIDISPATCH$CLSID$4E77EC8F_51D8_386C_85FE_7DC931B7A8E7:: NEXTBYTES:
Unable to call method NEXTBYTES.
The parameter is incorrect.

I tried numerous variations with no success. I'm sure there is a
reason, and maybe some way to get it to work, but my point is that it
isn't always smooth sailing on the IDL COM seas.


So in the end you may end up writing a DLM anyways. It isn't as hard as
it may seem, especially if you buy Ronn Kling's book "Calling C from
IDL". You can order it from his website www.kilvarock.com.

Good luck!

-Rick
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: idl 6.2 segmentation fault on SUSE 10
Next Topic: Re: problem with dual monitor setup

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:52:13 PDT 2025

Total time taken to generate the page: 2.32925 seconds