1

Good morning all,

I'm new to C#, and I have to update an already developed application, where I intend to add some new features. I've opened it in Visual Studio 2012 and rebuilt it, apparently with no errors. When I run it, the GUI appears correctly, but when I start the application an error occurs:

A first chance exception of type 'System.DllNotFoundException' occurred in MccDaq.dll An unhandled exception of type 'System.DllNotFoundException' occurred in MccDaq.dll Additional information: Unable to load DLL 'cbw32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I've searched the last couple of days for a solution, but I haven't found any. Among many others, I found this thread (Unable to load DLL (Module could not be found HRESULT: 0x8007007E)), unfortunately with no luck for me. In fact, searching for the aforementioned DLL ("cbw32.dll"), I wasn't able to find it anywhere in my files. Also, as pointed out in the thread, I've installed Dependency Walker, and analysed "MccDaq.dll" (the file where the System.DllNotFoundException occurred), where errors appear again:

Error: Modules with different CPU types were found. Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

Googling for this bring little or nothing new, apart from understanding that apparently, I'm having problems with the CPUs architecture in several DLLs, and so here I am. Again I must underline that I'm new to C#, so it wouldn't be surprising that some rookie error is being made here. Nevertheless, here's the code block that triggers the error in Visual Studio:

public ErrorInfo StartBoard(MccDaq.ErrorReporting r, MccDaq.ErrorHandling h) {

        //only create another object if the configs are different
        if((daqBoard == null) || (daqBoard.BoardNum != boardNum)) {

            daqError = MccDaq.MccService.ErrHandling(r, h);
            daqBoard = new MccDaq.MccBoard(boardNum);
            daqError = daqBoard.DConfigPort(portNum, direction);
        }

        return daqError;
    }

Another detail that can be important here is that this application was made about 4,5 years ago, so my guess is that it must be programmed using Visual Studio 2008. Regarding this, I've changed, in the project properties, the "Target Framework:" to .NET Framework 3.5, again with no success: the behaviour does not change.

Concluding, I found many different directions where I can go, and that led me to confusion. If someone can enlighten me on this, I'd be totally grateful.

Community
  • 1
  • 1
João Fernandes
  • 558
  • 3
  • 11
  • 29
  • 1
    You need a DLL to run this code and you don't have it. Nor do we. Contact [the vendor](http://www.mccdaq.com/) for support. – Hans Passant Oct 04 '13 at 11:45
  • 1
    Thanks for the enlightment, @HansPassant! With your tip, I was able to deactivate the option to use this board, and now I can avoid the error. Again, many thanks! – João Fernandes Oct 07 '13 at 08:44

0 Answers0