|
well...i m not using MFC... i hav been asked to do so...i am doing programming in WIN32 C++ .NET and can use API. i m providing u with the code here..i want the two strings cName and CCompany to be now saved into a file on pressing OK button.
this forum has really helped me a lot . hope for same again...thanks.
TCHAR cName[20];
TCHAR cCompany[20];
switch(Msg)
{
case WM_INITDIALOG:
{
return TRUE;
}
case WM_COMMAND:
{
switch(wParam)
{
case IDOK:
{
size_t nLen;
GetDlgItemText(hWndDlg, IDC_EDIT1, cName, 20);
nLen = strlen(cName);
if (nLen == 0)
{
MessageBox(hWndDlg,"Please Enter name","Error",MB_ICONERROR);
break;
}
GetDlgItemText(hWndDlg, IDC_EDIT2, cCompany, 20);
nLen = strlen(cCompany);
if (nLen == 0)
{
MessageBox(hWndDlg,"Please Enter Company","Error",MB_ICONERROR);
break;
}
EndDialog(hWndDlg, 0);
break;
}
case IDCANCEL:
{
EndDialog(hWndDlg, 0);
return TRUE;
break;
}
}
return FALSE;
}
|
|
|
|
|
OK, so you *are* using Win32. The visual c++ forum is the best for this, although even then, you're in a severe minority to be using such an old approach to windows apps. Support for this is going to be very thin on the ground.
Now you'd just use standard c++ to save the values, using the classes I pointed you to the other day. Something like
#include <fstream>
std::ofstream file ("c:\\file.txt");
file << cName << std::endl;
file << cCompany << std::endl;
file.close();
This is standard C++, which I don't use much, so there may be some errors, you may need to check an online reference, or your books to get it exactly right.
Why do you need to use Win32 ? What a nightmare...
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thanks.
but it will be nice if you provide some API code to implement this,
as it is a better approach...well i m a S/W developer trainee so i have to work on Win32.. as i am strictly asked to do so.
|
|
|
|
|
dona jain wrote: but it will be nice if you provide some API code to implement this,
I don't know what you mean ? Others have told you the Win32 functions to call, but why would you prefer to call Win32 methods, than standard C++ methods ? That's just stupid, unless you're trying to write the code in C, not C++
Why are you accepting a position where you learn Win32 ? You know that no-one uses it, right ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How can i draw tables (flexible as in ms word). I have tried to use rtf codes for it but table is not flexible enough when user writes in cells the cell is not auto sized or the text is not wrapped accordingly but it ignores the lines of table and the text overlaps it.
Please if someone have a solution then let me know asap.
Salman Sheikh
|
|
|
|
|
Hi Friends,
I came to know about the new guidance to develop windows application. And did some sample applications. I have some issues and doubts.
1. I have deployed it in a webserver. When it is accessed, its opening as new application (Window App). Is there any way that we can fix this window inside the IE itself.
2. I have used the SCSF May 2007 to develop that application. Everything is working fine, if I run it directly. But when I deployed it, I am not able to view the other Blocks used inside the app. Say, menu items, tool bars, buttons, etc. The shell only showing up.
Please help me, if you have any solution.
Thanks in advance.
|
|
|
|
|
Venkatesh Mookkan wrote: 1. I have deployed it in a webserver. When it is accessed, its opening as new application (Window App). Is there any way that we can fix this window inside the IE itself.
You mean you used click once to deploy it?
If so click once is a method for distributing Windows Applications using web technologies. It's not for running Windows Applications inside a web browser.
Venkatesh Mookkan wrote: 2. I have used the SCSF May 2007 to develop that application. Everything is working fine, if I run it directly. But when I deployed it, I am not able to view the other Blocks used inside the app. Say, menu items, tool bars, buttons, etc. The shell only showing up.
When it's deployed are the SCSF assemblies included with the application? If not you'll probably need to install them on each machine.
|
|
|
|
|
Hey OriginSH,
Thanks for responding.
originSH wrote: You mean you used click once to deploy it?
Yep. I am using Click Once to deploy it.
originSH wrote: If so click once is a method for distributing Windows Applications using web technologies. It's not for running Windows Applications inside a web browser.
I do know this. Is there any solution to fix it inside the IE, like ActiveX. We are about to quit ActiveX as we are already using it.
originSH wrote: When it's deployed are the SCSF assemblies included with the application? If not you'll probably need to install them on each machine.
I read the help given with SCSF for Click Once deployment process. But the assemblies are not including. Even it not working the deployed machine. Say, the developer the machine. It works only on running from VS IDE.
|
|
|
|
|
Hi,
I'm trying to set up a UserControl or Component that consists of a label, which is colored and has Dock set to Top so that it spans the top of the UserControl/Component. Under this is a Panel, dock set to Fill.
When I use this, I want controls that I add to it to be placed in the Panel.
But I'm running into difficulties:
When I try to do this by creating a UserControl, I cannot add Controls to an instance of it in the VS Designer.
When I try to do this with a Component(inheriting from the Panel class), I can add to it, but the Controls end up in the top level Panel, not the inner panel.
I could get around this by adding to it programatically, using a custom Add method, but I'd really like to be able to use the designer!
Maybe the technique I'm using is incorrect? Or maybe I need to add some kind of override for my UserControl/Component's Add method? How do I do this?
Thanks for any help you can offer me.
|
|
|
|
|
I don't think a user control will allow you to do this. Have you tried making the panel you want to be modifiable public?
|
|
|
|
|
Hi,
I'm developing an application that I would like to have the docking/tabbing functionality of the windows/panels, just like in Visual Studio.
It doesn't appear to be part of the standard Toolbox controls - is it?
Can someone point me in the right direction for information on adding this functionality into my application?
Many thanks!
|
|
|
|
|
You need to use a third-party control. There are many commercial ones and some open-source/free ones (I think there are some here on CP, but I'm not sure...couldn't find any doing a quick search just now.)
Anyway, the one I use is called SandDock from Divelements (www.divelements.com). The price is reasonable, support is very good, and the controls are very easy to work with.
|
|
|
|
|
Try this
http://www.codeproject.com/cs/miscctrl/DockManager.asp
this will lead you to the SourceForge site that has the latest version.
Coincidently I've been playing with it for a couple of hours and it is quite easy to use but a tad more than I need for my Application.
Good Luck
Mike
Life is not measured by the number of breaths we take, but by the
moments that take our breath away. "George Carlin"
|
|
|
|
|
Thanks, I'm giving that a go. Looks good!
|
|
|
|
|
so that it is automated.
I am running an application which requests 3 parameters. Want to conver this to run automatically. I cannot set it up in the "scheduler" since it has 3 input parameters that needs to be considered.
I am using VS2005/ASP.NET2.0 - is there a way to convert this windows application into an automatic service?
Thanks so much for your time.
|
|
|
|
|
VK-Cadec wrote: ASP.NET2.0
VK-Cadec wrote: windows application
Something is wrong with this picture....
You can't just convert an app into a service, you have to build a service and copy your code into it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to convert my app to run from command line. Then would be probably use the scheduler to set when to run this app.
It has three input parameters which the user can set the first time he runs the app., then want to put this app into scheduler? Would this plan work?
Thanks.
|
|
|
|
|
VK-Cadec wrote: I want to convert my app to run from command line.
Any application can be run from the command line.
Do you mean you want it to be a Console Application and output to the console you ran it from?
Do you mean you want it to run as a Windows Forms Application and just take some command line arguments?
If you do just want to use command line arguments did you bother to google[^]?
|
|
|
|
|
I made my windows form application with some dependencies with a set of libraries (OPENCV); after building my project i 've an exe file file in the debug directory, working.
I want to use my application on other pc, that don't have vc++ and opencv, can i use only the exe file to use my application?
Thanks for answers, regards.
|
|
|
|
|
No, you'll need all the DLLs in the bin folder possibly along with some other files (also in the bin folder) and depending on what this opencv thing is you might need some files from elsewhere too.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Thanks for answer but i've another answer.
- The DLLs in the bin folder of the c++ in the visual studio's folder?
- How can i search on internet some info about this argument?
Thanks a lot
Bye.
|
|
|
|
|
dodoxor wrote: The DLLs in the bin folder of the c++ in the visual studio's folder?
Possibly.
dodoxor wrote: How can i search on internet some info about this argument?
Use google.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Aloha,
Any idea how I can make some words have a different color in a Windows Forms Textbox?
I have tried txtMainText.ForeColor = System.Drawing.Color.Red, add the word, txtMainText.ForeColor = System.Drawing.Color.Black... but that does nothing at all or it change the color of the whole text (if I remove the part where I set the color back to black).
Thanks
|
|
|
|
|
A TextBox cannot do this. The text is all one color. You'd either have to use a RichTextBox or create your own custom TextBox that supports what you want.
|
|
|
|
|
Ok so here is my scenario,
I have an application (.exe) and a module (.dll) both written in C#, but thats just a minor detail
(Application)<-(module)
The interface that the module exposes to the application has a function:
System.Windows.Forms.Form GetPreviewForm()
What I would like to do is put in a proxy between my module and the application, the proxy will connect to the module interface and basically expose it over ethernet to the other end of the proxy
(Application)<-[(proxy module)<--ethernet--(proxy application)]<-(module)
Where I'm having the trouble is figuring out how to pass on a form through a proxy
|
|
|
|