|
Hi
I used a Win32 Console application and didn't have any problems:
#include "stdafx.h"
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
MessageBox(NULL, "Hello", "Hello", MB_OK);
return 0;
}
codito ergo sum
|
|
|
|
|
In MFC, the MessageBox function works within a dialog and takes 3 paramaters, but the non MFC version takes 4, the one that is omitted is the first one, the handle to the parent window.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Try out the AfxMessageBox function ....
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
Hi,
I am creating a shell namespace extension by implementing IShellView and IShellFolder interfaces. The extension will show all the files inside a zip archive. Since the files doesn't physically exist on the disk, I am creating a shell extension which will show the files in the archive just like how XP shows zip files.
But I am having a problem in retrieving the context menu for the file types. If the user right-clicks on a txt file, I would like to show exactly the same context menu, which is shown by right-click on a txt file in explorer.
Could anyone please tell me how this can be done.
Any pointers to sample code / article would be really helpful.
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
This might be a very trivial question for most of you. I want to know how to write a program in vc++ for scanning a particular port on the lan. I have written a chat program, I want that whenever a user starts the client, it scans the network and finds the ip for connecting, if no server is found it will become a server. Most messengers do the same thing I suppose. Thanks in advance.
I dream so I do.
|
|
|
|
|
Hi
I have a suggest,I think it is better to use othere way to find server.
If you wana to use your messanger on a LAN you can use broadcast messages.
when a client want to find server Send a BC message on the network if server peresent answer it by sending message contain its IP & other information and if isn't present the client can work as a server after some try and listen for clients BC message.
Iman Ghasrfakhri
|
|
|
|
|
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
|
|
|
|