|
you need to handle the ON_CBN_SELENDOK and/or ON_CBN_SELCHANGE ( and maybe one or two other ) messages.
check MSDN for more info.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanx for ur reply.Your info was useful and i have made it.
Thanx once again
Prathiba
|
|
|
|
|
im trying to figure this sucker out, the idea i want to do is notify user MessageBox("hifile changed") when the file "1.txt" has been edited, but this hole FileSystemWatcher.OnChanged seems confusing, can anyone give me any suggestions or tutorials or examples? would be great!
thanks!
|
|
|
|
|
|
|
hai,
I am working on VC++ win32.I am creating a timer that decrements a counter every second(in Dlg Procedure).I have class where I have to reset the value of the timer.I am thinking of how to do this?
ie.
//main.cpp
int g_counter = 10;
main()
{
///here i decrement the timer every second
}
// myclass.cpp
int myclass::myfunction()
{
///here i want to set g_counter = 10;////how should i exactly do it..
}
|
|
|
|
|
manu81 wrote:
///here i decrement the timer every second
What function are you using to establish the timer?
manu81 wrote:
///here i want to set g_counter = 10;////how should i exactly do it..
You mean besides:
g_counter = 10;
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi i'm having difficulties, kinda fresh in C++ and I want to know how to do this code in C++:
"Dim name As String"
anyone tell me how to do it in C++ please
|
|
|
|
|
The answer is: it depends.
In simplest 'C' terms (which also works for C++), strings are arrays of characters:
char str[128];
strcpy(str,"This is a string"); defines a string str . Strings are terminated by a 0 byte, which marks the end of the string. In order to set the string, or assign one string to another, you have to call a function like strcpy .
If you are using Microsoft Visual C++ and the MFC (Microsoft Foundation Class) library, you've got a class called CString :
CString str;
str = "This is a string"; CString makes using strings a lot easier than the 'array of characters' approach. Instead of having to call functions to do simple operations like assigning one string to another, you can use a simple assignment:
CString str1("This is string 1");
CString str2("This is string 2");
str1 = str2; CString also defines the '+' operator for doing string concatenation, along with others.
The Standard Template Library (STL) defines a string class as well. I'm not familiar with the STL, but you should be able to find examples.
Software Zen: delete this;
|
|
|
|
|
Read tutorials....
Don't try it, just do it!
|
|
|
|
|
To add text to the end of an edit box, why doesn't this work? SendMessage(hEditWnd,EM_SETSEL,0,MAKELONG(0xffff, 0xffff));
thats now MSDN tells you to do it
wWw.KruncherInc.cOm
|
|
|
|
|
The EM_SETSEL message sets the selection for the control. Using the parameters you've supplied (0 and 0xFFFFFFFF) tells the control to select all of the text it contains.
The standard edit control doesn't support appending text to its current contents. You can only 'get' the entire text of the control, or 'set' it.
By the way: You don't need to use MAKELONG(0xffff,0xffff) for the final parameter. You can just use 0xFFFFFFFF .
Software Zen: delete this;
|
|
|
|
|
First put the insertion point (i.e., caret) at the end of any text using EM_SETSEL , then use EM_REPLACESEL to append the text.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
How can I make,
LPCTSTR strText
to a CString?
Please help me.
|
|
|
|
|
Just assign to a CString variable, the CString constructor will handle the rest.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
Thanks,
There is one more thing,
In my base class I have some private code and when I try to get to them by caling it from anather class like this.
dlg_Main->UserLogin(sMsg);
And when I get to that funktion it don't work what I am doing wrong?
|
|
|
|
|
This is the error I get!
CListBox hWnd=???
|
|
|
|
|
Hi there!
could u pls show me the part of your code, where you are facing problem.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
When I try to open the resource file (.rc) using the Resource Editor in Visual Studio .NET, I get an error telling me "opened in another editor". I did a little digging and I think this file is saved as UNICODE. I tried to save as US-ANSI but that did do anything? Might anyone know what this is and how to fix it?
Thanks!
|
|
|
|
|
You will see this message if you open the .rc file (or the resource.h file) in the text editor, and then try to edit the resources using the resource editor.
Note that .rc files will not compile when saved as UNICODE.
Another thing to try is to delete the file named <project>.aps in your project directory. This file is used by the IDE to store a parsed version of the .rc file while you are using the resource editor. It's not uncommon for this file to get messed up. Deleting it is harmless, as the IDE will recreate it as needed.
Software Zen: delete this;
|
|
|
|
|
The rc files are opened anywhere else. they opened before but that was a while ago. A lot could have changed, but I never remember saving them as unicode unless it happened on accident. I tried deleting the .aps file. Nothing seemed to happen. I tried, rebooting the machine, closing the application. Every .rc file will not open for my project.
that is too weird.
|
|
|
|
|
I managed to fix the issue by reinstalling Visual Studio.
Thanks for the help!
|
|
|
|
|
Why does the output of driver.get_name() display a number instead of the string of characters passed to driver.set_name() ?
I've not done C++ in quite some time so any help would be great.
Thanks in advance.
code:
///////////////// from .cpp file ///////////////
details driver;
driver.set_name("abc");
cout << "name = " << driver.get_name() << endl;
///////////////////////////////////////////////////////////
/////////////////////// the class /////////////////////////////////////////
#ifndef DETAILS_H
#define DETAILS_H
class details
{
public:
int get_name();
int get_grade();
void set_name(char name[3]);
void set_grade(int the_grade);
private:
int name[3];
int grade;
};
int details::get_name()
{
return name[3];
}
int details::get_grade()
{
return grade;
}
void details::set_name(char the_name[3])
{
name[3] = the_name[3];
}
void details::set_grade(int the_grade)
{
grade = the_grade;
}
#endif
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
As I see you don't have any knowledge or experiences on programming!
You made a critical mistake which normally won't happen if you had experience in programming in general.
you defined:
int name[3];
that means, that the "name" array has 3 indexes... 0, 1, 2
return name[3]; or name[3] = the_name[3]; <- this will never work because index 3 is not part of the array.
in some cases this can be very critical. Exploits often work by using software errors to write on memory areas not being part of the array.
Don't try it, just do it!
|
|
|
|
|
Alexander, thank you so much for your reply. I see exactly what I did wrong. When I realised I had the index at the wrong size it printed a number out instead of the char. I had the return type as int so it must've been casting the char to an int.
If I wanted to store a string of chars would I better declaring them as a string or sticking with an array? If I stick with an array I would need to loop round the array to display all the array elements, is there a better/neater way to do it?
Cheers in advance for any tips.
Graeme
|
|
|
|