|
Is anyone knows how to Send a Broadcast over LAN but in function Send(...) define the addresses to send the way that it sends a Broadcast to LAN but not sends it to himself.
Thanks.
|
|
|
|
|
Is anyone knows how to Send a Broadcast over LAN but in function Send(...) define the addresses to send the way that it sends a Broadcast to LAN but not sends it to himself.
Thanks.
|
|
|
|
|
Is anyone knows how can isend a broadcast on the LAN through UDP protocol without
sending it to my self also?
( I'm talking about CAsyncSocket level ).
Thanks.
|
|
|
|
|
surely you just ignore messages that you know originated from you so to speak
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
How many messages is in MFC ???
In Class wizard is 2 kinds :
Group 1: Before the message name is V character. Example : OnCommand
Group 2: Before the message name is W character. Example : WM_CREATE
Please explain to me about different kinds.
Thanks.
Hadi Rezaie
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
When i use of SetCapture() statment in program,
In fact my mouse pointer is capture, it mean i can't
any work with mouse, For example i can't click on
buttons or menu , ...
Please explain to me how can i use of SetCapture()
with good performance.
My source code :
void CTestDlg::OnOK()
{
HCURSOR h_Cursor;
h_Cursor = AfxGetApp()->LoadCursor(IDC_MYPOINTER);
SetCursor(h_Cursor);
SetCapture();
}
Thanks.
Hadi Rezaie
Hadi Rezaie
|
|
|
|
|
from your code snippet i assume you have a mdi or sdi app that shows a dialog box where you set the mouse capture ... if you look at msdn for SetCapture() you will see it says that all mouse messages are directed to the window with capture (your dialog) regardless of where the mouse is ... hence your other bits wont get to see mouse messages
also if your dialog is modal it will consume any other messages for your app until it is dismissed
hope this helps
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Salam Hadi! Chetovri?
Why/What do you need SetCapture() for, and why in such a function OnOK() would you need to change the cursor?
Where do you exactly want your cursor to change? I'll help you, excpect an email from me soon.
|
|
|
|
|
I think you need to handle the WM_SETCURSOR message .
Good luck,
Dror
|
|
|
|
|
Hi and thanks for your time!
I am working on a project and can not get MAPI to work in my NT Service (W2K) . I have the service logging in as "LocalSystem" (have also tried my Domain account but nothing happens) and there is no dependencies. The same code (minus some NT Service stuff) works in a normal MFC Exe. Here is the code:
...
...
...
LPMAPISESSION lpSession;
pMapiInit.ulVersion = MAPI_INIT_VERSION;
pMapiInit.ulFlags = MAPI_NT_SERVICE;
FLAGS flFlag = MAPI_NO_MAIL | MAPI_NEW_SESSION | MAPI_NT_SERVICE;
hr = MAPIInitialize(&pMapiInit);
if (!HR_SUCCEEDED(hr))
{
MessageBox (NULL, "MAPIInitialize failed.", "", MB_OK);
goto cleanup;
}
hr = MAPILogonEx(0L, (LPTSTR)"dmadden", (LPTSTR)NULL, flFlag, &lpSession);
if (HR_SUCCEEDED(hr))
{
// I never get here!!!!!
}
...
...
...
I would really appreciate help!!
Thanks in advance,
Dan
|
|
|
|
|
is "dmadden" the local system account?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Thanks for taking the time to respond!
I'm new at this Services game...dmadden is my domain account. Could you tell me what I need to do to get this reading the right one (if this is incorrect...remember it doesn't work even if I set it up to use my Domain account)? The Service needs to connect to a Domain account when it starts. The Server will (of course) also be in the Domain (not to mention the Server where the mailbox resides).
Thanks in advance,
Dan
|
|
|
|
|
Daniel two questions:
(1) Which account are you installing this app into the SCM??
(2) Have you tried specifying your FULL domain name for the account name??
(ie. instead of "dmadden" have you tried "<domain>\dmadden"??
|
|
|
|
|
Hi guys,
i am somewhat new to GDI coding, and i am about at my wits end as to how to accomplish this....
What i want to do is have 2 CListCtrls, one on top of the other, and then animate the top one moving off (to reveal the other underneath). The top one animates out of view and all we are left with is the bottom one. I am attempting to create an effect somewhat like that in the bar on the left hand side in MS Outlook (though with CListCtrls).
My first thoughts as to how to do this nicely were to create two memory dcs and render each ListCtrl to one. Then, at regular time intervals i would BitBlt an amount from each DC to the screenDC and i would have my lovely animation
I can create a memDC for the ListCtrl which is at first on the top because i can do a GetDC and then bitblt() from it. However.. ...i cannot do the same for the ListCtrl which is initially hidden as its DC will be blank (it hasnt been painted). Is there anyone out there who knows how to get a window to paint itself to a given Memory DC?
Or is there anyone who has a better suggestion for creating this effect?
Any help would be greatly appreciated, thanks.
~Alex
|
|
|
|
|
Check out WM_PRINT - it renders a window into a DC that you supply.
--Mike--
http://home.inreach.com/mdunn/
This must be Thursday. I never could get the hang of Thursdays...
|
|
|
|
|
<<< In the name of GOD >>>
Hi all.
I have almost 50 buttons in 1 dialog.
I should write function that :
When user hited the one of them (buttons), then :
function should return :
* Number of button *
I need good algourithm.
Thanks.
Hadi Rezaie
|
|
|
|
|
hmmmmm
you could make an array of the button control id's and a value you want, ie,
struct myButton {
int nCtrlID;
int nMyValue;
};
all the button click events route to one function that decodes which button was clicked from its id value and returns the correct integer value to your app
kinda would work but i think its dodgy and would rather have 50 click events ... it is more robust
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes themint
|
|
|
|
|
better I think you can use map<int nctrlid,="" int="" nyourvalue="">.
good luck,
Dror
|
|
|
|
|
In the name of GOD ?
You could do this a myriad of ways. You could ensure the ID's of the buttons were sequential, and then in your pretranslatemessage you could intercept id's within the range and store the value stripped of it's excess ( i.e. for 0 based subtract the id of button #1 from the value, for 1 based, add one to that ), you could put in handlers for each button ( more donkey work, but probably more robust ), you could use radio buttons, where a 0 based value is stored anyhow, you could use a struct, as has been suggested, etc. You don't need an algorythm, you just need to decide on a process.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Hey Hadi,
Create a class that inherits from CButton and implement the OnClick event.
In the OnClick you should notify your parent that you have been clicked.
A simple way to do this would be to have your new class have the members:
HWND m_hwndWindowToNotify;
int m_iMessageToSend;
int m_iMyId;
Which you set when you create them all from the parent.
(I assume you have a variable length array)
So you set each CNewButton's hwndWindowToNotify to the parent.
The iMessageToSend to something like WM_USER+100 (which you don'y re-use!)
An m_iMyId as the number of the button (for ease on implementation).
CNewButton::OnClick()
{
::SendMessage(m_hwndWindowToNotify, m_iMessageToSend, m_iMyId, 0);
}
CParentDlg::OnCustom_SpecialButtonClick(LPARAM l, WPARARM w)
{
int iButtonIndex = (int)l;
// Do stuff for iButtonIndex button click
}
*** Don't forget to add ***
ON_MESSAGE(WM_USER+100, OnCustom_SpecialButtonClick)
to your parents message map (BEGIN_MESSAGE_MAP...)
Let us know how you go.
Jules
|
|
|
|
|
Here's a fun one -
Assuming MFC, you can use the ON_COMMAND_RANGE message map macro.
First, define all your buttons so that their ids are contiguous - i.e. IDC_BUTTON1 is 1000, IDC_BUTTON2 is 1001 etc.
Declare one handler as afx_message void MyButtons(UINT i) . Then use the range macro to send all of the buttons clicks to that fn:
ON_COMMAND_RANGE(IDC_BUTTON1, IDC_BUTTON50, MyButtons)
Remember to put this outside the //}}AFX_MSG_MAP stuff, but still inside the BEGIN_MESSAGE_MAP sandwich.
Then, your code can look like this:
void CTestDlg::MyButtons(UINT i)
{
}
i should hold the id of the button pressed.
|
|
|
|
|
Hi.
I Know that in Borland there're automatic .Bak files which are backup for any compiled file.
I was wondering if there're any such files in the VC++ 6.0 , and if not if there an option
to set VC++ to create back up files.
Thanks.
Gal.
|
|
|
|
|
No, but we could BUILD one ( spurious Black Adder reference )
To my knowledge, there isn't, but you can define a pre build or post build step, so it would be pretty easy to run something that did what you want, so it ran just before every build, or just after.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
HI All,
I have a situation where I need to have only one instance of a class at any given time. How would I do that. If you provide code it will be better. It is very urgent.
Thanking you
A.Santosh
|
|
|
|
|