www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Code Coverage and DLL's not working?

reply "Simen Haugen" <simen norstat.no> writes:
I get an error "The application failed to initialize properly (0x0e0440001)" 
when trying to run an executable built with -cov. It happens both for 
release and debug builds (the same exe/dll runs without cov).

Could the problem be that I'm using -cov on my dll...?

I'm using dmd 1.022
Oct 23 2007
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Simen Haugen" <simen norstat.no> wrote in message 
news:ffkq6b$14hs$1 digitalmars.com...
I get an error "The application failed to initialize properly 
(0x0e0440001)" when trying to run an executable built with -cov. It happens 
both for release and debug builds (the same exe/dll runs without cov).

 Could the problem be that I'm using -cov on my dll...?

 I'm using dmd 1.022
That error code is DMD's SEH error code. I think an exception is being thrown and not caught. Is your DLL linked so that it will be loaded when your program runs? Or do you manually load it with Win API calls? It sounds like the former, so I'd have a look and see if your DLL is throwing an exception perhaps in the DLLMain. Oh, one last question, I guess: I'm assuming your DLL is also written in D, is this so?
Oct 23 2007
parent reply "Simen Haugen" <simen norstat.no> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:ffksam$18ek$1 digitalmars.com...
 "Simen Haugen" <simen norstat.no> wrote in message 
 news:ffkq6b$14hs$1 digitalmars.com...
I get an error "The application failed to initialize properly 
(0x0e0440001)" when trying to run an executable built with -cov. It 
happens both for release and debug builds (the same exe/dll runs without 
cov).

 Could the problem be that I'm using -cov on my dll...?

 I'm using dmd 1.022
That error code is DMD's SEH error code. I think an exception is being thrown and not caught.
Strange... It doesn't throw an exception in release or debug without -cov.
 Is your DLL linked so that it will be loaded when your program runs?  Or 
 do you manually load it with Win API calls?  It sounds like the former, so 
 I'd have a look and see if your DLL is throwing an exception perhaps in 
 the DLLMain.
Yep, the former. At least I'm not raising any exceptions there. DllMain is the simplest version (the sample from digitalmars)
 Oh, one last question, I guess: I'm assuming your DLL is also written in 
 D, is this so?
Yes
Oct 23 2007
parent reply BCS <ao pathlink.com> writes:
Reply to Simen,

 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
 news:ffksam$18ek$1 digitalmars.com...
 
 "Simen Haugen" <simen norstat.no> wrote in message
 news:ffkq6b$14hs$1 digitalmars.com...
 
 I get an error "The application failed to initialize properly
 (0x0e0440001)" when trying to run an executable built with -cov. It
 happens both for release and debug builds (the same exe/dll runs
 without cov).
 
 Could the problem be that I'm using -cov on my dll...?
 
 I'm using dmd 1.022
 
That error code is DMD's SEH error code. I think an exception is being thrown and not caught.
Strange... It doesn't throw an exception in release or debug without -cov.
 Is your DLL linked so that it will be loaded when your program runs?
 Or do you manually load it with Win API calls?  It sounds like the
 former, so I'd have a look and see if your DLL is throwing an
 exception perhaps in the DLLMain.
 
Yep, the former. At least I'm not raising any exceptions there. DllMain is the simplest version (the sample from digitalmars)
 Oh, one last question, I guess: I'm assuming your DLL is also written
 in D, is this so?
 
Yes
It might be that the DLL is expecting something from the executable this isn't there (I known more about -cov then DLL's so take that with a grain of salt). Are you using -cov on the .exe?
Oct 23 2007
parent reply "Simen Haugen" <simen norstat.no> writes:
"BCS" <ao pathlink.com> wrote in message 
news:ce0a3343250498c9e364f1605f48 news.digitalmars.com...
 Reply to Simen,

 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
 news:ffksam$18ek$1 digitalmars.com...

 "Simen Haugen" <simen norstat.no> wrote in message
 news:ffkq6b$14hs$1 digitalmars.com...

 I get an error "The application failed to initialize properly
 (0x0e0440001)" when trying to run an executable built with -cov. It
 happens both for release and debug builds (the same exe/dll runs
 without cov).

 Could the problem be that I'm using -cov on my dll...?

 I'm using dmd 1.022
That error code is DMD's SEH error code. I think an exception is being thrown and not caught.
Strange... It doesn't throw an exception in release or debug without -cov.
 Is your DLL linked so that it will be loaded when your program runs?
 Or do you manually load it with Win API calls?  It sounds like the
 former, so I'd have a look and see if your DLL is throwing an
 exception perhaps in the DLLMain.
Yep, the former. At least I'm not raising any exceptions there. DllMain is the simplest version (the sample from digitalmars)
 Oh, one last question, I guess: I'm assuming your DLL is also written
 in D, is this so?
Yes
It might be that the DLL is expecting something from the executable this isn't there (I known more about -cov then DLL's so take that with a grain of salt).
Because of -cov then? As it works in release and debug otherwise.
 Are you using -cov on the .exe?
Yes, both compiled with -cov
Oct 23 2007
parent BCS <ao pathlink.com> writes:
Reply to Simen,

 "BCS" <ao pathlink.com> wrote in message
 news:ce0a3343250498c9e364f1605f48 news.digitalmars.com...
 
 Reply to Simen,
 
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
 news:ffksam$18ek$1 digitalmars.com...
 
 "Simen Haugen" <simen norstat.no> wrote in message
 news:ffkq6b$14hs$1 digitalmars.com...
 
 I get an error "The application failed to initialize properly
 (0x0e0440001)" when trying to run an executable built with -cov.
 It happens both for release and debug builds (the same exe/dll
 runs without cov).
 
 Could the problem be that I'm using -cov on my dll...?
 
 I'm using dmd 1.022
 
That error code is DMD's SEH error code. I think an exception is being thrown and not caught.
Strange... It doesn't throw an exception in release or debug without -cov.
 Is your DLL linked so that it will be loaded when your program
 runs? Or do you manually load it with Win API calls?  It sounds
 like the former, so I'd have a look and see if your DLL is throwing
 an exception perhaps in the DLLMain.
 
Yep, the former. At least I'm not raising any exceptions there. DllMain is the simplest version (the sample from digitalmars)
 Oh, one last question, I guess: I'm assuming your DLL is also
 written in D, is this so?
 
Yes
It might be that the DLL is expecting something from the executable this isn't there (I known more about -cov then DLL's so take that with a grain of salt).
Because of -cov then? As it works in release and debug otherwise.
 Are you using -cov on the .exe?
 
Yes, both compiled with -cov
Ok, I'm stumped.
Oct 24 2007
prev sibling parent Don Clugston <dac nospam.com.au> writes:
Simen Haugen wrote:
 I get an error "The application failed to initialize properly (0x0e0440001)" 
 when trying to run an executable built with -cov. It happens both for 
 release and debug builds (the same exe/dll runs without cov).
 
 Could the problem be that I'm using -cov on my dll...?
 
 I'm using dmd 1.022
There might be a function you need to call in DLLmain to initialize the code coverage (in much the same way as you need to manually run the unit tests). The DMD docs about DLL's are from before the -cov option existed.
Oct 24 2007