April 18, 2024, 05:26:01 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Using a dll

Started by REDEBOLT, April 22, 2008, 10:02:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

REDEBOLT

I have a dll which I moved to the c:\windows\system32 directory.
I am attempting to convert an ebasic program to cbasic.
I have an include file with only consts and declares which I converted to cbasic format.
I created a component from this file.
I included the component in my program.
When I reference a function from the component, I get an error.
If I copy the function declaration to my program, it works.

Can I not do this?
Regards,
Bob

pistol350

Hi Bob!

You should have the expected results.
Maybe you are doing something wrong.
How did you include the component in your program ?

Could you show some piece of code ?
Regards,

Peter B.

REDEBOLT

Attached is a zip file containing my test codes.
hi_PutRegAdd.eba is a program that works.
It uses ebaHIME.INC.
hi_PutRegAdd.cba is a translation of hi_PutRegAdd,eba.
cba doesn't have an include statement, so I assumed
that I would have to copy the entire include into the source.
Paul corrected me and suggested I use components.
So, I made a component of cbaHIME.INC.
However, it didn't work. 
The component doesn't work like an include file.

Another problem:
The statement at line 48 will not compile.
hi_PutRegAdd(lAdd, lLen, lReg1)
apparently has a problem with lAdd.
The corresponding line in eba works fine.
Regards,
Bob

pistol350

Hi Bob!

As i thought, To link components to your main source file you have to do a jump from your source file to the components.
Moreover, the User guide says that components, are just Subroutines.
You may already be aware of that by the way.

So, you can't use your include files as components at their current states, you first need to create a subroutine in which you will put the content of your include files.
It's only then that you will be able to create components from these subs that you will call from the top of your main source file. (as you would do with the"INCLUDE$" statement in Ebasic )

Hope my short speech was clear enough to be understood.  :)
Regards,

Peter B.