Static *.lib files from Platform SDK.
Static *.lib files from Platform SDK.
There are several .lib files that are part of the Microsoft Win32 Platform SDK that do not have a .dll counterpart.
How can i use these libraries in FB?
How can i use these libraries in FB?
I'm a mapi coder...
There are some really *cool* functions i'd like to get to with VB.NET that are part of the Exchange Developer Kit (EDK) that are only available as .lib files. There are full headers for each and are part of a full install of VC++ 6.0.
I'm trying right now to stumble my way thru creating a dll in VC6 that exports the methods in EDKMAPI.LIB.
I'm close, but i'm missing some libraries in my link list.
Eventually, i need to wrap all the EDK libraries.
Thanks,
I'm trying right now to stumble my way thru creating a dll in VC6 that exports the methods in EDKMAPI.LIB.
I'm close, but i'm missing some libraries in my link list.
Eventually, i need to wrap all the EDK libraries.
Thanks,
The PE COFF format is the executable format *g* - I guess you meant to object COFF format. Hmm ... I simply don't know it if they're different or not ...DrV wrote:I was under the impression that mingw used M$ COFF format for object files, but M$ didn't follow the COFF format exactly, so, for example, DJGPP COFF objects are a little different from Microsoft COFF objects. I'm pretty sure that mingw uses the PE COFF format.
Regards,
Mark
Re: I'm a mapi coder...
So using the .lib files directly didn't work? Just try it as suggested by DrV:alt160 wrote:I'm trying right now to stumble my way thru creating a dll in VC6 that exports the methods in EDKMAPI.LIB.
- Create "valid" library file names:
Code: Select all
copy *.lib lib*.a
- Add the path to the compiler switches
See option "-p" - Add the library to the compiler switches
See option "-l" ... so when your library is "libkernel32.a", then you should specify "-l kernel32"
Mark
Actually, PE is also the object file format. :) http://www.microsoft.com/whdc/system/pl ... ECOFF.mspxmjs wrote:The PE COFF format is the executable format *g* - I guess you meant to object COFF format. Hmm ... I simply don't know it if they're different or not ...DrV wrote:I was under the impression that mingw used M$ COFF format for object files, but M$ didn't follow the COFF format exactly, so, for example, DJGPP COFF objects are a little different from Microsoft COFF objects. I'm pretty sure that mingw uses the PE COFF format.
Regards,
Mark
Hmmm, i'll give it a try.
I'll try the suggestions for renaming the libs to *.a
Its gonna be awhile as i have to convert some rather complex C header files...any tools out there to automate this effort? (*.h to *.bi)?
Thanks much guys!
Its gonna be awhile as i have to convert some rather complex C header files...any tools out there to automate this effort? (*.h to *.bi)?
Thanks much guys!
For converting C headers to FB headers, v1ctor wrote a swig wrapper for FB: http://www.freebasic.net/temp/swig_fb.zip - but it's not finished yet.. you'll probably need to edit the results by hand.
If you're going to use these in VB.NET eventually, you'll probably want to write your own conversion tool anyway, since VB.NET's Declare syntax is different than FB's in subtle (and not-so-subtle) ways, though I haven't touched VB.NET in almost 2 years, so I don't remember much about it :).
If you're going to use these in VB.NET eventually, you'll probably want to write your own conversion tool anyway, since VB.NET's Declare syntax is different than FB's in subtle (and not-so-subtle) ways, though I haven't touched VB.NET in almost 2 years, so I don't remember much about it :).
SHWEET. I'll check it...
SHWEET! I'll check out that wrapper...
So far, as long as the exported functions support CDECL standards, VB.NET has no problems. I have created many DLLs in PowerBASIC for VB and VB.NET without issues.
Only caveats are strings... need to pass ByRef in VB if you want to have the DLL modify its contents. .NET doesnt allow direct memory access very easily due to its garbage collector implementation.
So, the ByRef works well, as long as the strings are small, like no more that a CPU page (4096 on intel).
For large strings...file streams seems to work well, or else deal with COM. which sucks ass. (which i'm sure you'd agree.)
So far, as long as the exported functions support CDECL standards, VB.NET has no problems. I have created many DLLs in PowerBASIC for VB and VB.NET without issues.
Only caveats are strings... need to pass ByRef in VB if you want to have the DLL modify its contents. .NET doesnt allow direct memory access very easily due to its garbage collector implementation.
So, the ByRef works well, as long as the strings are small, like no more that a CPU page (4096 on intel).
For large strings...file streams seems to work well, or else deal with COM. which sucks ass. (which i'm sure you'd agree.)
Btw, FB follows VB when declaring string params, BYVAL AS STRING will pass the string data address, BYREF will pass the string descriptor, so you have to use BYVAL with strings if they are passed to/from C libs.
That doesn't mean the strings can't be modified inside FB, nor that a copy will be made.
Weird but was added to be compatible with the Win API headers borrowed from VB.
That doesn't mean the strings can't be modified inside FB, nor that a copy will be made.
Weird but was added to be compatible with the Win API headers borrowed from VB.