Kevin,
We have an issue with your WITH fix.
James
Translation
Translated to wcexw.cbSize=sizeof();
James
We have an issue with your WITH fix.
James
Quote
Function CWindow_RegisterClass( szClassName As const char Ptr,hInstance As HINSTANCE,lpfnWndProc As WNDPROC) As ATOM
Dim As ATOM wAtom
Dim As WNDCLASSEXW wcexw
static As Long nCount = 0
static As char m_wszClassName[256]
If Len( szClassName) Then
m_wszClassName = szClassName
Else
m_wszClassName = "BcxWindowClass"
m_wszClassName = m_wszClassName & ":" + STR$(nCount)
EndIf
' // Default handler
If lpfnWndProc = NULL Then
lpfnWndProc = (WNDPROC)&CWindow_WindowProc
EndIf
' // Fill the WNDCLASSEXW structure
With wcexw
.cbSize = SIZEOF(wcexw)
.style = CS_DBLCLKS BOR CS_HREDRAW BOR CS_VREDRAW
.lpfnWndProc = lpfnWndProc
.cbClsExtra = 0
.cbWndExtra = SIZEOF(HANDLE)
.hInstance = hInstance
.hCursor = LoadCursor(NULL, (LPCWSTR) IDC_ARROW)
.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1)
.lpszMenuName = NULL
.lpszClassName = (LPCWSTR)&m_wszClassName
.hIcon = 0
.hIconSm = 0
End With
'' // Register the class
wAtom = RegisterClassEx(&wcexw)
'' // Increment the class counter
IF wAtom THEN
nCount = nCount + 1
'Else
' zTrace(L"CRAP")
EndIf
'' // Return the atom
Function = wAtom
End Function
Translation
QuoteBCX: .cbSize = SIZEOF(wcexw)
// *************************************************
// User's Subs and Functions
// *************************************************
ATOM CWindow_RegisterClass (const char* szClassName,HINSTANCE hInstance,WNDPROC lpfnWndProc)
{
ATOM wAtom= {0};
WNDCLASSEXW wcexw= {0};
static long nCount=0;
static char m_wszClassName[256];
if((int)strlen(szClassName)){
strcpy(m_wszClassName,szClassName);
}
else
{
strcpy(m_wszClassName,"BcxWindowClass");
strcpy(m_wszClassName, join(3,m_wszClassName,":",str(nCount)));
}
if(lpfnWndProc==NULL ){
lpfnWndProc=(WNDPROC)&CWindow_WindowProc;
}
wcexw.cbSize=sizeof();
wcexw.style=CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
wcexw.lpfnWndProc=lpfnWndProc;
wcexw.cbClsExtra=0;
wcexw.cbWndExtra=sizeof(HANDLE);
wcexw.hInstance=hInstance;
wcexw.hCursor=LoadCursor(NULL,(LPCWSTR)IDC_ARROW);
wcexw.hbrBackground=(HBRUSH)(COLOR_3DFACE+1);
wcexw.lpszMenuName=NULL;
wcexw.lpszClassName=(LPCWSTR)&m_wszClassName;
wcexw.hIcon=0;
wcexw.hIconSm=0;
wAtom=RegisterClassEx(&wcexw);
if(wAtom ){
nCount+=1;
}
return wAtom;
}
Translated to wcexw.cbSize=sizeof();
James