Board index » delphi » Making an OBJ-File out af an EXE-File

Making an OBJ-File out af an EXE-File

Hi!

I've written an Pascal-code in which you can see an image. Now I want
to include it into an C-source ... I've converted it with bin2obj to
from an EXE to an OBJ-File, but when I call it (also when I call it in
Pascal) the system hangs???

Can someone help me???

Andi
----------- BurnA ------------------------------------------
   EMail:   a9209...@unet.univie.ac.at
   voice :  0222-8699765       ( +43 1 8699765 )
   Fax:  :  0222-8699765       ( +43 1 8699765 )

 

Re:Making an OBJ-File out af an EXE-File


Quote
a9209...@unet.UNIVIE.AC.AT (BurnA) writes:
>Hi!
>I've written an Pascal-code in which you can see an image. Now I want
>to include it into an C-source ... I've converted it with bin2obj to
>from an EXE to an OBJ-File, but when I call it (also when I call it in
>Pascal) the system hangs???
>Can someone help me???

That's not the way to use BinObj. It can be used to include one single
procedure that is given in binary (I've never seen that), or (usually)
to include binary data into your program.

Now, for your problem, the easiest thing would be to call the Exe of
the pascal prog from the C prog. In pascal, that would be done with
the Exec procedure (unit Dos). In C there's a similar function,
I don't know its name.

I don't know of any way to include TP into C programs. This is mainly
because TP doesn't generate Obj files (but Tpus). Other pascal compilers
(Gnu, ...) might do. OTOH, you can include Objs from C files into
pascal programs. This is described in the TP manuals. Then, of course,
the main program would have to be in pascal (but you could write a
wrapper to call the C prog's main function).

Hope this wasn't too confusing,
Frank

Re:Making an OBJ-File out af an EXE-File


: I've written an Pascal-code in which you can see an image. Now I want
: to include it into an C-source ... I've converted it with bin2obj to
: from an EXE to an OBJ-File, but when I call it (also when I call it in
: Pascal) the system hangs???

That's because C is looking for a procedure, and you're giving it an
executable file... to my knowledge, you cant DO what you're trying to,
though a c routine in pascal works.  (Because C lets you save in
objects..at least, Watcom C does..)

You MAY want to try making the pascal code into an object, and then
binobj'ing that, and declare the procedures as normal externals, with
pascal parameters, of course...I dont know if this will owrk, but it's
worth a try..

-=- Mephistoe       -=- If you see a meaningful, touching quote here...
-=- m...@connix.com -=-
-=- Hacsoft '96     -=- ...you must be mistaking me for someone else.
OmniQuote2k -=- 04:13.06 -=- Fri,06/07/1996
"I always thought I radiated spam." -The Hac

Other Threads