amigoz, quisiera saber acerca de TLS cuando usarlo en que casos me conviene usarlo y como se usa. me han recomendado usarlo pero no se como, quisiera saber mas acerca de la utilidad y de como/cuando aplicarlo, un ejemplo algo, gracias
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
bool CAppGetReso::OnInit()
{
//! Initialize all image handlers.
::wxInitAllImageHandlers();
//~ Initialize all XRC handlers.
wxXmlResource::Get()->InitAllHandlers();
//~ Return true to continue processing.
return(true);
}
VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
{
::EnterCriticalSection(&lock);
if(idEvent == pTimer)
{
KillTimer(NULL, pTimer);
ResumeThread();
}
::LeaveCriticalSection(&lock);
}
class SimpleControl
{
public:
SimpleControl (HWND hwndParent, int id)
: _hWnd (GetDlgItem (hwndParent, id))
{}
void SetFocus ()
{
::SetFocus (_hWnd);
}
// code is the HIWORD (wParam)
static BOOL IsClicked (int code)
{
return code == BN_CLICKED;
}
HWND Hwnd () const { return _hWnd; }
void Enable ()
{
EnableWindow (_hWnd, TRUE);
}
void Disable ()
{
EnableWindow (_hWnd, FALSE);
}
void SetFont (HFONT font)
{
SendMessage ( Hwnd (), WM_SETFONT, (WPARAM) font, MAKELPARAM(TRUE, 0));
}
protected:
HWND _hWnd;
};
Public Function GetTextBoxLine(hWnd As Long) As String
'INPUT: hWnd = Handle to text box
'OUTPUT: Text of specified TextBox Control
Dim lngLineCount As Long
Dim lngLineNumber As Long
Dim lngRet As Long
Dim lngLen As Long
Dim lngFirstCharPos As Long
Dim bytBuffer() As Byte
Dim strAns As String
'get number of lines
lngLineCount = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0&)
For lngLineNumber = 0 To lngLineCount - 1
'first character position of the line
lngFirstCharPos = SendMessage(hWnd, EM_LINEINDEX, lngLineNumber, 0&)
'length of line
lngLen = SendMessage(hWnd, EM_LINELENGTH, lngFirstCharPos, 0&)
ReDim bytBuffer(lngLen) As Byte
bytBuffer(0) = lngLen
'text of line saved to bytBuffer
lngRet = SendMessage(hWnd, EM_GETLINE, lngLineNumber, bytBuffer(0))
If lngRet Then
strAns = strAns & Left$(StrConv(bytBuffer, vbUnicode), lngLen)
End If
Next
GetTextBoxLine = strAns
End Function
long lngFirstCharPos = SendMessage(hWnd, EM_LINEINDEX, 0, 0);
int lngLen = SendMessage(hWnd, EM_LINELENGTH, lngFirstCharPos, 0);
chBuffer1[0] = lngLen;
long lngRet = SendMessage(hWnd, EM_GETLINE, 0, chBuffer1);
char chBuffer1[MAX_PATH];//={0};
int t1=SendDlgItemMessage(hWnd, IDC_ART1, EM_GETLINE, 0, (LPARAM)(LPSTR)chBuffer1);//LB_GETSTRING
char asd[12];
sprintf(asd, "%d", t1);
MessageBox(hWnd,chBuffer1,asd,0);
case IDC_LIST2:
switch(HIWORD(wParam))
{
case LBN_SELCHANGE:
{
}
}
INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_BUTTON7:
{
if( gbCaso == 1 )
{
/* Puedo crear el dialog box en este lugar al presionarse el boton ? */
}
}
}
}
//creo el dailogo principal
hDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIALOG1), 0, (DLGPROC)DialogProc, 0);
Citar
'type cast' : cannot convert from 'void (__thiscall EstructIny::*)(void)' to 'unsigned long'
.data
array SDWORD 10 DUP(10009h, 10002h, 10003h, 10004h, 10001h, 10006h, 10007h, 10008h, 10005h, 10010h)
len DWORD lengthof array
.code
MAIN PROC
INVOKE BBSORT, ADDR array, len
mov esi, offset array
call Funzione che visualizza parte della memoria
MAIN ENDP
BBSORT PROC USES eax ecx esi, aarr: PTR SDWORD, larr: DWORD
LOCAL part: DWORD, cloop: BYTE
mov edx, 0
mov eax, larr
mov ebx, 10
div ebx
mov ecx, 2
push edx
mov part, 0
mov cloop, 0
lp:
push ecx
mov eax, 0
cmp part, 0
je ls
mov edx, 0
mov eax, part
mul ebx
shl eax, 2
mov edx, eax
ls:
dec ecx
cmp ecx, 0
je lr
l1:
push ecx
mov ecx, ebx
dec ecx
mov esi, aarr
add esi, edx
l2:
call DumpRegs
mov eax, [esi]
cmp [esi + 4], eax
jg l3
xchg eax, [esi + 4]
mov [esi], eax
l3:
add esi, 4
loop l2
pop ecx
loop l1
mov esi, aarr
add esi, edx
inc part
pop ecx
loop lp
jmp lr
cmp cloop, 2
je lr
cmp cloop, 1
je la
pop edx
mov ecx, edx
mov part, 0
mov cloop, 1
jmp lp
la:
mov ecx, 100
mov part, 0
mov cloop, 2
jmp lp
lr:
ret
BBSORT ENDP