flat assembler
Message board for the users of flat assembler.

Index > Windows > Include files

Author
Thread Post new topic Reply to topic
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Hi people.

As you already are aware of, fasm comes with API include files, but it is missing include files for GDI, GDI+ and even though it is not common to include it, I also miss include files for DirectSound, Direct3D etc. Is there an effective tool that can convert c++ include files to fasm include files? Or can I find the include files for fasm somewhere else?
Post 16 Sep 2012, 00:42
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
There is effective tool that can create include files directly from the DLL - ImportsDB.

Also, you can download [http://fresh.flatassembler.net]Fresh IDE[/url] its library FreshLib contains more API include files.
Post 16 Sep 2012, 05:29
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Thanks JohnFound.

Btw, what general purpose library do you recommend for Fasm? Smile
Post 16 Sep 2012, 05:52
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
nmake wrote:
Btw, what general purpose library do you recommend for Fasm? Smile


Obviously FreshLib - it is very powerful - allows writing portable applications (compilable for Windows and Linux from one source), has advanced string handling library, macros for handling data, and is used in all of my projects recently, including closed source programs, written for the company I am working in.
The only drawback is that FreshLib is work in progress and some changes are still possible, so your sources could need changes with the later versions. I am trying to keep the compatibility, but sometimes it is not possible.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 16 Sep 2012, 06:19
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
nmake
As for me FreshLib is quite hard to get used to. I'd suggest you to try this package first.

JohnFound
Quote:
There is effective tool that can create include files directly from the DLL - ImportsDB.

It has never worked for me. Always produces files with only two lines like this:
Code:
;   libname.dll API calls (ASCII) 
import libname    
Post 16 Sep 2012, 15:06
View user's profile Send private message Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Do anyone know why gdi32.inc does not include the BITMAPINFO structure? This is needed when creating a dib section. It is very common to use dib sections. The RGBQUAD structure is also missing.

I could easily add the structure to the include file but before I do so I want to make absolutely sure that I am not doing redundant work.
Post 16 Sep 2012, 15:11
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
nmake
Firstly, it contains BITMAPINFOHEADER.
Secondly, see my previous post.
Post 16 Sep 2012, 15:16
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
I_inc, it is very strange about ImportsDB. Can you be more specific.
Also, please try to explain why you consider FreshLib hard to get used to. It is important for me, as long as I always tried to make FreshLib as easy as possible for use.
Post 16 Sep 2012, 15:55
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
JohnFound
Quote:
it is very strange about ImportsDB. Can you be more specific.

To be more specific, the call
Code:
cinvoke sqlitePrepare, [ptrDBase], sqlSelectFunctionsForExport, -1, hStatement, ptrNext    

always returns 0x15, which makes the following code jump to the label .nextlibrary.

Quote:
Also, please try to explain why you consider FreshLib hard to get used to.

It's quite an old experience. I don't remember details, but I remember some compatibility issues with the official package. And I remember, that the source code had to have a very strict structure with many macrocalls, which means that I had to learn an almost whole new language, before I could start writing anything with your package. I'd prefer to use the classical fasm program structure and to call some useful standalone macros from your package at one place or another.

P.S. And please, don't try to type my nickname. Better just copy-paste it. Smile
Post 16 Sep 2012, 18:40
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3500
Location: Bulgaria
JohnFound
l_inc, thanks for the bug report. I will check what happens. Also thanks for the opinion about FreshLib.
Post 16 Sep 2012, 19:44
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
I_inc: wow, it contains all the include files I could ever want. Even Direct3d 11. But most importantly it contains GDI plus, Dsound, that is primarily what I was looking for. Thanks

I just wonder how I am going to make this work, there are so many files and folders. Let's say I want to create a DSound application, could you give me a short guide what I should be including?
Post 16 Sep 2012, 23:19
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
nmake
Sorry, I have no experience with DirectX. And please, read the P.S. from my previous post.
Post 16 Sep 2012, 23:46
View user's profile Send private message Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Why does the package come with fasm executables too? Should I replace my entire fasmw folder with this package?
Post 17 Sep 2012, 00:14
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
nmake
I wouldn't do that, because it contains an older version of fasm. Newer versions always contain less bugs and more features. I mostly use the include files from the directory V7INCLUDE32 . You could specify the path to this directory in your environment variable include (instead of the original path) and just include what you need (e.g. win32a.inc). Or you could take include files on demand from V7INCLUDE32/V7INCLUDE64, as soon as you need something, what is not included into the official package.
Post 17 Sep 2012, 00:41
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
look there: http://www.vortex.masmcode.com/
for "external function scanner" - it scans your sources and creates import section using dll list.
Post 17 Sep 2012, 05:10
View user's profile Send private message Visit poster's website Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Thanks shoorick. I noticed the tool just below the tool you linked to, there is a tool called "MASM to FASM include file converter V1.06"

The nice thing about this is that I have masm installed here and I've been coding masm for years, and I have tons of include files that I could convert to fasm using this tool.
Post 17 Sep 2012, 05:23
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1605
Location: Ukraine
shoorick
yes, includes are good for constants and structure definitions.
the scanner has advantage as it may build import from dll indepently does include for this dll exist or not. very helpful for exotic dll-s Wink

in winasm studio this scanner included into the toolchain, you do not need to think about import at all, except cases when you need to add rare used dll into the list, but only once as if you typed "include 'blabla.inc'" as usually.
Post 17 Sep 2012, 08:39
View user's profile Send private message Visit poster's website Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 193
nmake
Yes, but i'm having problem knowing where to put files, what files to put where. I tried to copy a few include files, it gives me a zillion errors because of dependencies I don't know is rooted from. I also tried to change the environment variable to include the V7INCLUDE32 folder, it gives me a gazillion errors still. It complains about instruction errors in kernel32.inc structures. I comment out the structure or delete it, try to compile again and it begins all over with another structure, complaining it is illegal instruction. I've been going like this for 20 minutes, it doesn't stop. Soon I have deleted all structures in the include file he-he.

Is there a general guide how to install this include package? Smile
Post 17 Sep 2012, 09:15
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
nmake
You should learn to provide details on what you tried to do. Where did you set the include environment variable? Where is the minimal source giving you a compilation error, and what is the contents of the include variable, when it happens? Finally what compiler do you use (fasm.exe or fasmw.exe)?
Post 17 Sep 2012, 12:54
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
nmake wrote:
Yes, but i'm having problem knowing where to put files, what files to put where. I tried to copy a few include files, it gives me a zillion errors because of dependencies I don't know is rooted from. I also tried to change the environment variable to include the V7INCLUDE32 folder, it gives me a gazillion errors still. It complains about instruction errors in kernel32.inc structures. I comment out the structure or delete it, try to compile again and it begins all over with another structure, complaining it is illegal instruction. I've been going like this for 20 minutes, it doesn't stop. Soon I have deleted all structures in the include file he-he.

Is there a general guide how to install this include package? Smile


You must be talking about my expanded includes for fasmw. The main folder was designed to be used as your main environment and then create separate folders (within the main folder) for you own projects. You can update the fasmw.exe file if you rename it to (fasmw32.exe for 32bit programming) or (fasmw64.exe for 64bit programming). Do not delete the .ini files!. Some of the reasons you are getting so many errors is that kernel32.inc requires the msvcrt.inc include for some structure definitions, and some special macro definitions in the [macro] files folder.

_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 17 Sep 2012, 15:58
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.