Dear Paul :
sorry for my ignorance. I am considering to buy an educational ADC board, which is, however, only provided with support for .NET VB2005 (or C#).
Will you think I will be able to use it in EBASIC? I have no experience (and feeling) with .NET languages, nor I will not intend to migrate to VB, I am feeling so confortable with EB.
Yours sincerely
Carlo
If the .NET assembly exposes a COM Interop interface, then I would imagine that you'd be able to use it. However, if it doesn't then you would need to create a .NET wrapper class that does expose such an interface, and then reference the assembly through that wrapper. Bottom line, technically possible but most likely it wouldn't be a trivial exercise.
Thanks!
But, could you give me some more advice on how and where I can find if .NET assemply exposes COM Interop? My knowledge is too limited at the moment.
Yours Carlo
I'm not sure if there's a COM browser for EBasic (I know JosÃÆ'Ã,© Roca made one for Aurora); short of that, you'd need to contact the author of the .NET assembly and ask them if they have an exposed COM interface for their component.
Hi Mike!
The product I'm talking about is EMANT ADC card. I was given the wrapper for using .NET assembly in VB5 and a sample code in VB5.
Do you think it will be simple to convert this sample code in EB?
Best wishes
Carlo
If it can be used in VB5/6 then I imagine it should be usable in EBasic. However, keep in mind that its support for COM is much lower level than with Visual Basic. You should read the topic on COM programming in the Language section of the helpfile.
Hi1
Sorry for being here again.
I tried to import the COM library provided for VB6, and the following error was found :
-----------------------------------------------------------------------------------------------------------------
MAKELIB v1.0 (C) Copyright 2005 Ionic Wind Software
All Rights Reserved.
no exports
Error Creating Import Library
-------------------------------------------------------------------------------------------------------------------
I'm probably doing something wrong, but I do not know why. Do you have any advise ?
Yours Carlo
Trying to create an import library for a COM DLL won't accomplish what you want here. What you want is a typelib browser that can generate the interface code for you; JosÃÆ'Ã,© Roca wrote one for Aurora, but I don't recall that he ever created a version for EBasic. In essence, to use a COM object in EBasic you need to create the interface definition to that object, use the COM API to create an instance of the object and then access its properties and methods through that interface.
There's an example the Projects folder called shell_com_example.eba, and the interface definition is in the Include folder as ishelllink.inc. As I mentioned before, however, using COM in EBasic is much more complicated than in Visual Basic. If you don't understand what class IDs are, what variants are, how to use CoCreateInstance and what QueryInterface does, then you're going to have a tough time understanding how it all works. VB isolates you from all those details, but EBasic requires that you actually understand how COM works.