C Run-Time Error R6002

17 messages Options
Embed this post
Permalink
Hubert Cater

C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
I'm having a bit of trouble with the latest Windows SDK 6.1 C-compiler.

Initially my executables run fine but once they are wrapped with a DRM
called eLicense it seems to expose a C Run-Time Error R6002 which
complains that floating-point support is not loaded.

Is there any way to force the C-compiler to load the floating-point
support library even if it may not initially use it until it is wrapped
with the DRM?

Any help would be much appreciated.  So far I've only been able to find
this information page from Microsoft wrt the error but I am really not
sure how to proceed to fix the problem on my end, thanks.

http://msdn.microsoft.com/en-us/library/k1x26e0x(VS.71).aspx

Hubert

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Emmanuel Stapf

RE: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
> I'm having a bit of trouble with the latest Windows SDK 6.1 C-compiler.
>
> Initially my executables run fine but once they are wrapped with a DRM
> called eLicense it seems to expose a C Run-Time Error R6002 which
> complains that floating-point support is not loaded.

This is very strange since nowadays all CPUs have floating point support.
 
> Is there any way to force the C-compiler to load the floating-point
> support library even if it may not initially use it until it is wrapped
> with the DRM?

Does it also fail when using a small C program? Have you tried to debug the
failure under a C debugger to see where it actually fails? Have you checked with
the eLicense provider if they are aware of a possible issue?

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Hubert Cater

Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Hi Manu,

I dug a little deeper into the issue and it looks like MSVC++ 2008
optimizes compilation by not linking to the floating point support
library unless needed.  Looks like my original EXE did not but the
wrapper from eLicense requires this linkage so it causes the R6002 run
time error.

I found the following webpage that describes the issue in slightly more
detail with a small C-program that should invoke the error.

http://tinyurl.com/clxkb4

I haven't tested this smaller C-program but what I did do was take their
final solution and embedded it as a dummy C routine for my application
in the hopes it would then cause the Microsoft C compiler to link to the
floating point library.

This workaround while not the optimal solution seems to have done the
trick for now.

I've also contacted eLicense to let them know of the issue and
apparently I am not the first one to report the problem so hopefully
they will have a workaround for their end moving forward as well.

Hubert




Emmanuel Stapf [ES] wrote:

>
>
>  > I'm having a bit of trouble with the latest Windows SDK 6.1 C-compiler.
>  >
>  > Initially my executables run fine but once they are wrapped with a DRM
>  > called eLicense it seems to expose a C Run-Time Error R6002 which
>  > complains that floating-point support is not loaded.
>
> This is very strange since nowadays all CPUs have floating point support.
>
>  > Is there any way to force the C-compiler to load the floating-point
>  > support library even if it may not initially use it until it is wrapped
>  > with the DRM?
>
> Does it also fail when using a small C program? Have you tried to debug the
> failure under a C debugger to see where it actually fails? Have you
> checked with
> the eLicense provider if they are aware of a possible issue?
>
> Regards,
> Manu
>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.233 / Virus Database: 270.10.16/1929 - Release Date: 01/30/09 17:31:00
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Hubert Cater

Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
In reply to this post by Hubert Cater
Just getting back to this error and it seems to still be a problem on my end.

I was suggested to try the following for the C compilation and to be honest I am not sure where I could adjust this in the Eiffel installation:

"Can you turn off Optimizations and try again to verify? (under
General "Whole Program Optimization" or under C/C++ Optimization "Disabled")
 Of course the Release build but no optimizations
You can check out the /fp: switch especially with strict
Also the /Oi-"

As C is not really my expertise, it would be greatly appreciated if I someone could tell me if this even makes sense and if so where I could go to in the Eiffel installation to try the suggested changes?

Thanks,
Hubert



--- In [hidden email], Hubert Cater <hcater@...> wrote:

>
> I'm having a bit of trouble with the latest Windows SDK 6.1 C-compiler.
>
> Initially my executables run fine but once they are wrapped with a DRM
> called eLicense it seems to expose a C Run-Time Error R6002 which
> complains that floating-point support is not loaded.
>
> Is there any way to force the C-compiler to load the floating-point
> support library even if it may not initially use it until it is wrapped
> with the DRM?
>
> Any help would be much appreciated.  So far I've only been able to find
> this information page from Microsoft wrt the error but I am really not
> sure how to proceed to fix the problem on my end, thanks.
>
> http://msdn.microsoft.com/en-us/library/k1x26e0x(VS.71).aspx
>
> Hubert
>
> --
> Fury Software
> http://www.furysoftware.com
>
> Battlefront.com
> http://www.battlefront.com
>


Emmanuel Stapf

RE: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
> "Can you turn off Optimizations and try again to verify? (under
> General "Whole Program Optimization" or under C/C++ Optimization
> "Disabled")
>  Of course the Release build but no optimizations
> You can check out the /fp: switch especially with strict
> Also the /Oi-"
>
> As C is not really my expertise, it would be greatly appreciated if I
> someone could tell me if this even makes sense and if so where I could go
> to in the Eiffel installation to try the suggested changes?

You can define the ISE_CFLAGS environment variable before changing the Eiffel
configuration file. When set, the C compiler will use those flags and this will
override whatever we have set. So from what they say, I would do before launching
finish_freezing:

set ISE_CFLAGS=/Od /Oi- /fp:strict

and see if it changes anything.

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Thanks Manu



> You can define the ISE_CFLAGS environment variable before changing the
> Eiffel
> configuration file. When set, the C compiler will use those flags and
> this will
> override whatever we have set. So from what they say, I would do before
> launching
> finish_freezing:
>
> set ISE_CFLAGS=/Od /Oi- /fp:strict
>
> and see if it changes anything.
>
> Regards,
> Manu
>


--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Unfortunately this didn't seem to do the trick.

It has been suggested that I need to dynamically link the runtime
libraries with the Multi-threaded DLL /MD flag.

Would this make any sense?

I've tried to use this flag in the ISE_CFLAGS environment variable and
it overrides the /MT flag but results in numerous C compilation errors.

Thanks in advance,
Hubert



Hubert Cater wrote:

> Thanks Manu
>
>
>
>> You can define the ISE_CFLAGS environment variable before changing the
>> Eiffel
>> configuration file. When set, the C compiler will use those flags and
>> this will
>> override whatever we have set. So from what they say, I would do
>> before launching
>> finish_freezing:
>>
>> set ISE_CFLAGS=/Od /Oi- /fp:strict
>>
>> and see if it changes anything.
>>
>> Regards,
>> Manu
>>
>
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Emmanuel Stapf

RE: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
> It has been suggested that I need to dynamically link the runtime
> libraries with the Multi-threaded DLL /MD flag.
> Would this make any sense?

It would if indeed the third party library you are using is using /MD.

> I've tried to use this flag in the ISE_CFLAGS environment variable and
> it overrides the /MT flag but results in numerous C compilation errors.

Unfortunately using a mix of /MT and /MD will never work in most scenarios. So if
you have to compile with /MD, you have to recompile everything with /MD, including
the Eiffel Software runtime and the C counterparts of some Eiffel libraries. It is
doable but quite a pain.

Can you remind us how you are including this component into your software?

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Thanks for your response and the way it works is my executable is
wrapped in a process that enables DRM.  The EXE then communicates with a
DLL called eLicense.dll.

It seems that at some point during this communication I receive the
floating point error as my guess is the wrapping or the DLL requires the
floating point libraries to have been included and compiled in my project.

How they wrap it I am not exactly sure but this is their website if it
is of any help.

http://www.elicense.com/

Hubert




Emmanuel Stapf [ES] wrote:

>  
>
>  > It has been suggested that I need to dynamically link the runtime
>  > libraries with the Multi-threaded DLL /MD flag.
>  > Would this make any sense?
>
> It would if indeed the third party library you are using is using /MD.
>
>  > I've tried to use this flag in the ISE_CFLAGS environment variable and
>  > it overrides the /MT flag but results in numerous C compilation errors.
>
> Unfortunately using a mix of /MT and /MD will never work in most
> scenarios. So if
> you have to compile with /MD, you have to recompile everything with /MD,
> including
> the Eiffel Software runtime and the C counterparts of some Eiffel
> libraries. It is
> doable but quite a pain.
>
> Can you remind us how you are including this component into your software?
>
> Regards,
> Manu
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Emmanuel Stapf

RE: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Do you have any pointer on the eLicense technical documentation for integrating
their product?

Regards,
Manu

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Hubert Cater
> Sent: Wednesday, September 30, 2009 7:17 AM
> To: [hidden email]
> Subject: Re: [eiffel_software] Re: C Run-Time Error R6002
>
> Thanks for your response and the way it works is my executable is
> wrapped in a process that enables DRM.  The EXE then communicates with a
> DLL called eLicense.dll.
>
> It seems that at some point during this communication I receive the
> floating point error as my guess is the wrapping or the DLL requires the
> floating point libraries to have been included and compiled in my
> project.
>
> How they wrap it I am not exactly sure but this is their website if it
> is of any help.
>
> http://www.elicense.com/
>
> Hubert
>
>
>
>
> Emmanuel Stapf [ES] wrote:
> >
> >
> >  > It has been suggested that I need to dynamically link the runtime
> >  > libraries with the Multi-threaded DLL /MD flag.
> >  > Would this make any sense?
> >
> > It would if indeed the third party library you are using is using /MD.
> >
> >  > I've tried to use this flag in the ISE_CFLAGS environment variable
> and
> >  > it overrides the /MT flag but results in numerous C compilation
> errors.
> >
> > Unfortunately using a mix of /MT and /MD will never work in most
> > scenarios. So if
> > you have to compile with /MD, you have to recompile everything with
> /MD,
> > including
> > the Eiffel Software runtime and the C counterparts of some Eiffel
> > libraries. It is
> > doable but quite a pain.
> >
> > Can you remind us how you are including this component into your
> software?
> >
> > Regards,
> > Manu
> >
>
> --
> Fury Software
> http://www.furysoftware.com
>
> Battlefront.com
> http://www.battlefront.com
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Hi Manu,

I've asked but it doesn't look like anything will be forthcoming as I'm
guessing it is proprietary in nature.

Thanks though,
Hubert

Emmanuel Stapf [ES] wrote:

>  
>
> Do you have any pointer on the eLicense technical documentation for
> integrating
> their product?
>
> Regards,
> Manu
>
>  > -----Original Message-----
>  > From: [hidden email]
> <mailto:eiffel_software%40yahoogroups.com>
>  > [mailto:[hidden email]
> <mailto:eiffel_software%40yahoogroups.com>] On Behalf Of Hubert Cater
>  > Sent: Wednesday, September 30, 2009 7:17 AM
>  > To: [hidden email]
> <mailto:eiffel_software%40yahoogroups.com>
>  > Subject: Re: [eiffel_software] Re: C Run-Time Error R6002
>  >
>  > Thanks for your response and the way it works is my executable is
>  > wrapped in a process that enables DRM. The EXE then communicates with a
>  > DLL called eLicense.dll.
>  >
>  > It seems that at some point during this communication I receive the
>  > floating point error as my guess is the wrapping or the DLL requires the
>  > floating point libraries to have been included and compiled in my
>  > project.
>  >
>  > How they wrap it I am not exactly sure but this is their website if it
>  > is of any help.
>  >
>  > http://www.elicense.com/ <http://www.elicense.com/>
>  >
>  > Hubert
>  >
>  >
>  >
>  >
>  > Emmanuel Stapf [ES] wrote:
>  > >
>  > >
>  > > > It has been suggested that I need to dynamically link the runtime
>  > > > libraries with the Multi-threaded DLL /MD flag.
>  > > > Would this make any sense?
>  > >
>  > > It would if indeed the third party library you are using is using /MD.
>  > >
>  > > > I've tried to use this flag in the ISE_CFLAGS environment variable
>  > and
>  > > > it overrides the /MT flag but results in numerous C compilation
>  > errors.
>  > >
>  > > Unfortunately using a mix of /MT and /MD will never work in most
>  > > scenarios. So if
>  > > you have to compile with /MD, you have to recompile everything with
>  > /MD,
>  > > including
>  > > the Eiffel Software runtime and the C counterparts of some Eiffel
>  > > libraries. It is
>  > > doable but quite a pain.
>  > >
>  > > Can you remind us how you are including this component into your
>  > software?
>  > >
>  > > Regards,
>  > > Manu
>  > >
>  >
>  > --
>  > Fury Software
>  > http://www.furysoftware.com <http://www.furysoftware.com>
>  >
>  > Battlefront.com
>  > http://www.battlefront.com <http://www.battlefront.com>
>  >
>  >
>  > ------------------------------------
>  >
>  > Yahoo! Groups Links
>  >
>  >
>  >
>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.14.1/2407 - Release Date: 10/01/09 06:34:00
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
In reply to this post by Emmanuel Stapf
Hi Manu,

One suggested way around my error is for the DRM wrapper to wrap a DLL
for my game as opposed to the EXE.

This requires me to generate a DLL specific to my EXE and I have used
the 'Dynamic Library Builder' wizard to generate a test DLL based on a
single feature from my code.

Here is the sample feature:

my_feature (d_srface : DIRECT_DRAW_SURFACE7_IMPL_PROXY; x, y : INTEGER;
s_srface : DIRECT_DRAW_SURFACE7_IMPL_PROXY; s : SPRITE; t, b : BOOLEAN)
: INTEGER is


I've successfully generated the DLL and here is the relevant contents
from the generated 'edynlib.c' file:

extern void F1_29 (EIF_REFERENCE);
extern EIF_INTEGER_32 F1643_28402 (EIF_REFERENCE, EIF_REFERENCE ,
EIF_INTEGER_32 , EIF_INTEGER_32 , EIF_REFERENCE , EIF_REFERENCE ,
EIF_BOOLEAN , EIF_BOOLEAN );
EIF_INTEGER_32 my_feature (EIF_REFERENCE d_srface, EIF_INTEGER_32 x,
EIF_INTEGER_32 y, EIF_REFERENCE s_srface, EIF_REFERENCE s, EIF_BOOLEAN
t, EIF_BOOLEAN b)
{ GTCX
        /* Creation : F1_29; */
        /* Feature  : F1643_28402 ;*/
        EIF_REFERENCE main_obj = (EIF_REFERENCE) 0;
        EIF_INTEGER_32 Return_Value ;
        DYNAMIC_LIB_RT_INITIALIZE(4);

RTLR(1,dest_surface);
RTLR(2,sprite_surface);
RTLR(3,sprite);
RTLR(0,main_obj);
        main_obj = RTLN(1642);
        /* Call the creation routine */
        F1_29(main_obj);

        /* Call the routine */
        Return_Value = (EIF_INTEGER_32)
F1643_28402(main_obj,d_srface,x,y,s_srface,s,t,b);
        DYNAMIC_LIB_RT_END;
        return (EIF_INTEGER_32) Return_Value;
}


At this point I'm guessing for it to work as expected I need my original
feature to no longer rely on the original code but to reference the DLL
via an 'external; call instead so that the EXE is actually linking to
the DLL at runtime.

Trying my best to follow the C externals documentation I've come up with
the following:

my_feature (d_srface : DIRECT_DRAW_SURFACE7_IMPL_PROXY; x, y : INTEGER;
s_srface : DIRECT_DRAW_SURFACE7_IMPL_PROXY; s : SPRITE; t, b : BOOLEAN)
: INTEGER is
                 do
                        Result := cwin_my_feature($d_srface, x, y, $s_srface, $s, t, b)
                end

        cwin_my_feature (d_srface : POINTER; x, y : INTEGER; s_srface, s :
POINTER; t, b : BOOLEAN) : INTEGER is
                        -- C external
                external
             "C [dll32 %"my_dll.dll%"] (EIF_REFERENCE, EIF_INTEGER_32,
EIF_INTEGER_32, EIF_REFERENCE, EIF_REFERENCE, EIF_BOOLEAN, EIF_BOOLEAN)
: EIF_INTEGER_32"
         alias
          "my_feature"
         end

The project compiles and freezes successfully but when 'my_feature' is
called at runtime I receive a 'Visual C++ Runtime Error'.  Any help in
tracking down where I've gone wrong would be greatly appreciated as C
externals are definitely not my strength.

Note, I've also experimented with using dllwin32 in the c external call
as well as including the generated 'lib' file under the Advanced
settings when I generated the DLL and all to no avail.

Thanks,
Hubert



Emmanuel Stapf [ES] wrote:

>  
>
> Do you have any pointer on the eLicense technical documentation for
> integrating
> their product?
>
> Regards,
> Manu
>
>  > -----Original Message-----
>  > From: [hidden email]
> <mailto:eiffel_software%40yahoogroups.com>
>  > [mailto:[hidden email]
> <mailto:eiffel_software%40yahoogroups.com>] On Behalf Of Hubert Cater
>  > Sent: Wednesday, September 30, 2009 7:17 AM
>  > To: [hidden email]
> <mailto:eiffel_software%40yahoogroups.com>
>  > Subject: Re: [eiffel_software] Re: C Run-Time Error R6002
>  >
>  > Thanks for your response and the way it works is my executable is
>  > wrapped in a process that enables DRM. The EXE then communicates with a
>  > DLL called eLicense.dll.
>  >
>  > It seems that at some point during this communication I receive the
>  > floating point error as my guess is the wrapping or the DLL requires the
>  > floating point libraries to have been included and compiled in my
>  > project.
>  >
>  > How they wrap it I am not exactly sure but this is their website if it
>  > is of any help.
>  >
>  > http://www.elicense.com/ <http://www.elicense.com/>
>  >
>  > Hubert
>  >
>  >
>  >
>  >
>  > Emmanuel Stapf [ES] wrote:
>  > >
>  > >
>  > > > It has been suggested that I need to dynamically link the runtime
>  > > > libraries with the Multi-threaded DLL /MD flag.
>  > > > Would this make any sense?
>  > >
>  > > It would if indeed the third party library you are using is using /MD.
>  > >
>  > > > I've tried to use this flag in the ISE_CFLAGS environment variable
>  > and
>  > > > it overrides the /MT flag but results in numerous C compilation
>  > errors.
>  > >
>  > > Unfortunately using a mix of /MT and /MD will never work in most
>  > > scenarios. So if
>  > > you have to compile with /MD, you have to recompile everything with
>  > /MD,
>  > > including
>  > > the Eiffel Software runtime and the C counterparts of some Eiffel
>  > > libraries. It is
>  > > doable but quite a pain.
>  > >
>  > > Can you remind us how you are including this component into your
>  > software?
>  > >
>  > > Regards,
>  > > Manu
>  > >
>  >
>  > --
>  > Fury Software
>  > http://www.furysoftware.com <http://www.furysoftware.com>
>  >
>  > Battlefront.com
>  > http://www.battlefront.com <http://www.battlefront.com>
>  >
>  >
>  > ------------------------------------
>  >
>  > Yahoo! Groups Links
>  >
>  >
>  >
>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.14.1/2407 - Release Date: 10/01/09 06:34:00
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com

Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
For reference this is the error I've received from the exception trace log:

-------------------------------------------------------------------------------
Class / Object      Routine                Nature of exception
  Effect
-------------------------------------------------------------------------------
RUN-TIME            root's set-up          0x80070057  The parameter is
incorrect.

:
<0000000000000000>                         COM error.
  Fail
-------------------------------------------------------------------------------
RUN-TIME            root's set-up          main entry point vanished:
<0000000000000000>                         Eiffel run-time panic.
  Panic
-------------------------------------------------------------------------------



>
>
> Emmanuel Stapf [ES] wrote:
>>  
>>
>> Do you have any pointer on the eLicense technical documentation for
>> integrating
>> their product?
>>
>> Regards,
>> Manu
>>
>>  > -----Original Message-----
>>  > From: [hidden email]
>> <mailto:eiffel_software%40yahoogroups.com>
>>  > [mailto:[hidden email]
>> <mailto:eiffel_software%40yahoogroups.com>] On Behalf Of Hubert Cater
>>  > Sent: Wednesday, September 30, 2009 7:17 AM
>>  > To: [hidden email]
>> <mailto:eiffel_software%40yahoogroups.com>
>>  > Subject: Re: [eiffel_software] Re: C Run-Time Error R6002
>>  >
>>  > Thanks for your response and the way it works is my executable is
>>  > wrapped in a process that enables DRM. The EXE then communicates with a
>>  > DLL called eLicense.dll.
>>  >
>>  > It seems that at some point during this communication I receive the
>>  > floating point error as my guess is the wrapping or the DLL requires the
>>  > floating point libraries to have been included and compiled in my
>>  > project.
>>  >
>>  > How they wrap it I am not exactly sure but this is their website if it
>>  > is of any help.
>>  >
>>  > http://www.elicense.com/ <http://www.elicense.com/>
>>  >
>>  > Hubert
>>  >
>>  >
>>  >
>>  >
>>  > Emmanuel Stapf [ES] wrote:
>>  > >
>>  > >
>>  > > > It has been suggested that I need to dynamically link the runtime
>>  > > > libraries with the Multi-threaded DLL /MD flag.
>>  > > > Would this make any sense?
>>  > >
>>  > > It would if indeed the third party library you are using is using /MD.
>>  > >
>>  > > > I've tried to use this flag in the ISE_CFLAGS environment variable
>>  > and
>>  > > > it overrides the /MT flag but results in numerous C compilation
>>  > errors.
>>  > >
>>  > > Unfortunately using a mix of /MT and /MD will never work in most
>>  > > scenarios. So if
>>  > > you have to compile with /MD, you have to recompile everything with
>>  > /MD,
>>  > > including
>>  > > the Eiffel Software runtime and the C counterparts of some Eiffel
>>  > > libraries. It is
>>  > > doable but quite a pain.
>>  > >
>>  > > Can you remind us how you are including this component into your
>>  > software?
>>  > >
>>  > > Regards,
>>  > > Manu
>>  > >
>>  >
>>  > --
>>  > Fury Software
>>  > http://www.furysoftware.com <http://www.furysoftware.com>
>>  >
>>  > Battlefront.com
>>  > http://www.battlefront.com <http://www.battlefront.com>
>>  >
>>  >
>>  > ------------------------------------
>>  >
>>  > Yahoo! Groups Links
>>  >
>>  >
>>  >
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.409 / Virus Database: 270.14.1/2407 - Release Date: 10/01/09 06:34:00
>>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.420 / Virus Database: 270.14.4/2417 - Release Date: 10/06/09 06:50:00
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Hubert Cater

Re: Re: C Run-Time Error R6002

Reply Threaded More More options
Print post
Permalink
Just a follow up that I've had some success with other features and my
guess is that this particular attempt likely failed because some of the
underlying calls for this feature were dependent on their own external
calls which apparently from my understanding now simply won't work.

Hubert




Hubert Cater wrote:

> For reference this is the error I've received from the exception trace log:
>
> -------------------------------------------------------------------------------
>
> Class / Object      Routine                Nature of exception  Effect
> -------------------------------------------------------------------------------
>
> RUN-TIME            root's set-up          0x80070057  The parameter is
> incorrect.
>
> :
> <0000000000000000>                         COM error.  Fail
> -------------------------------------------------------------------------------
>
> RUN-TIME            root's set-up          main entry point vanished:
> <0000000000000000>                         Eiffel run-time panic.  Panic
> -------------------------------------------------------------------------------
>
>
>
>
>>
>>
>> Emmanuel Stapf [ES] wrote:
>>>  
>>>
>>> Do you have any pointer on the eLicense technical documentation for
>>> integrating
>>> their product?
>>>
>>> Regards,
>>> Manu
>>>
>>>  > -----Original Message-----
>>>  > From: [hidden email]
>>> <mailto:eiffel_software%40yahoogroups.com>
>>>  > [mailto:[hidden email]
>>> <mailto:eiffel_software%40yahoogroups.com>] On Behalf Of Hubert Cater
>>>  > Sent: Wednesday, September 30, 2009 7:17 AM
>>>  > To: [hidden email]
>>> <mailto:eiffel_software%40yahoogroups.com>
>>>  > Subject: Re: [eiffel_software] Re: C Run-Time Error R6002
>>>  >
>>>  > Thanks for your response and the way it works is my executable is
>>>  > wrapped in a process that enables DRM. The EXE then communicates
>>> with a
>>>  > DLL called eLicense.dll.
>>>  >
>>>  > It seems that at some point during this communication I receive the
>>>  > floating point error as my guess is the wrapping or the DLL
>>> requires the
>>>  > floating point libraries to have been included and compiled in my
>>>  > project.
>>>  >
>>>  > How they wrap it I am not exactly sure but this is their website
>>> if it
>>>  > is of any help.
>>>  >
>>>  > http://www.elicense.com/ <http://www.elicense.com/>
>>>  >
>>>  > Hubert
>>>  >
>>>  >
>>>  >
>>>  >
>>>  > Emmanuel Stapf [ES] wrote:
>>>  > >
>>>  > >
>>>  > > > It has been suggested that I need to dynamically link the runtime
>>>  > > > libraries with the Multi-threaded DLL /MD flag.
>>>  > > > Would this make any sense?
>>>  > >
>>>  > > It would if indeed the third party library you are using is
>>> using /MD.
>>>  > >
>>>  > > > I've tried to use this flag in the ISE_CFLAGS environment
>>> variable
>>>  > and
>>>  > > > it overrides the /MT flag but results in numerous C compilation
>>>  > errors.
>>>  > >
>>>  > > Unfortunately using a mix of /MT and /MD will never work in most
>>>  > > scenarios. So if
>>>  > > you have to compile with /MD, you have to recompile everything with
>>>  > /MD,
>>>  > > including
>>>  > > the Eiffel Software runtime and the C counterparts of some Eiffel
>>>  > > libraries. It is
>>>  > > doable but quite a pain.
>>>  > >
>>>  > > Can you remind us how you are including this component into your
>>>  > software?
>>>  > >
>>>  > > Regards,
>>>  > > Manu
>>>  > >
>>>  >
>>>  > --
>>>  > Fury Software
>>>  > http://www.furysoftware.com <http://www.furysoftware.com>
>>>  >
>>>  > Battlefront.com
>>>  > http://www.battlefront.com <http://www.battlefront.com>
>>>  >
>>>  >
>>>  > ------------------------------------
>>>  >
>>>  > Yahoo! Groups Links
>>>  >
>>>  >
>>>  >
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG - www.avg.com Version: 8.5.409 / Virus Database:
>>> 270.14.1/2407 - Release Date: 10/01/09 06:34:00
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com Version: 8.5.420 / Virus Database:
>> 270.14.4/2417 - Release Date: 10/06/09 06:50:00
>>
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Hubert Cater

Dynamic Library Generation

Reply Threaded More More options
Print post
Permalink
In reply to this post by Hubert Cater
I'm a little stuck in dealing with EIF_REFERENCE as a return type as
shown in my edynlib.c file.

If the Eiffel routine that is now a part of my DLL returns type
MAP_POSITION, the class is below, how do I retrieve this type if the
return type is shown as EIF_REFERENCE in the C file?

For example, here is my class:

class
        MAP_POSITION

create
        make

feature {NONE} -- Initialization

        make (x_value, y_value : INTEGER) is
                do
                        x := x_value
                        y := y_value
                end

feature -- Access

        x : INTEGER

        y : INTEGER

end


Here is the Eiffel routine signature that is now in the DLL:

convert_mouse_coordinates_to_map_position (rect : WEL_RECT; x_pos, y_pos
: INTEGER) : MAP_POSITION


The C signature is shown as the following in the edynlib.c file:

EIF_REFERENCE convert_mouse_coordinates_to_map_position (EIF_REFERENCE
rect, EIF_INTEGER_32 x_pos, EIF_INTEGER_32 y_pos)


In Eiffel I would now have something like the following but it fails to
retrieve the proper type, giving me catcall errors at runtime when I
access any variables assigned and used by this routine:

convert_mouse_coordinates_to_map_position (rect : WEL_RECT; x_pos, y_pos
: INTEGER) : MAP_POSITION is
do
        Result := c_convert_mouse_coordinates_to_map_position($rect, x_pos, y_pos)
end

c_convert_mouse_coordinates_to_map_position (rect : POINTER, x_pos,
y_pos : INTEGER) : MAP_POSITION
external
        "C (EIF_REFERENCE, EIF_INTEGER_32, EIF_INTEGER_32): EIF_REFERENCE"
         alias
          "convert_mouse_coordinates_to_map_position"
end










--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com
Emmanuel Stapf

RE: Dynamic Library Generation

Reply Threaded More More options
Print post
Permalink
> I'm a little stuck in dealing with EIF_REFERENCE as a return type as
> shown in my edynlib.c file.

Unfortunately this does not make sense for a DLL as a C program would not know
what to do about an Eiffel object which in addition moves in memory during its
life time. And even if you are calling this DLL from an Eiffel program (which is
what you seem to do), they are actually two runtimes running side by side and they
cannot share objects.

The bottom line with shared library generation is that they can only use basic
types. So in your case, you need to have two routines for getting the x and y
component and then you can reconstruct a MAP_POSITION object.

Hope this helps,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Hubert Cater

Re: Dynamic Library Generation

Reply Threaded More More options
Print post
Permalink
Thanks Manu, that was my eventual workaround and your response now
clarifies some of the limitations for me.

Hubert


Emmanuel Stapf [ES] wrote:

>> I'm a little stuck in dealing with EIF_REFERENCE as a return type as
>> shown in my edynlib.c file.
>
> Unfortunately this does not make sense for a DLL as a C program would not know
> what to do about an Eiffel object which in addition moves in memory during its
> life time. And even if you are calling this DLL from an Eiffel program (which is
> what you seem to do), they are actually two runtimes running side by side and they
> cannot share objects.
>
> The bottom line with shared library generation is that they can only use basic
> types. So in your case, you need to have two routines for getting the x and y
> component and then you can reconstruct a MAP_POSITION object.
>
> Hope this helps,
> Manu
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.421 / Virus Database: 270.14.12/2431 - Release Date: 10/12/09 13:01:00
>

--
Fury Software
http://www.furysoftware.com

Battlefront.com
http://www.battlefront.com