|
PankajB wrote: char buffer[MAX_PATH];
char *message = "Hello";
sprintf(buffer, "%s", message);
....
....
HWND pWnd7 = ::FindWindowEx(pWnd6, NULL, L"TComboBox", NULL);
::SendMessage(pWnd7, WM_SETTEXT, 0, (LPARAM)buffer);
What about
TCHAR buffer[] = _T("Hello");
HWND hWnd7 = ::FindWindowEx(hWnd6, NULL, _T("TComboBox"), NULL);
if ( hWnd7 ) ::SendMessage(hWnd7, WM_SETTEXT, 0 , (LPARAM) buffer);
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]
|
|
|
|
|
try
.............
SendMessage(hWnd7, WM_SETTEXT, (WPARAM)strlen(buffer) , (LPARAM) buffer);
...........
|
|
|
|
|
in my project i designed a doalog box. i build my project in debug mode.while executing if i press "ok" button or "cancel" button it is becoming inactive but in relese mode this problem is not occurring.what is the reason for it?if you know please let me know
Regards
kiran
kir_MFC
|
|
|
|
|
Hello to all,
In my project I am using a device which when I connect to the computer to the USB port, computer creates a virtual port as "USB Serial Port (COM X)" where X stands for port number which will be any.Then I open that port and reads data, as per normal communication port opening and reading/writting operations. Now what I want to do is, is there any mechanism of finding your computer's communication port numbers so that I need not to look what the port number is while opening that port. Means when I will start my application I will directly get that COM port number where my device is connected and then there will be no need of selecting the correct COM port number in my application to open it.
So please does anyone know that, is there any such kind of mechanism which will directly give me the COM port number where my device is connected or any mechanism which will directly give you your computer's communication port numbers? Please its really very very urgent so help me.
Thanks and Regards,
Anay
|
|
|
|
|
You can enumerate serial ports.
http://www.codeproject.com/KB/system/serial_portsenum_fifo.aspx
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Have a look at here: [^]. The solution shown resulted from the same problem.
|
|
|
|
|
|
Does this [^] 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]
|
|
|
|
|
|
Purish Dwivedi wrote: Actually this method can be used in MFC application , but I wanna detect the available languages through installlshield during installation.
Hi Purish Dwivedi,
1.) EnumUILanguages has nothing to do with the MFC, this function is exported from Kernel32.dll and can be called from any language capable of calling Win32 Dynamic Link Library functions. The exported function is available on Win2k and above.
2.) If your question is InstallShield specific perhaps you should ask in the InstallShield Forum[^].
Best Wishes,
-David Delaune
|
|
|
|
|
Dear fiends
I want to develop a new component for an application to handle all Errors(e.g Bad memory pointer, Bad file directory etc.) in the application. There is a problems.
What technic should I use to make it easy to report error?For instance ,It is not necessery to report a error by using if-else clause or return value.C++ exception or SEH? How to implement?
I am looking for solution to implement this.
Any reply regard to this topic will be deeply appreciated.
Best regards
Lance
|
|
|
|
|
I use EurekaLog[^] in our application. It works really well and error reporting is very nice.
xiaolin.lan wrote: .C++ exception or SEH? How to implement?
I am looking for solution to implement this.
Are you asking how to use C++ exceptions?
|
|
|
|
|
Thanks for your reply firstly.
But our application is developed in VC++ 6.0 which EurekaLog is inapplicable for!
|
|
|
|
|
I'm trying to force a message box to keep keyboard and mouse focus at all times that way the user cannot do anything else until they finish with my program. The console window is hidden and only message boxes are the only thing visible. I'm using Dev-Cpp 4.9.9.2 and Windows XP and sometimes Vista.
|
|
|
|
|
Hint: look into modal dialog boxes.
|
|
|
|
|
"There used to be a dialog box style (DS_SYSMODAL) that created a dialog box in system modal mode. But it is only there for compatibility with 16bit windows and doesn't prevent the user from clicking other items on the desktop. So I guess you will have to intercept the mouse messages. But even then the user will be able to move through dialogs using the Alt+Tab combination. So you better look at How to Disable Task Switching."
Judging from that bit of information Modal dialog boxes would not work effectively.
|
|
|
|
|
You can never block Ctrl+Alt+Delete.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
No, but I can use BlockInput() to stop all keyboard and mouse use except Ctrl+Alt+Del. I have also been able to have a program repeatedly use BlockInput() so even if the user opens task manager they still can't do anything. But that is besides the point
|
|
|
|
|
I don't think that is a good idea.
My first thought would be to uninstall the application.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I remember that long before I've done that in VB but that's a decade before :P. System-Modal concept is obsolete now in the 32Bit world. You cannot do that.
MSDN:
NOTE: An equivalent Win32 API function for SetSysModalWindow does not exist. System modal windows contradict the concept of multitasking and thus are not implemented in Win32.
May be you can maximize your app screen & make that stay on top of every window.
SetWindowPos(&this->wndTopMost..
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I don't think you can "keep" the keyboard and mouse focus all times, but you can however keep your message-box on top of other windows by displaying it as system-modal.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well I haven't actually taken any classes so I don't know how to define all the parameters to make a modal box. If you would be so gracious as to get me going feel free.
|
|
|
|
|
Well, I am not sure if you just need a modal message box[^] or you would want to keep your application window system modal. If you just need a system modal message box:
::MessageBox(NULL, _T("Message text goes here"), _T("Messagebox Title"), MB_SYSTEMMODAL);
The MB_SYSTEMMODAL flag specify that the message box should be system modal (on top of all other windows, until dismissed).
If it's your application that you want to set on top of other windows, you could call SetWindowPos()[^] and pass HWND_TOPMOST as the second parameter.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hey Guys,
I am writing an SMTP mail client in c++ in unix and it needs to do the following:
I need to create a client
the client talks to port 25
it sends a hello world message
I also need to support and smtpclient class and a clientdriver class
I have written the smtpclient class, but I am drawing blanks on the rest. I am going to include the smtpclient class below ,but I was hoping for some pointers or help on the rest of the program.
Class smtpclient (
public String smtpClient (String machineName, int portNumber);
public String login (String userName, String password);
public void logout ():
public String senderAndReceiver (String sender, String receiver);
public String messageBodyPrefix (String message);
public String messageSuffix (String message);
|
|
|
|
|
First, write the client without it being a class. It's basic procedural code. Once you figure out how the protocol works, then create a class to reflect the requirements.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|