1. WinInfo
- Posted by pampeano at ROCKETMAIL.COM Feb 25, 2001
- 441 views
Just sending this email to let you know about version 4.10.1721 that's another Windows 98. Best Regards, Guillermo BonvehĂ AKA: Caballero Rojo - Red Knight - Knixeur PS: If any C lover reads this, is there anyway to compile EDS so it could be used by other languages? I asked robert with no answer, but I think this would help EDS to grow.
2. Re: WinInfo
- Posted by matthewwalkerlewis at YAHOO.COM Feb 25, 2001
- 404 views
- Last edited Feb 26, 2001
--- pampeano at ROCKETMAIL.COM wrote: > PS: If any C lover reads this, is there anyway to compile EDS so it > could be used by other languages? I asked robert with no answer, but I > think this would help EDS to grow. Well, I'm no C lover, but I've been recently attempting to create a DLL with the translator (inspired, in part by your message, and also because I'd like to do similar things, esp with my EuSQL lib). I've been using LCC, which may be contributing to my problem. I may have to get Borland, based on some comments regarding LCC. I haven't gotten it to work yet, and I'm not really sure why, although I have several theories. First, let me explain what I did. I took everything from WinMain and put it into DLLMain. Most of the code (aside from var initialization) went into a switch statement looking for DLL_PROCESS_ATTACH (or whatever the correct wording is). I actually had to comment out the definition of malloc (IIRC--could have been another), because I also had included windows.h for some definitions required for creating a DLL. I exported a simple function, and got everything to compile (from within the IDE included with LCC). I was even able to link to the DLL and function, but once I call it, no output (from either the DLL or from the Eu program calling the function) worked. Now, my first suspicion was that this was something to do with the fact that I'm using the PD version of the translator. There was no delay. I have no idea what exactly the Eu libs do for initialization, but they may not be happy when compiled as a DLL. I also suspect that I may have screwed up, since I'm really pretty poor as a C coder. Here is the significant code, which should be enough to replicate what I've done with your own code... BOOL WINAPI DLLMain(HINSTANCE hDLL,DWORD Reason,LPVOID Reserved) { int _0, _1, _2, _3; int argc; int _37=0; char **argv; switch (Reason) // Code indicating the reason for this function be { case DLL_PROCESS_ATTACH: // The DLL is being loaded for the first time by a given process. // Perform per-process initialization here. If the initialization // is successful, return TRUE; if unsuccessful, return FALSE. //all the normal WinMain Code generated by ecw was here: case DLL_PROCESS_DETACH: // The DLL is being unloaded by a given process. Do any // pre-process clean up here, such as undoing what was done in // DLL_PROCESS_ATTACH. The return value is ignored. Cleanup(0); break; case DLL_THREAD_ATTACH: // A thread is being created in a process that has already loaded // this DLL. Perform any per-thread initialization here. The // return value is ignored. break; case DLL_THREAD_DETACH: // A thread is exiting cleanly in a process that has already // loaded this DLL. Perform any per-thread clean up here. The // return value is ignored. break; } return 1;}; Here's the function I exported (_1decompress() is a modified version of decompress in database.e designed for passing sequences to C routines created in Eu): int __declspec(dllexport) _0print_sequence(int _ptr { int _711 = 0; int _0, _1, _2, _3; _711 = _1decompress( _ptr ); Ref(_711); _6print(1, _711); DeRef(_711); return 0; ; } Matt Lewis