|
Yes, that's exactly what I want to do, but I donot know how to implement. Could you please help me with code. Thanks.
I dream so I do.
|
|
|
|
|
Hi
in this code I listen a socket to receive server's response and then Send BC message to the network (this is a client action)
m_LSocket->Create(1000);<br />
m_LSocket->Listen();<br />
CAsyncSocket s;<br />
s.Create(334400,SOCK_DGRAM);<br />
BOOL bOptVal = TRUE;<br />
s.SetSockOpt(SO_BROADCAST,(char*)&bOptVal,sizeof(BOOL));<br />
char buf[256];<br />
<br />
CString Address("255.255.255.255");
unsigned int port = 1000;
strcpy(buf,"Requesting Connection");
s.SendTo(buf,256,port);
On the server side you most listen a Datagram socke (SOCK_DGRAM), and wait to receive a connection request.
Is it enough.;)
Iman Ghasrfakhri
|
|
|
|
|
Thank you very much for the help. May I ask you one more favour, could you please give me the server code aswell. Thanks again.
I dream so I do.
|
|
|
|
|
Ok can anybody tell me some good books from where i can learn about udp broadcasting or any web tutorial.
I dream so I do.
|
|
|
|
|
I have this very odd problem, my application contains and open, save, and font dialog box in it. I am using the ones that come with Visual Studio already, and when I first run my application and launch the font dialog it comes up all weird looking, see this screen shot, until I launch either the open or save dialogs. I dont have to do anything with them other than open them and then cancel them and once I do the font dialog works like it should. Anyone have any suggestions as to why this may be happening or how to fix it?
Thanks,
Tom Sapp
http://www.sappsworld.com
-- modified at 23:41 Saturday 5th November, 2005
|
|
|
|
|
Ok, the even weirder part is this happens with the MessageBox.Show as well! Very Very Odd!
Screen Shot
Thanks,
Tom Sapp
http://www.sappsworld.com
-- modified at 23:42 Saturday 5th November, 2005
|
|
|
|
|
Hmm. It looks like the static controls in the dialogs aren't loading (or painting) correctly, while the dialogs themselves are OK. Note that these are common dialogs, provided by Windows, and don't "come with" Visual Studio.
That said, are you trying to customize these dialogs at all? Are you creating your own class, derived from CFontDialog ? Post some of your code where you are using these dialogs, and we'll take a look.
Software Zen: delete this;
|
|
|
|
|
Other than this code called on a menu click:
if ( fdFont->ShowDialog() == DialogResult::OK ) rtbDocument->Font = fdFont->Font;
all the other code I have is to set options on the dialog to have a minimum size and maximum size. I haven't made a custom object or anything, just used what ever was added when I dragged the font dialog tool from the toolbox to the form. It also happens with the MessageBox.Show code as well. Here is that code:
MessageBox::Show( this, message, caption, buttons, MessageBoxIcon::Question, MessageBoxDefaultButton::Button1 );
It's very weird and if you would like to, you can download the project here and take a look at all the code.
Thanks,
Tom Sapp
http://www.sappsworld.com
|
|
|
|
|
Tom, I downloaded your project. I ran both the debug and release executables on my machine. The font dialog displayed correctly in both cases.
It looks like your project is a managed C++ .NET application. Unfortunately, my expertise is in Win32 and MFC applications (which is why this is the only forum in which I tend to answer questions).
You may want to repost your question in the C++/CLI forum[^].
Good luck, and sorry I couldn't be of help.
Software Zen: delete this;
|
|
|
|
|
I am writing an application that brings up a modeless dialog and I was wondering if there is a way when the dialog comes up to have it go behind the main application dialog or form when the user clicks on the main application. Now, I have been able to minimize it to the taskbar, but that is not really what I want. I suspect that it is because the dialog is a child of the main application. I tried to use BringWindowToTop(),but that did not work.
Roger
|
|
|
|
|
Roj wrote: I suspect that it is because the dialog is a child of the main application.
Yes, a child is always in front of the parent. Make it a child of the desktop.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks a lot, that helped a lot. I was able to do a search on the internet to come up with the solution. It seems so simple now that I see it.
Roger
|
|
|
|
|
I have a CMyListView class inheriting from CListView in a SDI project. But how can I get the list control's ID in this class, like in the macro
ON_NOTIFY(LVN_GETDISPINFO, IDC_LIST:doh:, OnGetdispinfoList)
|
|
|
|
|
GetDlgCtrlID()
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
i have microsoft visual c++ 2005 express edition beta 2 and there have not been able to find a way to build the projects to run on another computer. is this just a part that is not included in this version or have i just not been able to find it yet??
also i have used code samples from microsoft help (do not know why they call it help it hardly ever does) for their speech sdk and it had several things that gave me errors when i tried to compile it. such as "HRESULT undeclared identifier" and "cpObjectToken undeclared identifier". is there an include file that i need and the help did not tell me about or what is the problem??
the site that i got the code from is http://msdn.microsoft.com/library/default.asp?url=/library/en-us/SAPI51sr/html/Welcome.asp[^]
any help with speech recognition, with microsoft speech sdk or any other speech recognition, itself would also be of great help because i have not been able to figure out any of it yet
any help is greatly appreciated
- Kyle
-- modified at 18:02 Saturday 5th November, 2005
|
|
|
|
|
gr8coaster329 wrote: i have microsoft visual c++ 2005 express edition beta 2 and there have not been able to find a way to build the projects to run on another computer. is this just a part that is not included in this version or have i just not been able to find it yet??
Taking a guess, the programs need one or more DLL's included with VS2005. Use the "Dependency Walker" application (DEPENDS.EXE) to find out which DLL's are needed. If this tools isn't included in VS2005, you may need to get it from VS2003.
Software Zen: delete this;
|
|
|
|
|
Hi,
I created a combobox with 50 state codes; it seems working okay.
So, when user type 'N', 'Y'; it will highlight "NY".
When user hits enter, it will put "NY" into the combobox.
However, user can enter invalid code; such as 'N', 'W'.
It ends up putting "NW" into the combobox.
I probably can us OnChar ( ) to validate all the
input.
But, does any know a better way to handl it?
Any help / suggestion would be appreciated!
Thanks,
Kevin
|
|
|
|
|
You can set the style of the combobox to 'dropdown'-list.
This will prevent the user to enter a word that doesn't exist already in the list
Regards
codito ergo sum
|
|
|
|
|
|
How do you get polygons to move across the screen in the window using coordinates?
|
|
|
|
|
I know in Borland their is a command to check for other events when in a loop on a form.
Are they something the same in Visual Studio.
I am in a loop when I click a button, but need to check if another button/checkbox event needs to be processed; e.g. flag set to exit the loop.
Or do I need to opt for a worker thread?
Graham.
grahamfff
|
|
|
|
|
Putting your loop in a worker thread is usually the best way. Otherwise you have to check the message queue at regular intervals in your loop so that the GUI can handle the messages. If you are using MFC then a call to AfxGetApp()->PumpMessage() will do the trick. If not using MFC then you have to place calls to PeekMessage, TranslateMessage, and DispatchMessage . See http://www.codeproject.com/threads/usingworkerthreads.asp[^].
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I am creating a Windows Forms Application (.NET) and am trying to create and show my own About dialog but I can't figure this out. I have tried doing searches here and on the net but everything I am finding says to do one of two things:
AboutDialog::Show();
or
AboutDialog myDialog = new AboutDialog();
myDialog.Show();
Either way I do this it gives me an error of "error C2065: 'AboutDialog' : undeclared identifier"
Forgive me for asking so many questions but I am still learning and this is one of the ways I find the easiest! Only problem is I am having a heck of a time figuring out how to search for stuff for C++.
Thanks,
Tom Sapp
http://www.sappsworld.com
|
|
|
|
|
Tom Sapp wrote: AboutDialog::Show();
AboutDialog myDialog = new AboutDialog();
myDialog.Show();
is the name of the form you created AboutDialog? if not replace AboutDialog with the name of your form, the way that i do it is:
FormName^ myForm = gcnew FormName();<br />
myForm->ShowDialog();
the "myForm" part can be replace with anything that you want it to be just make sure that it is the same in both lines of the code. also make sure that you include the header file of the form (#include "fileName.h") at the top of the file.
i hope i worded this right, and that it helps you
- Kyle
|
|
|
|
|
Cool, apparently the #include "AboutDialog.h" part is what I was missing. I am used to using Delphi that automatically includes these types of things. I will try to remember that from now on!
Thanks,
Tom Sapp
http://www.sappsworld.com
|
|
|
|