Creating ocx

Fabian Cenedese Cenedese at
Mon Sep 2 07:27:43 CDT 2002


I have a problem with an ocx (not with WineDbg this time :). To create it I do:

CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, 
nID,pPersist, bStorage, bstrLicKey);

which works fine in windows (NT4), but in Wine-20020804 I get the following:

First chance exception: e06d7363 in 32-bit code (0x400d5ee5).
Register dump:
  CS:0023 SS:002b DS:002b ES:002b FS:008f GS:0000
  EIP:400d5ee5 ESP:405c4e18 EBP:405c4e70 EFLAGS:00000246(   - 00  I  Z- -P1 )
  EAX:405c4e20 EBX:4010ca04 ECX:00000000 EDX:405c4e34
  ESI:405c4f4c EDI:00000000
Stack dump:
0x405c4e18 (_end+0x265cf4):  4010ca04 400ca2f2 e06d7363 00000001
0x405c4e28 (_end+0x265d04):  00000000 400d5e70 00000003 19930520
0x405c4e38 (_end+0x265d14):  405c4f84 5f4bb5d8 405c4ecc 400fbc9c
0x405c4e48 (_end+0x265d24):  405c4e74 00000400 405c4f58 405c4e80
0x405c4e58 (_end+0x265d34):  4010ca04 400da28a 00000002 40123a68
0x405c4e68 (_end+0x265d44):  00000058 40129d48 405c4e90 400ca303
0x405c4e78 (_end+0x265d54):

0011: sel=008f base=401225c0 limit=00000fff 32-bit rw-
=>0 0x400d5ee5 (RaiseException+0x75(code=0xe06d7363, flags=0x1, nbargs=0x3, 
args=0x405c4f4c) [except.c:81] in (ebp=405c4e70)
   1 0x400ca303 (call_stdcall_function+0xc3(func=0x400d5e70, nb_args=0x4, 
args=0x405c4f20) [relay386.c:327] in (ebp=405c4e90)
   2 0x400ca6e8 (RELAY_CallFrom32+0x148(ret_addr=0x7800ac4e) 
[relay386.c:400] in (ebp=405c4f14)
   3 0x4076fed5 (KERNEL32.DLL.TryEnterCriticalSection+0x2b59 in (ebp=405c4f58)
   4 0x5f47d5b1 (MFC42.DLL.1269+0x4d in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   5 0x5f48ceab (MFC42.DLL.2464+0x11c in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   6 0x5f423445 (MFC42.DLL.4035+0x51 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   7 0x5f42348d (MFC42.DLL.6095+0x43 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   8 0x5f423520 (MFC42.DLL.5719+0x28 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   9 0x5f42375d (MFC42.DLL.6198+0x14 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   10 0x5f421996 (MFC42.DLL.6621+0x86 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   11 0x5f42168b (MFC42.DLL.6623+0x3f in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   12 0x5f421647 (MFC42.DLL.2135+0x59 in C:\WINDOWS\SYSTEM\MFC42.DLL) 
   13 0x3001e1ad (CIXOutWinView::Create+0x43(lpszWindowName=0x406cb3f0, 
dwStyle=0x50300000, rect=0x405c5244, pParentWnd=0x41568c60, nID=0x1320, 
ExtStyle=0x200, pPersist=0x0, bStorage=0x0, bstrLicKey=0x0) 
[N:\IMD\Imex\Src\IXOutWin.cpp:167] in C:\IMD\BIN\IMEX.DLL) (ebp=405c520c)
(here is the above mentioned CreateControl)

0x400d5ee5 (RaiseException+0x75 [except.c:81] in leal 
81          RtlRaiseException( &record );

It finds the .ocx so that shouldn't be a problem. The registry should be 
correct too as other ocx's I have work fine, all installed with the same 
setup. This is also the reason why I believe it's something inside the ocx 
code. The exception code e06d7363 means float inexact result or so, but I 
never used float or double or any 64 bit integer. The OnCreate and 
OnFontChanged of the ocx are called and left successfully.

I traced it down to this (shortly after OnFontChanged is left, maybe some 
painting done):

08153fd8:Call kernel32.lstrlenA(405c5062 "\016") ret=5f418414
08153fd8:Ret  kernel32.lstrlenA() retval=00000001 ret=5f418414
08153fd8:Call kernel32.lstrlenA(406cb3f0 "") ret=5f4184ce
08153fd8:Ret  kernel32.lstrlenA() retval=00000000 ret=5f4184ce
08153fd8:Call kernel32.MultiByteToWideChar(00000000,00000000,406cb3f0 
"",ffffffff,405c4f88,00000001) ret=5f4184f9
08153fd8:Ret  kernel32.MultiByteToWideChar() retval=00000001 ret=5f4184f9
08153fd8:Call kernel32.GetProcAddress(65340000,00000002) ret=5f405724
08153fd8:Ret  kernel32.GetProcAddress() retval=65341408 ret=5f405724
08153fd8:Call kernel32.IsBadReadPtr(405c4f98,00000020) ret=42622bce
08153fd8:Ret  kernel32.IsBadReadPtr() retval=00000000 ret=42622bce
08153fd8:Call kernel32.IsBadReadPtr(405c4fd8,00000004) ret=42622bce
08153fd8:Ret  kernel32.IsBadReadPtr() retval=00000000 ret=42622bce
08153fd8:Call ntdll.RtlSizeHeap(40360000,00000000,403c0738) ret=65f019c3
trace:heap:RtlSizeHeap (40360000,00000002,403c0738): returning 00000020
08153fd8:Ret  ntdll.RtlSizeHeap() retval=00000020 ret=65f019c3
08153fd8:Call kernel32.RaiseException(e06d7363,00000001,00000003,405c4f4c) 

65340000 is the handle for the OLEAUT32.DLL, function 2 seems to be 
SysAllocString but it doesn't seem to get there (at least I never see my 
message in the log file)..

Any ideas how I can find out what goes wrong (inside the MFC42.dll)?



More information about the wine-devel mailing list