|
What do u meant by embedded structures in C?
|
|
|
|
|
Gjm wrote: What do u meant by embedded structures in C?
I don't know, a structure as part of another structure, I guess. And what do you mean with it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Probably something like:
struct A
{
struct
{
int a;
int b;
} embedded_struct;
int c;
};
embedded_struct is a data member of A with struct type.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello,
ANy one can guide me with the difference between SetCapture and GetCapture or articles on the same.
thanks
Pritha
|
|
|
|
|
I don't understand why you are confused between the two.
I'm sure you understand what Set and Get means.
The only similarity is in the return value which is the previous or current window that has captured the mouse.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hello,
Thanks for your reply
BUt I was confused b coz of my problem that I mentioned in my next q . So I wanted to read good articles on SetCapture
|
|
|
|
|
Hi,
I am totally new to WinAPI programming. My requirement is to extract the handler to the current window when the user clicks over it or uses Alt+Tab to navigate to the window. The definition of GetCapture should return a handler to the window that has captured the mouse.
My question is when and how can I call the GetCapture() function? My requirement is to invoke the function whenever a mouse or keyboard event occurs. Can you please guide me how my program can be alerted to a click or keyboard event.
Thanks
-Varun.
|
|
|
|
|
Hello,
I have a child window derived from CMDIChildWnd and the window has a few CRichEditCtrl derived windows displayed properly on them.
But I am confused how to write the mouse capture for this window.
When the mouse moves over the window or left button is pressed on the window the mouse click message is not handled but if I press left mouse button over te minimize,maximize icons of the windows the messsage is andled and OnSize()function is called.
Why the OnLButtonDown()message not handled in the class which is derived from CMDIChildWnd?
Pritha
|
|
|
|
|
I need an algorithm or C program by which I can compute the Strict Avalanche criterion of the nonlinear boolean functions
|
|
|
|
|
|
correlation immunity is an important criterion for boolean functions, I need an algorithm or C program to compute the correlation immunity for any boolean function.
|
|
|
|
|
alaaomar wrote: I need an algorithm or C program...
That's nice for you. Do you think you'll get one?
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
This [^] may help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Wow! What are the odds that two people with the same name would be asking the same question?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am creating an MFC based MDI type app in VS2008. I have a class structure that is mostly based on declaring objects of the lower class in the class above it - so not subclasses - but called from parents as such:
CHostApp ------------> CCommandParser
CMainFrame
COutputWnd (console type display class that I want to call a function in)
So in CMainFrame it does:
COutputWnd m_OutputWnd
and so on up the chain.
I am making a command parser class that I'm thinking really should be a static class from the at the CHostApp level. Ultimately I'm trying to call a function and pass data from
CCommandParser to COutputWnd.
What's the right syntax or methodology to do this? Do I need to make one a friend class of the other?
|
|
|
|
|
You could try the same trick done by ATL.
Make the CMainFrame class a template class.
Pass the class derived from CMainFrame as the template parameter to CMainFrame.
Something like this.
class COutputWnd : public CMainFrame<COutputWnd>
{
};
template<typename T>
class CMainFrame : public CFrameWnd
{
T m_OutputWnd;
};
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Never seen that before! I have used it for years I believe in creational patterns like factory. I'd have to go scare up some old code to verify that but I'm pretty sure.
|
|
|
|
|
Hi
I have written a downloader program that can download files from internet (with resume support).
But after I pass the file address and username and password of my account in rapidshare it can not download it, it just download a html file:
m_pHttpConnection = m_InternetSession.GetHttpConnection(sServer, nPort, sUser, sPassword);
also this function returns FALSE :
file.SendRequest(NULL);
Does anybody know how to pass username and password to rapisdhare or other sharing web sites?
Regards
Hadi
www.logicsims.ir
|
|
|
|
|
IIRC, the GetHttpConnection call lets you do URL authentication[^]. I suspect sites like rapidshare use something like basic authentication, as illustrated by this page[^], where username and password are passed in request headers.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you for your answer,
I read those article, semms to be good, I changed my code for this way, but it did not work.
It just downloads a HTML file! not the file itself!
Do you have any other idea, is there any help in rapidshare for this? I searched a lot but did not find anything helpful!
Thanks
www.logicsims.ir
|
|
|
|
|
Try monitoring the HTTP transactions using Fiddler[^] - it's a splendid debugging tool when doing low-level HTTP stuff.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
A popup menu has been created that displays a list of options for insertion into a Item>SubItem cell. The menu comes up fine, but the return value is either 0 or 1, despite the flag being set to return the menu item. It was used in a dialog only previously, and think that the hWnd is the culprit on returning the wrong item number.
Any suggestions?
Many thanks in advance.
<code>void CTab2::OnRclickListCtrl(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int i, nItem, nSubItem, nSel;
CString s;
POINT point;
HMENU hMenu = ::CreatePopupMenu();
CRect rect;
LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR;
nItem = temp->iItem;
nSubItem = temp->iSubItem;
if( nSubItem == -1 || nItem == -1 ) return ;
if (NULL != hMenu && nSubItem == 2 && nItem < lLayer ) {
for ( i = 0; i < lBulkMax; i++ ) {
::AppendMenu ( hMenu, MF_STRING, 1, sBulk[i].desc );
}
point.x = 200; point.y = 200;
ClientToScreen(&point);
nSel = ::TrackPopupMenuEx(hMenu,
TPM_LEFTALIGN | TPM_RETURNCMD | TPM_LEFTBUTTON,
point.x,
point.y,
temp->hdr.hwndFrom,
NULL);
::DestroyMenu(hMenu);
s.Format ("item selected is number %d", nSel);
AfxMessageBox ( s );
if ( nSel > 0 && nSel <= lBulkMax ) {
m_cListCtrl.SetItemText( nItem, nSubItem, sBulk[ nSel - 1 ].desc );
}
}
/*
typedef struct tagNMHDR
{
HWND hwndFrom;
UINT idFrom;
UINT code; // NM_ code
} NMHDR;
typedef NMHDR FAR * LPNMHDR;
*/
*pResult = 0;
}
|
|
|
|
|
The third parameter to AppendMenu in your loop is 1. This gives all the mnu options this ID. If you cancel the menu you will get 0 returned, any option you select will return 1. You need to add each item to the menu with a different id number.
Try changing it to i+1
If you vote me down, my score will only get lower
|
|
|
|
|
Thanks. A single append line was clipped from another program that had hard-coded ids, and neglected to change it to a loop based id.
|
|
|
|