When I try to reference my DLL, it causes MT 4 build 184 to crash. I am only testing and I have a simple DLL that I am compiling in Visual C++ .NET 2003. Here is my simple source code:
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved )
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
double ShowMe(double myNum)
{
printf("Number passed to me is: %d\n", myNum);
return myNum;
}
here is the debug code that MT4 generated:
There has been a critical error
Time : 2005.11.05 22:09
Program : Client Terminal
Version : 4.00 (build: 184, 27 Oct 2005)
Owner : MIG Investments SA (MIG Trading Station)
OS : Windows 2003 Server 5.2 Service Pack 1 (Build 3790)
Processors : 2, type 586, level 15
Memory : 1048012/340592 kb
Exception : C0000005
Address : 00475D49
Access Type : read
Access Addr : 4008FEB9
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
When I try to reference my DLL, it causes MT 4 build 184 to crash. I am only testing and I have a simple DLL that I am compiling in Visual C++ .NET 2003. Here is my simple source code:
#include "stdafx.h"
#include <stdio.h>
extern "C" _declspec(dllexport)double ShowMe(double myNum);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved )
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
double ShowMe(double myNum)
{
printf("Number passed to me is: %d\n", myNum);
return myNum;
}
here is the debug code that MT4 generated:
There has been a critical error
Time : 2005.11.05 22:09
Program : Client Terminal
Version : 4.00 (build: 184, 27 Oct 2005)
Owner : MIG Investments SA (MIG Trading Station)
OS : Windows 2003 Server 5.2 Service Pack 1 (Build 3790)
Processors : 2, type 586, level 15
Memory : 1048012/340592 kb
Exception : C0000005
Address : 00475D49
Access Type : read
Access Addr : 4008FEB9
Registers : EAX=00F4AEC8 CS=001b EIP=00475D49 EFLGS=00010246
: EBX=01F49CFC SS=0023 ESP=02F1FF2C EBP=02F1FF60
: ECX=00000001 DS=0023 ESI=4008FCB9 FS=003b
: EDX=00000040 ES=0023 EDI=01F49D04 GS=0000
Stack Trace : 00466FD4 0044FEC5 77BCB530 77E66063
: 00000000 00000000 00000000 00000000
: 00000000 00000000 00000000 00000000
: 00000000 00000000 00000000 00000000
Modules :
1 : 003D0000 00017000 C:\WINDOWS\system32\odbcint.dll
2 : 00400000 002E8000 C:\Program Files\MIG Trading Station\terminal.exe
3 : 014F0000 002C5000 C:\WINDOWS\system32\xpsp2res.dll
4 : 02060000 00015000 C:\WINDOWS\system32\nvwddi.dll
5 : 02530000 00041000 C:\Program Files\MIG Trading Station\experts\libraries\printme2.dll
6 : 10000000 0016E000 C:\WINDOWS\system32\nview.dll
7 : 4BF70000 0003D000 C:\WINDOWS\system32\ODBC32.dll
8 : 5CCF0000 0000F000 C:\WINDOWS\system32\SAMLIB.dll
9 : 5F270000 00059000 C:\WINDOWS\system32\hnetcfg.dll
10 : 71AE0000 00008000 C:\WINDOWS\System32\wshtcpip.dll
11 : 71B20000 00041000 C:\WINDOWS\system32\mswsock.dll
12 : 71B70000 00036000 C:\WINDOWS\system32\UxTheme.dll
13 : 71BB0000 00009000 C:\WINDOWS\system32\WSOCK32.dll
14 : 71BF0000 00008000 C:\WINDOWS\system32\WS2HELP.dll
15 : 71C00000 00017000 C:\WINDOWS\system32\WS2_32.dll
16 : 72D60000 00008000 C:\WINDOWS\system32\msacm32.drv
17 : 72D70000 00009000 C:\WINDOWS\system32\wdmaud.drv
18 : 73EB0000 00121000 C:\WINDOWS\system32\MFC42.DLL
19 : 76190000 00012000 C:\WINDOWS\system32\MSASN1.dll
20 : 761B0000 00093000 C:\WINDOWS\system32\CRYPT32.dll
21 : 76280000 00005000 C:\WINDOWS\system32\MSIMG32.dll
22 : 762B0000 0004A000 C:\WINDOWS\system32\comdlg32.dll
23 : 76AA0000 0002D000 C:\WINDOWS\system32\WINMM.dll
24 : 76B70000 0000B000 C:\WINDOWS\system32\PSAPI.DLL
25 : 76BB0000 0002B000 C:\WINDOWS\system32\WINTRUST.dll
26 : 76C10000 00029000 C:\WINDOWS\system32\imagehlp.dll
27 : 76F10000 0002E000 C:\WINDOWS\system32\WLDAP32.dll
28 : 77210000 000A8000 C:\WINDOWS\system32\WININET.dll
29 : 77380000 00092000 C:\WINDOWS\system32\USER32.dll
30 : 77420000 00103000 C:\WINDOWS\WinSxS\X86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.1830_x-ww_7AE38CCF\COMCTL32.dll
31 : 77670000 00134000 C:\WINDOWS\system32\ole32.dll
32 : 77B60000 00007000 C:\WINDOWS\system32\midimap.dll
33 : 77B70000 00014000 C:\WINDOWS\system32\MSACM32.dll
34 : 77B90000 00008000 C:\WINDOWS\system32\VERSION.dll
35 : 77BA0000 0005A000 C:\WINDOWS\system32\msvcrt.dll
36 : 77C00000 00048000 C:\WINDOWS\system32\GDI32.dll
37 : 77C50000 0009F000 C:\WINDOWS\system32\RPCRT4.dll
38 : 77D00000 0008C000 C:\WINDOWS\system32\OLEAUT32.dll
39 : 77DA0000 00052000 C:\WINDOWS\system32\SHLWAPI.dll
40 : 77E00000 00022000 C:\WINDOWS\system32\NTMARTA.DLL
41 : 77E40000 00102000 C:\WINDOWS\system32\kernel32.dll
42 : 77F50000 0009C000 C:\WINDOWS\system32\ADVAPI32.dll
43 : 7C800000 000C0000 C:\WINDOWS\system32\ntdll.dll
44 : 7C8D0000 00803000 C:\WINDOWS\system32\SHELL32.dll
Call stack :
00472AEE:325B [00475D49] ?ExecuteStaticAsm@CExpertInterior
00466DAE:0226 [00466FD4] ?RunExpertInt@CExpertInterior
0044FEA5:0020 [0044FEC5] ?ThreadFunctionRun@CExpert
77BCB48D:00A3 [77BCB530] _endthreadex [C:\WINDOWS\system32\msvcrt.dll]
77E65F78:00EB [77E66063] GetModuleFileNameA [C:\WINDOWS\system32\kernel32.dll]
Does anyone know what is causing this?
Thanks,
Mike