|
|
Hi,
I used this class some time ago. It worked fine at first. But after some time I got a strange error. I realized that the program was unable to create the socket. Then using GetLastError method, I found the error:
"Either the application has not called WSAStartup, or WSAStartup failed."
Then I called WSAStartup method in the constructor and WSACleanUp in the destructor. I am not sure if this is the correct way or not. Are there other ways to do it?
Kind regards
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
|
|
|
|
|
see :-
http://www.codeproject.com/internet/cpop3conn.asp
http://www.codeproject.com/internet/popwatch.asp
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi,
I have three problems.Please answer.
Problem 1:(BIGGEST)
-------------------
I make a call like this
OnDraw(CDC *pDC)
{
//.....
MyDrawFunction(pDC);
//....
}
Should I release the CDC * in my function because
1)When I scroll rapidly,the figures drawn by my
function looses color;
2)When I use Alt-Tab and return to my program,
the figures will be displaced.
But these things donot happen to the figures drawn by the
OnDraw function.What is the problem?
Problem 2:
---------
When I create DCs inside my function like
CDC *MyDC = GetDC(); or
CClientDC dc(this) etc
and draw with it,I find problem while scrolling.The figures get smudged.
How to avoid this?
Problem 3:
---------
The exact same thing an in Problem 2 happens when each row in a
list control uses a different color.The colors get mixed while
scrolling.
Thanx
|
|
|
|
|
Can you post your function please!
Then I perhaps can help ya!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I'm stuck with the following problem. From one application, given the handle to the parent window of another app and the controlIDs of a control (textBox, button, etc) in the app, I need to get the handle of the control in run time.
GetDlgItem() can be used to get the handles of a control in a Dialog based window, But it returns me wrong handle values when I tried with Windows explorer - a SDI based app. Could somebody please point me the approach to get the handles of the controls in a complex window full of combo box, buttons, menus and tree views?
Thanks for any help,
Wally
|
|
|
|
|
Well, you see it's impossible untill you find a SDK of it (like WinAmp) where the developers tell you you the ID of all buttons, list-boxes etc..... therefor you can reach the controls! You need the ID for alla controls and you can't get them in another app just like that!
But now when you read this messeage, try find an answer somewhere else! I can be wrong!!
But whit my research with the problem I havn't found anything that can do what I want!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Idea:
0. CreateWindow
hMenu
[in] Handle to a menu, or specifies a child-window identifier depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window.
Steps:
1. EnumChildWindows
2. GetWindowLong
GWL_ID Retrieves the identifier of the window.
It's all.
Good lack!
|
|
|
|
|
I've faced with some odd problem in my code. I have CTreeView in my app and want to display popup menu when I'd made right mouse click at some tree element. In my NM_RCLICK handler I cast pNMHDR to pointer to NMTREEVIEW structure as usuall I had done with CListCtrl - NMLISTVIEW. But after all of that when I tried to use values in ptDrag member I've get garbage only.
Thanks for any help
|
|
|
|
|
afx_msg void OnRclickTree1(NMHDR* pNMHDR, LRESULT* pResult);
ON_NOTIFY(NM_RCLICK, ID_XML_TREE, OnRclickTree1)
void C3DTabViewBar::OnRclickTree1(NMHDR* pNMHDR, LRESULT* pResult)
{
UNREFERENCED_PARAMETER(pNMHDR);
// TODO: Add your control notification handler code here
TRACE(_T("OnRclickTree1\n"));
HTREEITEM hItem = m_treeClass.GetSelectedItem();
if (hItem != NULL)
{
CCMGTreeData* pData = reinterpret_cast<ccmgtreedata*>(m_treeClass.GetItemData(hItem));
switch (pData->GetType())
{
case CCMGTreeData::REFERENCES:
DoPopupMenu(IDR_REFERENCES);
break;
case CCMGTreeData::SCHEMAS:
DoPopupMenu(IDR_SCHEMAS);
break;
}
}
*pResult = 0;
}
void C3DTabViewBar::DoPopupMenu(UINT nMenuID)
{
CMenu popMenu;
popMenu.LoadMenu(nMenuID);
CPoint posMouse;
GetCursorPos(&posMouse);
UINT uiDisable = MF_BYCOMMAND|MF_GRAYED;
UINT uiEnable = MF_BYCOMMAND|MF_ENABLED;
if (nMenuID == IDR_REFERENCES)
{
popMenu.EnableMenuItem(ID_REFERENCES_ADD_MESSAGE_DEFENITION, IsRefernceIncluded(CCMGTreeData::MESSAGE_DEFENITION) ? uiDisable: uiEnable);
popMenu.EnableMenuItem(ID_REFERENCES_ADD_CLASS_OF_SERVICE, IsRefernceIncluded(CCMGTreeData::CLASS_OF_SERVICE) ? uiDisable: uiEnable);
popMenu.EnableMenuItem(ID_REFERENCES_ADD_BALANCE_DEFENITION, IsRefernceIncluded(CCMGTreeData::BALANCE_DEFENITION) ? uiDisable: uiEnable);
}
popMenu.GetSubMenu(0)->TrackPopupMenu(0, posMouse.x, posMouse.y, this);
}
Good luck!
|
|
|
|
|
Please look DAOVIEW example from MS VisualC++.
|
|
|
|
|
Thanks a lot. It really gave me a good idea.
But look at this code:
void CLeftView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
{
unsigned char *p = (unsigned char*) pNMHDR;
p -= 4; // !!!!!!!!!!!!!
NMTREEVIEW *z = (NMTREEVIEW*) p;
CPoint ptXY = z->ptDrag;
}
It works too!!! ptXY after all of these manipulations is a real mouse coordinates
|
|
|
|
|
Trust me, your code is very bad idea for support etc, etc.
Regrds,
Sergey
|
|
|
|
|
http://www.mvps.org/vcfaq/mfc/6.htm
/* Get the mouse cursor position */
DWORD dwPos = GetMessagePos();
More simple and portable.
|
|
|
|
|
I'm working on a tutorial that will explain how to define dialog templates without using resource files but it is far from done. If you cannot wait look in MSDN Library for DLGTEMPLATE and DLGITEMTEMPLATE (or their *EX equivilent).
|
|
|
|
|
OOOOOOUUUUUUU YEAH, that would be great! I got some explanations and examples, but nothing general (and MSDN-doku is a little bit *too general*).
Do you know if it's possible to make a memory-template based DialogBar?
mfg HintifLo
|
|
|
|
|
This behaviour is because you didn't use
AfxSetResourceHandle() in the DLL.
All I need is a roadmap and then I might be able to find a clue.
|
|
|
|
|
I'm currently developing an MDI web browser and I cannot seem to find the proper logic/implimentation on how I can effective use a history list for the users navigation. What I mean is, I don't know exactly how I can implement it so that when the user click on a link, the forward history list is blanked out and the button greyed out. Does anybody know how I could possibly implement this??
TIA
|
|
|
|
|
Hi everybody!!!
How can I get the path to the registry key of my application, that uses WriteProfile...() and ReadProfile...() functions?
Best regards,
Eugene Pustovoyt
Sonork ID 100.10002:Yaumen
|
|
|
|
|
Hello,
I was wondering if there was a way to set how far an icon is from the top in a list control?
For example if I only have 1 row of items. Is it possible to center it in the list control, so that it appears to be in the middle?
Thanks in advance!
|
|
|
|
|
Hi,
I would like to know how to get the word under the cursor ,the word might be in any window of the other process.
Thanks in advance.
|
|
|
|
|
People seem to ask this question a lot, and I've yet to hear a sensible reason for doing so, or a viable solution.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
the reason why i ask this question is i want to know how some application do so, and i find this is a very useful capability .
|
|
|
|
|
Which apps do it ? I'm interested to know.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
any app that can immediately translate the word under cursor
into non-english meanings
|
|
|
|