problem in generated code: 'Invalid arg 6: Cannot coerce a SDWORD to SDWORD*'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem in generated code: 'Invalid arg 6: Cannot coerce a SDWORD to SDWORD*'

Oli Bye-2
Hi,

I've used the ActiveX Component Wizard to wrap up TAPI, but I'm having a
type coerce problem in the generated code.

It has generated this public method:-

registerCallNotifications: pAddress fMonitor: fMonitor fOwner: fOwner
lMediaTypes: lMediaTypes lCallbackInstance: lCallbackInstance
    "Answer the <SDWORD> result of invoking the COM Object's
RegisterCallNotifications() method.
    Helpstring: 'method RegisterCallNotifications'"
    | answer |
    answer := (SDWORD new).
    self
    RegisterCallNotifications: pAddress
    fMonitor: fMonitor
    fOwner: fOwner
    lMediaTypes: lMediaTypes
    lCallbackInstance: lCallbackInstance
    plRegister: answer.
    ^answer asObject

Which then calls this private method:-

RegisterCallNotifications: pAddress fMonitor: fMonitor fOwner: fOwner
lMediaTypes: lMediaTypes lCallbackInstance: lCallbackInstance plRegister:
plRegister
    "Private - Invoke the RegisterCallNotifications() method of the COM
object wrapped by the receiver.
    Helpstring: 'method RegisterCallNotifications'
    HRESULT __stdcall RegisterCallNotifications(
    [in] ITAddress* pAddress,
    [in] VARIANT_BOOL fMonitor,
    [in] VARIANT_BOOL fOwner,
    [in] long lMediaTypes,
    [in] long lCallbackInstance,
    [out, retval] long* plRegister);
    "
    <virtual stdcall: hresult 12 TAPI3LibITAddress* varbool varbool sdword
sdword sdword*>
    ^self invalidCall

All looks fine but evaulating the following in the workspace throws an
exception on the last line.

container := tapi queryInterface: IConnectionPointContainer.
point := container findConnectionPoint:
TAPI3LibITTAPIDispatchEventNotification.
handler := LoggingTAPIEventNotification new.
callback := point advise: (handler queryInterface: IUnknown).
reply := tapi registerCallNotifications: address fMonitor: true fOwner:
false lMediaTypes: 8 lCallbackInstance: callback.

12:19:14, 19/11/2001: 'Invalid arg 6: Cannot coerce a SDWORD to SDWORD*'
TAPI3LibITTAPI(ExternalStructure)>>invalidCall
TAPI3LibITTAPI>>RegisterCallNotifications:fMonitor:fOwner:lMediaTypes:lCallb
ackInstance:plRegister:
TAPI3LibITTAPI>>registerCallNotifications:fMonitor:fOwner:lMediaTypes:lCallb
ackInstance:
UndefinedObject>>{unbound}doIt
CompiledExpression>>value:
SmalltalkWorkspace>>evaluateRange:ifFail:debug:
SmalltalkWorkspace>>evaluateItIfFail:debug:
SmalltalkWorkspace>>evaluateItIfFail:
SmalltalkWorkspace>>inspectIt
Symbol>>forwardTo:
[] in Command>>value
BlockClosure>>ifCurtailed:
BlockClosure>>ensure:
Command>>value
SmalltalkWorkspaceDocument(Shell)>>performCommand:
CommandQuery>>perform
DelegatingCommandPolicy(CommandPolicy)>>route:
[] in ShellView(View)>>onCommand:
BlockClosure>>ifCurtailed:
BlockClosure>>ensure:
Cursor>>showWhile:
ShellView(View)>>onCommand:
ShellView(View)>>wmCommand:wParam:lParam:
ShellView(View)>>dispatchMessage:wParam:lParam:
[] in InputState>>wndProc:message:wParam:lParam:cookie:
BlockClosure>>ifCurtailed:
ProcessorScheduler>>callback:evaluate:
InputState>>wndProc:message:wParam:lParam:cookie:
ShellView>>translateAccelerator:
ShellView>>preTranslateKeyboardInput:
ShellView(View)>>preTranslateMessage:
InputState>>preTranslateMessage:
InputState>>pumpMessage:
InputState>>loopWhile:
InputState>>mainLoop
[] in InputState>>forkMain
ExceptionHandler(ExceptionHandlerAbstract)>>markAndTry
[] in ExceptionHandler(ExceptionHandlerAbstract)>>try:
BlockClosure>>ifCurtailed:
BlockClosure>>ensure:
ExceptionHandler(ExceptionHandlerAbstract)>>try:
BlockClosure>>on:do:
[] in BlockClosure>>newProcess