|
Hi, I've been working with Ole DB and I'd like to be in touch with people who work with it too, because there is a lack of information on this matter. What we can find on microsoft's examples is raw code..Maybe we can open a forum here...what do you think...send comments
Willie
W. Zayas
|
|
|
|
|
I am trying to wrap a text using DrawText function with DT_WORDBREAK and even DT_CALCRECT, but I am not getting correct results…..
I need clear information regarding this problem…. Thx
|
|
|
|
|
Hamzeh wrote:
I am not getting correct results…..
Need more info.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
Take a look at the code for the DrawTheText member function in Davide Calabro's CButtonST v3.7 (MFC Flat buttons)[^] article here on CP.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Hi,
I´ve been using the Crypto API to sign digital messages.
Everything works fine under windows 2000, but when I try
to sign a message under windows 9x it just doesn´t work.
After I click the button the system brings nothing back as
if hasn´t found the certificate.
The code executed for retrieving the certificate is:
if(myCert.FindBySerialNumber(issuer,sn))<br />
if(m_cryptmsg.SignMessage(&myCert,m_texto,&pbData, <br />
&cbData))<br />
{<br />
blob = new CCryptoBlob( pbData, cbData );<br />
m_lpRet = (LPSTR)blob->ToBase64(); <br />
blob->Release(); <br />
}<br />
else<br />
_tcscpy(m_lpRet,_T(""));
Is there anything that should be done different for it to
work under Win 9x?
Thanks in advance
|
|
|
|
|
I have an application that has a tab-page on which some controls can be placed. These controls are created in a DLL. When I try to delete these controls from within the DLL I get an assertion failure in the CWnd::DestroyWindow of the controls at ASSERT(m_hWnd == hWndOrig); . Anyone know how to fix this? ...it is realy anoying me.
<br />
BOOL CWnd::DestroyWindow()<br />
{<br />
if (m_hWnd == NULL)<br />
return FALSE;<br />
<br />
CHandleMap* pMap = afxMapHWND();<br />
ASSERT(pMap != NULL);<br />
CWnd* pWnd = (CWnd*)pMap->LookupPermanent(m_hWnd);<br />
#ifdef _DEBUG<br />
HWND hWndOrig = m_hWnd;<br />
#endif<br />
<br />
#ifdef _AFX_NO_OCC_SUPPORT<br />
BOOL bResult = ::DestroyWindow(m_hWnd);<br />
#else //_AFX_NO_OCC_SUPPORT<br />
BOOL bResult;<br />
if (m_pCtrlSite == NULL)<br />
bResult = ::DestroyWindow(m_hWnd);<br />
else<br />
bResult = m_pCtrlSite->DestroyControl();<br />
#endif //_AFX_NO_OCC_SUPPORT<br />
<br />
if (pWnd != NULL)<br />
{<br />
#ifdef _DEBUG<br />
ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);<br />
#endif<br />
}<br />
else<br />
{<br />
#ifdef _DEBUG<br />
ASSERT(m_hWnd == hWndOrig);<br />
#endif<br />
Detach();<br />
}<br />
return bResult;<br />
}<br />
|
|
|
|
|
What's the value of bResult before the assertion fails ?
~RaGE();
|
|
|
|
|
When the assertions fails:
bResult = TRUE
m_hWnd = 0x00000000
hWndOrig = 0x000408e6
|
|
|
|
|
I do not understand why it souhld _not_ cause an assertion here. You destroy the window (since bResult is true) so m_hWnd is NULL, so pWnd is NULL, so m_hWnd cannot be equal to m_hWnd since it takes the original value of hWndOrig with HWND hWndOrig = m_hWnd; . I really do not see the point in all this
~RaGE();
|
|
|
|
|
I cannot figure it out either, some source comment would have been handy. Also, I can not find anything about this problem on the whole damn internet (google search). I guess I just have to put up with it and try to restain myself from smashing my keyboard.
|
|
|
|
|
Are you using the AFX_MANAGE_STATE( ) macro at the top of the function in the dll that destroys the window?
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
That's It! I thought I already added it, but I hadn't done so in the destructor. Thanx !
|
|
|
|
|
hi, just implemented in-place editing for list control as illustrated by:S.Prabhakarreddy / CodeProject
Reference: http://www.codeproject.com/listctrl/editing_subitems_in_listcontrol.asp
QUESTION 1: How can I use arrow keys (Keyboard) to navigate around the list control?
QUESTION 2: The implementation at the moment is such that you click on a cell, type and press ENTER. But what's better is click, type and press ARROW key. But how? I tried OnKeyDown for the dialog class. But not much luck.
QUESTION 3: Seems like ListView_GetSubItemRect is not doing its job properly... the following is code in message handler for click on list control:
// this macro is used to retrieve the Rectangle
// of the selected SubItem
ListView_GetSubItemRect(
hWnd1,
temp->iItem,
temp->iSubItem,
LVIR_BOUNDS,
&rect);
//Why +13? It's just trial and error. Seems like ListView_GetSubItemRect is not doing its job properly.
::SetWindowPos(::GetDlgItem(m_hWnd,IDC_EDIT1),
HWND_TOP,
rect.left +13, //You need to compensate for the deviation u get from ListView_GetSubItemRect!?!
rect.top +13,
rect.right-rect.left,
rect.bottom-rect.top,
NULL);
Thanks!
norm
|
|
|
|
|
If you want to be able to jump between cells using arrow keys you have to intercept them in the editbox itself because the editbox receives the keydown event. I did similar things once (using the TAB key to move between cells) and the code looked something like this:
<br />
<br />
void CInPlaceEdit::OnChar( UINT nChar, UINT nRepCnt, UINT nFlags )<br />
{<br />
if ( nChar == VK_TAB )<br />
{<br />
if ( GetKeyState( VK_SHIFT ) < 0 )<br />
{<br />
m_pListCtrlParent->OnPreviousCell( );<br />
}<br />
else<br />
{<br />
m_pListCtrlParent->OnNextCell( );<br />
}<br />
}<br />
}<br />
<br />
where m_pListCtrlParent is a pointer to the parent Listctrl. It contains the method called in the code and these methods basically do this:
- grab the focus (because the edit box knows that it should disappear when it loses focus)
- calculate the next cell to be edited
- initiate the edit for that cell
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
how do i use the LogonUser and CreateProcessAsUser functions together to create processes in windows xp?
|
|
|
|
|
The solution here =)
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q180548
Simplicity is the supreme sophistication.
-------------------------------------------
http://www.borie.org/
|
|
|
|
|
Hi,
I am storing password with a database table and would like to encrypty them to a reasonable level. Is there any standard windows api function that could help me? relucltant to use a third-party library.
Can anyone offer me any advice.
Cheers
Rich
|
|
|
|
|
There is a MFC Sample for _file_ encryption, but you won't escape CryptoAPI for passwords, I think.
~RaGE();
|
|
|
|
|
Just pass the password through a suitable one way hash function
like MD5 or SHA. Store the hash value. When the user enters
password, compute the hash and check against stored value.
The algorithms are pretty easy to just include in your source
files.
example here.[^]
[edit] That assumes you just need to validate entered passwords, not use them... [edit]
|
|
|
|
|
Hi,
What I have to use to develop a stand alone application with which one can VOICE CHAT with other OVER INTERNET
I don't want to use TAPI or DirectPlay or NetMeeting SDK. What are other options with which I can develop Voice Conferencing over Internet application.
|
|
|
|
|
|
I have a CWinThread derived class CMyThread. I create modalless dialog :
BOOL CManThread::InitInstance()
{
m_dlg.Create(IDD_DIALOG);
m_dlg.ShowWindow(SW_SHOW);
return TRUE;
}
Dialog works fine, but how to notify my thread when dialog is closed, so that i could sent WM_QUIT message to end the thread ?
Thanks
rrrado
|
|
|
|
|
You may override OnOK() or OnCancel() function in your dialog class, and send a WM_QUIT at that moment.
~RaGE();
|
|
|
|
|
thanks, but I tried to call m_thread->PostThreadMessage(WM_QUIT,0,0) inside of OnCancel. But after closing of dialog some Asssertion fails and application crashes.
rrrado
|
|
|
|
|
If all your thread does is create the modeless dialog, you don't need the thread at all. Just create the dialog and presto.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|