|
So, having 0 bytes transfered is correct?
I don't think so! Something is rotten here, and I am of no help, 'cause I never used sockets. Sorry!
But it seems you HAVE TO read the MSDN about this.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
Oops!! sorry I gave you the return code '0' which means success.
yes, there is a return confirmation which I am getting.
But I am not selecting the entire return confirmation, just taking in first 40 bytes.
Thanks,
John
|
|
|
|
|
John Bosko wrote:
yes the return variable is '0' which is correct.
which is _not_ correct. Try and give the length of the data you want to send as third parameter of the sendto . I think that this is really a buffer problem. When you send your data without preceding it by the login request, the buffer is empty (and not full with the loggin request stuff), so IMO that's why there is no problem in that case.
~RaGE();
|
|
|
|
|
Maybe you should empty the socket buffer before restarting to use sendto again. How are you authenticating it (from the sender point of vue) ? Does the sender got something from the reciever (confirmation message ?) so that he is allowed to send data ? If yes, this could have been sent back if the buffer was not emptied. I experienced that a couple of months ago.
~RaGE();
|
|
|
|
|
Hi,
How do I empty the socket buffer?
If you can help me out with it, I guess it would solve my problem!!!
Kindly Help,
John
|
|
|
|
|
John Bosko wrote:
How do I empty the socket buffer?
I was just looking for it, but i did not find anything, and i cannot remember myself Sorry .. I stiil think this should not happen if you receive the same amount of byte that you send, so be careful to the length parameter in sendto . Sorry i cannot help more.
~RaGE();
|
|
|
|
|
hello @all,
i want to use
<br />
BOOL EnableMenuItem(<br />
HMENU hMenu,
UINT uIDEnableItem,
UINT uEnable
);<br />
i have two menu's:
IDR_MAINFRAME
IDR_MENU1
i want to use it, in the IDR_MENU1.
but when i write:
EnableMenuItem(IDR_MENU1, ID_EXTRAS_SERVICE, MF_GRAYED);
it do not work.
thanks
sunny
|
|
|
|
|
HMENU hMenu is not the resource ID of your menu resource, but the menu handle you get from the CMenu::hmenu member or from the ::LoadMenu() call which created your menu.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
thanks for reply.
i work with mfc, where can i find this functions? i don´t find them.
thanks
sunny
|
|
|
|
|
OK. I try to explain:
Any function in global space can (should) be preceeded with the scope operator :: This means it is not from the loacal namespace (e.g. class) but global. Most of the time, the compiler can figure it out itself, but it helps human readers to explicitly say that you are calling the global scope function, and not some member.
::LoadMenu() is a WIN32 function in global scope. MSDN will be of help with the details.
CMenu::m_hmenu is the member variable m_hmenu from the namespace CMenu. CMenu is the MFC class dealing with menus. Also MSDN helps here.
Hope this helps
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
i don´t think i understand it, but i tried this:
EnableMenuItem(::LoadMenu(IDR_MENU1), ID_EXTRAS_SERVICE, MF_GRAYED);
but it do not work? do you mean something different? can you give me an example?
thanks
sunny
|
|
|
|
|
You probably did the loading of the menu from resources somewhere before.
You said you are using MFC, so you will have a variable of type CMenu somewhere, which represents your IDR_MENU1, right?
Like this:
...
CMenu menuOne;
menuOne.LoadMenu(IDR_MENU1);
... Then you would write:
BOOL e = ::EnableMenuItem( menuOne.m_hmenu, ID_EXTRAS_SERVICE, MF_GRAYED);
And then you can see in the MSDN-entry for EnableMenuItem, that the 3rd parameter in your code is not correct:
MSDN: "This parameter must be a combination of either MF_BYCOMMAND or MF_BYPOSITION and MF_ENABLED, MF_DISABLED, or MF_GRAYED"
So, you have to add either MF_BYCOMMAND or MF_BYPOSITION to it.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
oooohhhhhhhhhhhhh.....i know what you mean.
but my problem is, i have NO CMENU objekt.
i make this:
HMENU menu;<br />
menu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MENU1));<br />
::SetMenu(*(AfxGetApp()->m_pMainWnd), menu);
what can i do now?
thanks a lot
sunny
|
|
|
|
|
Sunnygirl wrote:
HMENU menu;
menu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MENU1));
::SetMenu(*(AfxGetApp()->m_pMainWnd), menu); And adding a line
BOOL e = ::EnableMenuItem(menu, ) at the bottom does not work?
Does it compile?
Your HMENU is valid?
You corrected the flags like MSDN shows?
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
I don't know if this is what you want, it is a cut/paste from one of my progs but try:-
CWnd* pMain = AfxGetMainWnd();
// Get the main window's menu
CMenu* pMenu = pMain->GetMenu();
CMenu* pSubMenu = NULL;
// Now get a handle to the pop up menu, the 1st one e.g. File
pSubMenu = pMenu->GetSubMenu(0);
pSubMenu->EnableMenuItem(ID_FILE_TRANSFER, MF_GRAYED);
|
|
|
|
|
Oooops typo, last line should be:-
pSubMenu->EnableMenuItem(ID_FILE_TRANSFER, MF_GRAYED | MF_BYCOMMAND);
|
|
|
|
|
I have a parent dialog and some child dialogs in it. The parent dialog have bitmap background. So I want its child dialogs to be transparent? How can I do that? (Same as PropertySheet with Wizard Mode and PSH_WATERMAKE flags)
(I have only return TRUE on OnEraseBkgnd(), the child dialogs has been transparent, but static controls on child dialog are still not transparent... )
Thanks for any help!
|
|
|
|
|
Maybe thisLink[^] can help you.
~RaGE();
|
|
|
|
|
|
Thanks for your help. But the background of these static controls (on child dialg) is different from the background of the parent dialog because I has used a bitmap background, not a solid background.
|
|
|
|
|
Hi !
Is there any way to set/remove the virus protection popup window of excel programatically ? Not that I would like to write a virus , but my program needs to work on PC where this option is set and has to keep set at the end of the automation.
Any idea ?
~RaGE();
|
|
|
|
|
|
Thanks, but it does not help much
~RaGE();
|
|
|
|
|
Don't think it's what your after, but if you create a new class (well, a few really) from the excel.exe (Excel 2002) type library using the class wizard, it does generate a 'Protection' class (as well as 200+ others). You might find what your after in there, or one of the other generated classes)
I'm struggling to use the classes generated at the moment, if I come across anything I think might help you I'll post it here.
Dylan
"In meetings, the person who is least competent usually does the most talking. Talking is a direct substitute for competence, at least in the minds of other people. Five minutes after you leave a meeting, you won't remember what anyone said but you will remember who did most of the talking. Withing a day your mind will translate that into a notion that the talker was unusually knowledgeable" - Scott Adams, Dilbert and the way of the weasel
|
|
|
|
|
Hi folks,
I want to know if anybody can help me about adding an overview (small view)
to a new type of file that I create , in windows file explorer.
I want to implement my own overview.
thanks Michael
|
|
|
|