|
void CDZApp::OnLinkButtonClicked()
{ ShellExecute(NULL, _T("open"), "http://www.dzgraphics.com/", NULL,NULL, SW_SHOW); }
that would be the code for a button.. i havent used any hyperlink controls that underline, or make the link blue or anything.. try searching here on CP..
-dz
|
|
|
|
|
http://www.codeproject.com/miscctrl/hyperlink.asp
ur welcome!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
Recently in my dealings with Winsock, I have noticed that Windows CE implementation of Winsock seems to be more robust than the Win32 version.
Window CE supports SSL version 2 and 3 simply by calling a couple of additional functions.
Why does the Win32 version of Winsock not support this feature, and is there something similar I am missing on the straight Win32 platform?
This seems incredibly silly that MS would implement such a great feature on JUST the CE platform?
. djrisc .
|
|
|
|
|
I inherited from CWnd and I want that my wnd wont have a taskbar icon.
It's created by CreateEx(), Style - WS_POPUP.
I know bout' the article discussing removing TB-icon in CDialog base appz.
This does'nt work in my case;
HEEEELLLLPPPP!!!!!
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
I have a problem with my app when displaying a MessageBox to indicate an error. I display the message box in a losingFocus callback, if the value of a dialog field is out of range. Most times the message box behaves correctly. The problem occurs when the user clicks in a window outside the application, the message box gets displayed and keeps reappearing when the OK button is pressed. This will continue for 10-20 times before the dialog will stop appearing. I have tried all three of the modality values (MB_APPLMODAL, MB_SYSTEMMODAL, MB_TASKMODAL) with the same results.
Any suggestions as to how I can make the messagebox behave properly when the user clicks outside my application?
Thanks in advance,
Bob
|
|
|
|
|
Could you post that part of the code please?
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I think I need to determine if the focus is going to a window outside my app. How do I do that?
Here is the code.
void DataImportDlg2::OnKillfocusProtocolNameCb()
{
CString protoName;
m_protocolNameCB.GetWindowText(protoName);
if (protoName.GetLength() > 0)
{
int index = m_protocolNameCB.FindStringExact(0, protoName);
if (index == CB_ERR)
{
MessageBox (_T ("Protocol does not exist, to create it, use the Create Protocol button"),
_T ("Data Import"),
MB_ICONERROR | MB_OK | MB_APPLMODAL | MB_TOPMOST);
m_protocolNameCB.SetFocus();
}
Thanks,
Bob
|
|
|
|
|
I am trying to determine if the control that focus is going to next is on my app's window. Here is how I am attempting to do this
void DataImportDlg2::OnKillfocusProtocolNameCb(CWnd* pNewWnd )
{
CString protoName;
CWnd *pMainWnd = (CWnd *) AfxGetMainWnd();
BOOL child = pMainWnd->IsChild(pNewWnd);
When I click on a control on my apps window, the IsChild returns FALSE. I would expect it to return TRUE.
What am I doing wrong?
Thanks in advance,
Bob
|
|
|
|
|
Well, this won't work because the control is the child of your View class; not the CMainFrame class.
I have two suggestions: The first one is the easier way: Don't try to validate the data everytime you loose focus. Instead, validate it when the user clicks on OK button.
If you want to do it whenever the window looses focus do it this way: Create a bool variable as a member of your view. Lets say m_bChildHasFocus
Now, whenever the control gets the focus set the variable to true and whenever it looses set it false. Here is the code:
void DataImportDlg2::OnKillfocusProtocolNameCb()
{
if (!m_bChildHasFocus)
return CView::OnKillFocus();
m_bChildHasFocus = false;
CString protoName;
m_protocolNameCB.GetWindowText(protoName);
if (protoName.GetLength() > 0)
{
int index = m_protocolNameCB.FindStringExact(0, protoName);
if (index == CB_ERR)
{
MessageBox (_T ("Protocol does not exist, to create it, use the Create Protocol button"),
_T ("Data Import"),
MB_ICONERROR | MB_OK | MB_APPLMODAL | MB_TOPMOST);
m_protocolNameCB.SetFocus();
m_bChildHasFocus = true;
}
Also, don't forget to add the OnGetFocus function. In OnGetFocus functions, just set m_bChildHasFocus = true .
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
Hi
I would need your help, I need to add text in my multiline EditBox when a user clicks on the appropriate link on the menu.
I use a Dialog-based Application.
Thanks for helping me!
|
|
|
|
|
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_MyEdit);
ASSERT (pEdit != NULL);
CString strText;
pEdit->GetWindowText (strText);
strText += "Added text";
pEdit->SetWindowText (strText);
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
CString szContent = "...";
myeditbox.SetSel(0,-1); // Ctrl-A
myeditbox.ReplaceSel( szContent.GetBuffer(0) ); // Paste
And I swallow a small raisin.
|
|
|
|
|
Sorry but I'm working on a HTML Editor and your both methods works, but not for the type of project I'm working on.
I want to add text at my cursor's position in my edit box, and someone told me I had to use ReplaceSel.
Anyways, please tell me what I have to do.
Thanks a lot!
|
|
|
|
|
This is what MSDN says on recv
If the socket is connection oriented and the remote side has shut down the connection gracefully, and all data has been received, a recv will complete immediately with zero bytes received. If the connection has been reset, a recv will fail with the error WSAECONNRESET.
and then
If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.
The first paragraphs says if all data has been received. Is there ever a case where recv returns 0 for a few cycles but then continues receiving data or does 0 mean dead?
Todd Smith
|
|
|
|
|
If recv returns 0, it means that the peer has close the connection on its side. In fact, recv will block if the connection is still open but there is no data to be read. All data has been received means that previous call(s) to recv returned data and there is no more to be read and the connection is closed by the peer.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
If you're using blocking sockets then recv will block if there's no data to return.
If you're using non-blocking sockets then recv will return SOCKET_ERROR and WSAGetLastError will return WSAEWOULDBLOCK .
If the call to recv returns 0 then it means that the connection has been shutdown cleanly and there's no more data to come through.
Len Holgate
www.jetbyte.com
The right code, right now.
|
|
|
|
|
Does anyone know the basics for merging 2 mediafiles together, one after eachother, using direct show?
I can copy a sourcefile to a destfile, mix 2 sourcefiles OVER eachother, but I can not merge them one AFTER another.
I'm using DShow 8.1
Which filter should I use?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
the vidclip sample from the DirectX SDK should be used as the starting point. it translates any format to any format, and that should be easy to do an append instead,
And I swallow a small raisin.
|
|
|
|
|
Could you tell me the dx-version number that contains the vidclip sample (probably 6)? Cause dx8 doesn't have such a sample.
And if you know the place to download that sample (or sdk), it'll be welcome.
btw. I've tried several things, also a simple append, but then it writes again from the start. So, stopping your graph equals a rewind to the start (I guess, msdn docs are not too detailed about that, but what are they huh .
tnx
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I work on a dialog box. I want that when you press VK_RETURN or VK_TAB or VK_DOWN, you will go to the next control. I use accelerator. When one of this key is pressed a relating command arrived and then I launch NextDlgCtrl to go the next. It works well. Normally when a button has the focus, a dotted rectangle appears on it, but in this case with W2k it never appear (with NT it works well). More strange, if you press ALT+TAB go to another application and come back, it begins to work. I do not understand. Is Somebody have an explanation.
|
|
|
|
|
what is the difference between those two functions?
|
|
|
|
|
Is there anyway to make an window that shows the content while moving(dragging), the toolbars don't have this also if i disable that option on the main window setting i won't see the content, so i want to make something to this, could anybody help me?
|
|
|
|
|
Yaw.
Does anybody familiar with some API that can calculate bounding rect of a windows text (Considering the font) ???
Appreciated...
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
You need a DC and the font to correctly do this:
CDC *pDC = GetDC(NULL) ;
pDC->SaveDC() ;
CFont *pFont = GetDlgItem(IDC_CONTROL)->GetFont() ;
if (pFont != NULL)
pDC->SelectObject(pFont) ;
CSize size = pDC->GetTextExtent("Some text") ;
pDC->RestoreDC(-1) ;
pDC->ReleaseDC() ;
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|