Hello guys,

truth is that I'm new to COM but I have some experience with asm coding. I need to create small OCX webserver which will handle just file uploads. I tried to assemble Ernies and Japhets examples of AsmCtrl without success. My config is W2K SP3, MASM8, RadASM. By assembling Ernie's example I'm getting this:
in AsmCtrl.asm

error A2111: conflicting parameter definition --> line 336 = AboutBox PROC this_:DWORD
error A2137: too few arguments to INVOKE --> line 525 = invoke AboutBox,this_

I tried to insert "AboutBox PROTO :DWORD" but without any luck. Still same error by make.

with Japheth's example I got:
error A2004: symbol type conflict : LPSTREAM --> objidl.inc, line 197 = LPSTREAM typedef ptr IStream
error A2004: symbol type conflict : PVOID --> oaidl.inc, line 21 = PVOID typedef ptr
error A2004: symbol type conflict : LPWSTR --> oaidl.inc, line 25 = LPWSTR typedef ptr WORD
error A2111: conflicting parameter definition --> asmctrl.inc, line 99, DEFINE_COMHELPER macro on line 6

after I changed names of LPSTREAM to newLPSTREAM and so on... I get rid of first A2004 errors but error in the macro was with definition of lstrlenW function in OleCntrl.inc like this:

OleCntrl.inc line 1270 = lstrlenW proto pStr:ptr word
what I changed in lstrlenW proto :DWORD because this function is used in

LocalToWideChar PROC public pWide:LPWSTR, pLocal:LPSTR, dwChars:DWORD

mov eax, pWide
mov WORD PTR , 0

ifdef UNICODE
invoke lstrcpyn, pWide, pLocal, dwChars
else
invoke MultiByteToWideChar, CP_ACP, 0, pLocal, -1, pWide, dwChars
endif

invoke lstrlenW, pWide

ret
LocalToWideChar ENDP

then I was able to assemble it without errors but by linking I got these errors:

Creating library AsmCtrl.lib and object AsmCtrl.exp
asmctrl.obj : error LNK2001: unresolved external symbol _GUID_NULL
asmctrl.obj : error LNK2001: unresolved external symbol _IID_IUnknown
and so on... whole bunch of them

Does anybody know what I'm doing wrong, problem is that examples will not even build in original state so if somebody succseded in that problem can be on my machine. I hope somebody can advice my.

Thanks

frankie
Posted on 2003-05-02 02:28:33 by frankie
well guys after some struggling I managed to build Ernie's example by fixing of AboutBox procedure definition to:



myAboutBox PROTO :DWORD



but there is problem with this ocx. When I try to insert it in MSVC TestContainer its crashing with err message "referenced memory could not be written". What's wrong with this? Regarding Japheth's example I'm still getting bunch of "error LNK2001: unresolved external symbol" like this:



Assembling: asmctrl.asm
Assembling: casmclass.asm
Creating library AsmCtrl.lib and object AsmCtrl.exp
asmctrl.obj : error LNK2001: unresolved external symbol _GUID_NULL
asmctrl.obj : error LNK2001: unresolved external symbol _IID_IUnknown
casmclass.obj : error LNK2001: unresolved external symbol _IID_IUnknown
asmctrl.obj : error LNK2001: unresolved external symbol _IID_IClassFactory
casmclass.obj : error LNK2001: unresolved external symbol _IID_IPersist
casmclass.obj : error LNK2001: unresolved external symbol _IID_IPersistStorage
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleObject
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleWindow
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleInPlaceFrame
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleInPlaceObject
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleInPlaceActiveObject
casmclass.obj : error LNK2001: unresolved external symbol _IID_IViewObject
casmclass.obj : error LNK2001: unresolved external symbol _IID_IViewObject2
casmclass.obj : error LNK2001: unresolved external symbol _IID_IDispatch
casmclass.obj : error LNK2001: unresolved external symbol _IID_IProvideClassInfo
casmclass.obj : error LNK2001: unresolved external symbol _IID_IEnumConnections
casmclass.obj : error LNK2001: unresolved external symbol _IID_IConnectionPoint
casmclass.obj : error LNK2001: unresolved external symbol _IID_IEnumConnectionPoints
casmclass.obj : error LNK2001: unresolved external symbol _IID_IConnectionPointContainer
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleInPlaceSite
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleControl
casmclass.obj : error LNK2001: unresolved external symbol _IID_IOleControlSite
casmclass.obj : error LNK2001: unresolved external symbol _IID_IPersistStreamInit
casmclass.obj : error LNK2001: unresolved external symbol _IID_IPersistPropertyBag
casmclass.obj : error LNK2001: unresolved external symbol _IID_ISpecifyPropertyPages
casmclass.obj : error LNK2001: unresolved external symbol _CLSID_StockFontPage
casmclass.obj : error LNK2001: unresolved external symbol _CLSID_StockColorPage
AsmCtrl.dll : fatal error LNK1120: 26 unresolved externals


Well Japheth's build is not crashing TestContainer. I just can't build him :grin:
I would be really happy if some of our COM guru can point me what's wrong.

Thanks in advance

frankie
Posted on 2003-05-02 09:23:20 by frankie
Hi frankie,

these - very annoying - errors are due to some incompatible changes made in MASM32 V8.0. The example was build with MASM32 V7. To get these missing IIDs dont use the libs from MASM32, but those from the SDK (or from MASM32 V7)

Japheth
Posted on 2003-05-02 11:46:17 by japheth
I will surely try it,

that was also my consideration, but I dint want to install complete MASM7 package just to try that. Now when I know I will do that. Thanks anyway. :alright: Then when I will have time I try to optimize it for MASM8.

Thanks

regards

frankie
Posted on 2003-05-02 15:50:59 by frankies
Looks like I should revisit the samples and make some updates.

Sorry, I'm still using MASM 7-something, and windows.inc 1.19

They ain't broke so I don't fix em.
Posted on 2003-05-04 22:51:59 by Ernie