AtlThunk_InitData function

Initializes an ATL thunk.

Syntax


void __stdcall AtlThunk_InitData(
   AtlThunkData_t *Thunk,
   void           *Proc,
   size_t         FirstParameter
);

Parameters

Thunk

A non-null return value from AtlThunk_AllocateData.

Proc

See the example in remarks for more info.

FirstParameter

See the example in remarks for more info.

Return value

This function does not return a value.

Remarks

An ATL thunk has a signature of WNDPROC. See the following sample for more info on an implementation.


 LRESULT CALLBACK AtlThunk(  
   _In_ HWND   hwnd,  
   _In_ UINT   uMsg,  
   _In_ WPARAM wParam, 
   _In_ LPARAM lParam  
   )  
 {  
   static void* FirstParameter; 
   static WNDPROC Proc; 
   return Proc((HWND)FirstParameter, uMsg, wParam, lParam); 
 } 


An arbitrary number of AtlThunk functions can be created; FirstParameter and Proc are set (differently) for each one.

Requirements

Minimum supported client

Windows 10 [desktop apps only]

Minimum supported server

Windows Server 2016 [desktop apps only]

Header

Atlthunk.h

DLL

Atlthunk.dll

 

 

Show: