Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Loadlibrary() error 3765269347
    text
    copied!<p>I have got this Loadlibraty() error 3765269347 bothering me. I am implementing a C++ console application, built as x64, to load a x64 native C++ dll. Following is the code in the C++ console application to load the dll:</p> <pre><code> bool InitDll() { HINSTANCE hInst = LoadLibrary(_T("C:\\TIS_Nick\\Hardware\\Devices\\ThorDetectorSwitch\\TDSTest\\TDSTest\\Debug\\Modules_Native\\ThorDetectorSwitch.dll")); if( hInst != NULL ) { FreeLibrary( hInst ); return true; } else { DWORD err = GetLastError(); return false; } } </code></pre> <p>I got err is 3765269347, which I think means C++ cannot handle this error. I am sure my path to load the dll is correct. </p> <p>I also use <strong>Monitor Process</strong> to trace what the dll and functions get called. and here is the information I think relevant. </p> <pre><code>11:08:07.3196483 AM TDSTest.exe 1604 QueryNameInformationFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\x64\Debug\TDSTest.exe SUCCESS Name: \TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\x64\Debug\TDSTest.exe 11:08:08.5720585 AM TDSTest.exe 1604 CreateFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened 11:08:08.5721041 AM TDSTest.exe 1604 QueryBasicInformationFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS CreationTime: 6/11/2013 6:30:08 PM, LastAccessTime: 6/11/2013 6:30:08 PM, LastWriteTime: 6/12/2013 11:00:28 AM, ChangeTime: 6/12/2013 11:05:51 AM, FileAttributes: A 11:08:08.5721293 AM TDSTest.exe 1604 CloseFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS 11:08:08.5722797 AM TDSTest.exe 1604 CreateFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS Desired Access: Read Data/List Directory, Execute/Traverse, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened 11:08:08.5723228 AM TDSTest.exe 1604 CreateFileMapping C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: 11:08:08.5724896 AM TDSTest.exe 1604 CreateFileMapping C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS SyncType: SyncTypeOther 11:08:08.5725861 AM TDSTest.exe 1604 Load Image C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS Image Base: 0x7fef7830000, Image Size: 0x6d000 11:08:08.5726385 AM TDSTest.exe 1604 QueryNameInformationFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS Name: \TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll 11:08:08.5728910 AM TDSTest.exe 1604 CreateFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened 11:08:08.5912215 AM TDSTest.exe 1604 CloseFile C:\TIS_Nick\Hardware\Devices\ThorDetectorSwitch\TDSTest\TDSTest\Debug\Modules_Native\ThorDetectorSwitch.dll SUCCESS </code></pre> <p>I aplogize that looks a little messy, I was trying to post a picture here, but it turns out I don't have enough reputation to do so. Any suggestion is appreciated.</p> <p><strong>Update</strong> I have traced down to the constructor in <code>ThorDetectorSwitch.dll</code>, which looks like following:</p> <pre><code>ThorDetectorSwitch::ThorDetectorSwitch() : _mcSwitch(__uuidof(MCLControlClass)) { _A = WstringToBSTR(L"A"); _B = WstringToBSTR(L"B"); _C = WstringToBSTR(L"C"); _D = WstringToBSTR(L"D"); _deviceDetected = FALSE; } </code></pre> <p>I set the break point at the first parenthesis, but it never gets into the function. Instead, it jumps to the exceptions. I suppose something wrong with the <code>MCLControlClass</code>, or<code>_mcSwitch</code>?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload