|
how to test a method in vs2005 if this method create a configuration or launch a form
dghdfghdfghdfghdgh
|
|
|
|
|
how to create a tray icon for adialog box??? what is the function to be used for this???
|
|
|
|
|
Hi,
there is a NotifyIcon class; you can create an instance, give it some Icon,
and make it Visible; probably you want to set a ContextMenu too.
I did all of this in my TrayIconBuster article.
|
|
|
|
|
well...thanks but a m not able to implement his yet..ca u provide me with some code...here's my code or a dialog box now i want to make a tray icon for this..please provide help in coding for this...thanks
#include <windows.h>
#include "resource.h"
#include <cstdlib>
#include<atlstr.h>
#include <fstream>
#include<iostream>
//---------------------------------------------------------------------------
LPSTR lpString;
HWND hWnd;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
//---------------------------------------------------------------------------
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLGFIRST),hWnd, reinterpret_cast<dlgproc>(DlgProc));
return FALSE;
}
//---------------------------------------------------------------------------
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
TCHAR cPath[20];
TCHAR cUserName[20];
TCHAR cPassword[20];
switch(Msg)
{
case WM_INITDIALOG:
{
return TRUE;
}
case WM_COMMAND:
{
switch(wParam)
{
case IDOK:
{
size_t nLen;
GetDlgItemText(hWndDlg, IDC_EDIT1, cPath, 20);
nLen = strlen(cPath);
if (nLen == 0)
{
MessageBox(hWndDlg,"Please Enter SVN Path","Error",MB_ICONERROR);
break;
}
GetDlgItemText(hWndDlg, IDC_EDIT2, cUserName, 20);
nLen = strlen(cUserName);
if (nLen == 0)
{
MessageBox(hWndDlg,"Please Enter your user name","Error",MB_ICONERROR);
break;
}
GetDlgItemText(hWndDlg, IDC_EDIT3, cPassword, 20);
nLen = strlen(cPath);
if (nLen == 0)
{
MessageBox(hWndDlg,"Please Enter your Password ","Error",MB_ICONERROR);
break;
}
EndDialog(hWndDlg, 0);
std::ofstream file ("config.txt");
file << " SVN Path entered by user is -> "<<cpath <<="" std::endl;
="" file="" "="" svn="" user="" name="" entered="" by="" -="">" <<cusername <<="" std::endl;
="" file="" "="" svn="" password="" entered="" by="" user="" -="">"<
|
|
|
|
|
If you are not trying to create friction, please get it together and ask in the right forums. The code you've posted is Win32 ( I still don't understand why ), so you need to ask in the Visual C++ forum.
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 )
|
|
|
|
|
Hi
In my application I need to insert a clock.
So How can I insert a running clock in my Form.
Please suggest me an Example.
I have not failed. I've just found 10,000 ways that won't work. -Thomas A. Edison
Thank u
Chandu
|
|
|
|
|
The keywords are Windows.Forms.Timer and Label.
Everything else is up to you.
|
|
|
|
|
What language are you using?
And is google[^] broken?
|
|
|
|
|
good old Latin for roman numbers ...
|
|
|
|
|
i have used a text box in my dialog box in WIN32 programming....now i want that the data entered by user can be copied to a text file on pressing ok. what method can i use for this??
|
|
|
|
|
Telling us what programming language your using would be good for a start :P
c++ for a guess?
|
|
|
|
|
|
|
this guy has been asking so many times this question that i doubt he really know what he wants, or at least, what the words he uses actually mean...
i have the impression that he is coding using managed C++ (or C++/CLI), be he's always employing the name of "Win32" in his messages...
|
|
|
|
|
Turns out he is stuck with using Win32, he obviously is a little lost, he can't work out what forums to use, and it's taken several tries, and several correct answers from different people, for him to work out how to create a text file. I'm pretty sure he was wrong when he said that he already knew C++ well.
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 )
|
|
|
|
|
Christian Graus wrote: I'm pretty sure he was wrong when he said that he already knew C++ well.
yeah, he was probably talking about VB6++.NET
|
|
|
|
|
I'm still trying to help him, but he's obviously very lost. I think he's doing a course that teaches Win32, and he feels he needs to use API calls instead of standard C++ ones. Whatever the course is, I hope he doesn't expect a job out of it. win32 ???
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 )
|
|
|
|
|
|
you talk of asking politely...i hav been polite now...and u r doing such things to me..?
|
|
|
|
|
dona jain wrote: you talk of asking politely...i hav been polite now...
spamming and cross posting the forums is what we actually call to be polite around codeproject... and i just gave you a link to let you know the best practices for "asking a question the smarter way". it was all serious. but as you got on my nerves too, i linked the littke google stuff, as you deserved it also :p
|
|
|
|
|
I'm afraid I am starting to believe that you are trolling. You've been asked several times for information about what you're doing, and not responded. I've asked you countless times to try and work out if you're using C++/CLI, if you're using MFC, or whatever, you never answer. If you post again, please post with some code, so we can work out what forum you should be asking in, and once we've helped you define the technology you're using, stick to that forum.
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 )
|
|
|
|
|
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 )
|
|
|
|