May 20, 2024, 06:19:46 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


EBasic Headers 28 Feb 2008

Started by Jerry Muelver, March 08, 2008, 06:37:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerry Muelver

I tried installing Sapero's marvelous EBasic Headers stuff, and it seemed to do what it's supposed to do. It added a million-jillion files and folders to my "include" directory. However, my little apps now have compiling errors, like

(line 72)DECLARE IMPORT, GetAsyncKeyState(key as INT),int
.... hypad.eba (72), duplicate declaration - int

Does that mean GetAsyncKeyState is already declared by my $INCLUDE "windows.inc" statement? So, like, I don't have to DECLARE IMPORT for all the stuff I used to have to do?

In others words, how do I tap the power of the EBasic Headers installation? I'd be happy with a pointer to something in the Help file, for instance....  ::)


Jerry Muelver

Hmmm... Maybe so.... If I comment-out the error-triggering DECLARE statements, the errors go away, and program still works. I also delete the leading underscore from a _GetSysColor statement, and now that no longer flags an error. I guess I'll just have to settle down and read the 33 megabytes of Include files to see what's what.

This may take a while, so I won't be back probably for the rest of the day....

Jerry Muelver

I'm a fast reader, so I'm back already.  ::)

I had 38 errors in the EBasic Headers installation, mostly to do with stuff like:

- The library d3dx9_32.dll could not be located [http://www.microsoft.com/downloads/Browse.aspx?categoryid=2]

and other http downloads. Is this critical? Is it a function of my feeble dial-up (like, would it be fixed if I re-installed from a Downtown WiFi connection)?

LarryMc

(line 72)DECLARE IMPORT, GetAsyncKeyState(key as INT),int
.... hypad.eba (72), duplicate declaration - int

you're right; when you get that kind of error message it is being declared in two places and it only needs to be declared in one.
If you are not sharing source code with someone else then "windows.inc" is a blessing.

But if you are sharing source code then that will force whoever uses your code to also to have to download "windows.inc".

Not a biggie but something you/they need to be aware of.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

sapero

March 08, 2008, 09:44:10 AM #4 Last Edit: October 22, 2008, 01:31:10 PM by sapero
Jerry, try to compile as console, gui or dll a little$INCLUDE "windowssdk.inc"
' that's all !

It should compile without single error. I did so for every header to find syntax bugs.

There may be duplicate declaration errors if you have a incc file with some imports declared, this is the big minus of incc purpose - you don't know what is wrong.
After you include windows.inc, you don't need to declare imports, structures, unions and typedefs, all this is in headers. If is not, you'll need another header to include.
If you still have duplicates after compiling windows.inc, search for the api in your /bin folder and disable it (only if found in custom incc file, else please report the api to me).

QuoteThe library ** could not be located
This is only a hint to download of extract from backups any missing dll if you will need to use it. The installer was unable to create import library for you, and until you not-download these, you will have problems while including some additional headers: $USE will generate compiler error if the library is not present.

Underscore prefixes
- in windows.inc shipped with EBasic setup, maybe all imports were prefixed. It was not a good step, because only a small set of api's is prefixed with underscore.
- Now, underscores are added only for functions and variables that are already declared as Ebasic commands and types.
example: SendMessage is already declared as a build-in command, so _SendMessage will be the raw api automatically aliased for ansi/unicode version.
- SendMessageA and SendMessageW are always accesible.

So, you need to remove all prefixes while porting code for sdk headers :)

Ionic Wind Support Team

Quote from: sapero on March 08, 2008, 09:44:10 AM
- in windows.inc shipped with EBasic setup, maybe all imports were prefixed. It was not a good step, because only a small set of api's is prefixed with

That windows.inc came from VB4 (Microsoft) and sent through a converter that replaced VB types with the kind we use.  I had the converter prepend with the undescore so it didn't interfere with my own declares, and they wouldn't get in the way if someone built an official set of headers later on ;)

Paul.

Ionic Wind Support Team

Jerry Muelver

Thanks, guys. I'm making progress. I'll see if I can get rich edit to message back the font properties of selected text, as a baby-step learning exercise for this DLL-API businss. Headers are heady stuff for us primitive AWK scripters.  ::)