1. RE: exe imports / exports and Eu

-----Original Message-----
From: Mark Brown [mailto:mabrown at SENET.COM.AU]
 
>I want to create a "plugin" for the AC3D modeller.
 
>I have never tried anything like this before so these questions might
>be a bit lame :)
 
>It looks to me like the AC3D.exe exports most of its internal functions.
>These are then made available to the plugin (which I believe is a renamed
>DLL) to call. 
 
>I had hoped that I could create my DLL plugin using the Eu2C translator.
>However, I cannot think of a way to get my dll to "see" the exported AC3D
>functions. Is there a way to do it? Perhaps by modifying one of the files
>created by Eu2C?

You can simply use open_dll().  The name is a little misleading.  Any file
that exports functions or variables will work with open_dll() (.dll, .exe,
.ocx, etc).  So writing the dll in Euphoria is your best way to go.  

However, that's about as far as I can help you, since all the information on
creating and using plugins for/with AC3D seems to be reserved for the
registered version.  With the new dll features, this should be pretty
simple, although you might have to fiddle with the names of the exported
files (using a .def file), since I'm guessing that AC3D looks for a certain
entry point to access the plugin.

Matt Lewis

new topic     » topic index » view message » categorize

2. RE: exe imports / exports and Eu

> -----Original Message-----
> From: Mark Brown [mailto:mabrown at SENET.COM.AU]
 
> > You can simply use open_dll().  The name is a little 
> misleading.  Any file
> > that exports functions or variables will work with 
> open_dll() (.dll, .exe,
> > .ocx, etc).  So writing the dll in Euphoria is your best way to go.
> 
> Interesting.....I actually tried that. I must have made a mistake :(

Did the error come from open_dll() or define_c_func/proc()?  Since AC3D
seems to be written with C++, you might have a problem with name decoration.
You might be able to use quickview to see the actual exported names.  There
are probably other, more reliable utilities out there, though (I use View
Dependencies, which comes with Visual Studio).
 
> In the meantime,I have been having a rotten time trying to 
> compile a DLL
> using BCC from the DOS prompt.. I finally got it to recognise AC3D's
> exports when suddenly it has started reporting "out of 
> memory"....sheesh!

Strange.  I'm not sure why that would be, but I'd be glad to take a look at
your source.

> The example source and .h is VC++ and as I know little about either VC
> or BCC this is very hard. I would rather do it all with Eu if 
> possible....

Yeah, there's a lot of stuff that gets done behind the scenes (the samples
probably import a .lib file to link to AC3D).

> I have played around with the .def as 
> suggested in Eu2C
> which seemed to fix the names (but left the old names there 
> too.....is there
> a reason for that?). Incidently, I think a switch to have the .def
> automatically
> generated would be nice.

In the source, you'll see a lot of __declspec(dllexport)'s.  There will be
two for each export, one in a .h file (I think they all end up in main_.h),
and one in the .c file where the function actually lives.  Comment or delete
all of these.  You're basically telling the compiler to export something
three different times.

I suggested the .def method to Rob, and I think that will happen in the
final release.

> Thanks for the help Matt. Don't be surprised if I end up with 
> lots more
> questions :)

No problem.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

3. RE: exe imports / exports and Eu

> -----Original Message-----
> From: Mark Brown [mailto:mabrown at SENET.COM.AU]
 
> I still can't get the exe to open. It is failing at open_dll.
> I tried loading the "sgrid.ocx" from your "EUCom" and 
> that loaded fine. I thought perhaps that AC3D.exe 
> itself needed the tcl dll's (which I had not copied across
> to my code folder) so I copied everything from the
> AC3D folder to the folder containing my code but still no
> go.

After some testing, here's what I've found.  You can only get access to
files that are in the same folder, are in subfolders of your code, or are in
the system directory.  This appears to be a windows thing.  I tried to use
LoadLibraryA instead of open_dll(), and got the exact same results.  so the
solution seems to be to move your code (once compiled, at least) to the same
folder.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

4. RE: exe imports / exports and Eu

Mark Brown wrote:
> Thanks for the help with this.
> 
> I have succeeded in compiling a DLL using BCC and
> getting AC3D to plug in to it. There are still some
> problems. For example, one exported AC function 
> returns an "Unresolved External" or similar when linking.
> It links fine if I use "-u-" to turn off the leading underscore
> on exported names but then, all the other functions return
> the "Unresolved External" !!! I still hate C :(
> 
> I'm going to try using the dll to get at AC's data using
> Euphoria next. Wish me luck.
> 
 Mark:

  I downloaded AC3D trial version to take a look at it.
  I don't see any exported functions in AC3D.EXE ?
  It is a application that for creating 3d models.
  The only files that I see that have functions are
  are Tcl.dll and Tk80.dll which are DLL,s for a scripting
  Langauge I think ?
  Are these the functions you are trying to wrap ?
  If so if you are trying to load these DLL's, Note that 
  the first letter of of there name is capitalized .

  I am totally confused by what you are trying to accomplish.

Bernie

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu