|
I'm sorry if i wasn't clear!!
I had just ask that when i click in a checkbox inside a list control how can i retrieve the item text checked in a table.
I ve heard that u must use CStringArray!!!!!
I hope that i ve exposed my goal clrealy, but I m not sure.
Reply me if u still not understand
bye
|
|
|
|
|
hi can somebody tell me how can i put Item checked in a Clistrl into a table
using CStringArray i think.
thanks for your reply.
Somoene who really needs help.
|
|
|
|
|
HI,
I have a file pointer, How to get file name?
Actually in costructor i am giving file name, and opening a file there. i am storing file pointer as amember variable, I am not interested storing file name as member variable. I am doing all file operations. but in some other fucntion i need file name, here i have only file pointer. How will i get file name from file pointer? Is there any fcuntion?
Thanks in advance,
- Koteswara
theearth1947@yahoo.com
Perumalla Koteswara Rao,
Hyderabad, India
Thanks in advance,
Koteswara Rao, Perumalla
theearth1947@yahoo.com
|
|
|
|
|
Please clarify - that is the "file pointer" ? CFile* pFile ? ifstream * pfstream ? handle of file ... or what ?
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
It's FILE* pointer.
Thanks in advance,
Koteswara Rao, Perumalla
theearth1947@yahoo.com
|
|
|
|
|
Please clarify - that the "file pointer" is ? CFile* pFile ? ifstream * pfstream ? handle of file ... or what ?
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
How?can anybody help mi?
LIFE MUST GO ON
|
|
|
|
|
look at: http://www.libtiff.org/
|
|
|
|
|
Check this out.
http://www.paintlib.de/paintlib/
|
|
|
|
|
When i use class wizard to create a class delivered from CCmdTarget and support automation, the wizard defines constructor/destructor as protected.
(I think this has something to do with dynamic construction or something)
This doesn't allow me to create any instance of that class.
So, i just makes the constructor/destructor public and everything
works allright!
Is this a known bug of the wizard,
or i must create those classes in a special way?
What kind of problems can my aproach cause, if any?
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
The guys at Redmond just assumed you'd only want to create a class their way I guess. I use (non-automation) CCmdTarget classes all the time and make exactly the same modification you have done.
Andy Metcalfe - Sonardyne International Ltd (andy.metcalfe@lineone.net) http://www.resorg.co.uk
"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
|
|
|
|
|
I made a tempalte class,like
template <class t="">
class A
{
A();
~A();
}
template<class t=""> A<t>:: A(){};
tempalte<class t=""> ~A<>:: ~A(){};
double click on the function in ClassView Window,I can not goto the definition of the function,
Why?
|
|
|
|
|
does anyone know how to store hexadecimal numbers? cwhich data types can store hex numbers in the form 0xffff1234 and let the compiler readily read it as a hex number and not as a string. is dword such a data type?
|
|
|
|
|
There's no difference between hexadecimal and decimal numbers at all (for a compiler). Store it as a DWORD or a unsigned int and uses formatting functions or streams with hex manipulator when you need a textual representations of the number.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
I have a modal dialog box with a button with the function CMyDialog::OnMyButton() hooked to it.
Is it possible to show the dialog box (DoModal) and immediately start the function OnMyButton without wait for the user that press the button ?
|
|
|
|
|
Yes, and its easy too!
Just override OnInitDialog() in you class and call it from there. You'll have to call the base class implementation first to make sure everything's initialised:
BOOL CSomeDlg::OnInitDialog(void)
{
CDialog::OnInitDialog();
OnMyButton();
return TRUE; // Always return TRUE unless you set the focus to a control
}
Andy Metcalfe - Sonardyne International Ltd (andy.metcalfe@lineone.net) http://www.resorg.co.uk
"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
|
|
|
|
|
Yes it's ok, but in this way the function OnMyButton goes in execution before the visualisation of the dialog box.
I want that the function goes in execution just after the visualisation of the dialog box, because inside it there are some partial result to show in the dialog box.
I tried with OnShowWindow but even this goes in execution before before the visualisation.
Thanks in advance Paolo
|
|
|
|
|
Ok, I didn't realise that. There's probably an override you could hook to do what you want here, but I can't think what it could be.
You could try posting a command message to the dialog from OnInitDialog():
CMyDlg::OnInitDialog(void)
{
CDialog::OnInitDialog();
PostMessage(WM_COMMAND, IDC_MYBUTTON, 0);
return TRUE;
}
If you do this, your OnMyButton() handler will be called as if you'd pressed the button yourself. The message will be queued and so will not be processed until the messages before it have been handled - which should include showing and painting the window.
Good Luck.
Andy Metcalfe - Sonardyne International Ltd (andy.metcalfe@lineone.net) http://www.resorg.co.uk
"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
|
|
|
|
|
Great.
It works like I want.
Thanks a lot.
Paolo
|
|
|
|
|
Hi,
You could also use timer.
In the OnInitDialog()
SetTimer(1, 250, NULL);
In the OnTimer()
KillTimer(1);
//Your code
This have worked for me.
|
|
|
|
|
1. How could I move data from a "CString" variable to a "C++ standard string class" variable?
2. How could I move data from a "C++ standard string class" variable to a "CString" variable?
Thanks in advance.
|
|
|
|
|
look into the strcpy function
eg:
char* dest[1024];
CString sSource = "testline";
strcpy(dest, sSource);
|
|
|
|
|
I think this should help (I didn't check)
CString strMfc;
string strStl;
strMfc = "Aaaa";
strStl = strMfc; //1st assignment -> simple
strStl = "Bbbbb";
strMfc = strStl.c_str(); //2nd assignment -> use c_str() for char * conversion
Miroslav Rajcic
http://www.spacetide.com
|
|
|
|
|
Hello,
I'm working on a dialog for one of my projects that allows the user to enter various program settings. Since most of the values that must be entered are numerical I have to check them to make sure they are in the right range, etc. I've created integer member variables for every edit box I have on my dialog and set the range on each, however, if the user presses backspace to clear the 0 that is automatically put in the edit box they get yelled at instantly with a very annoying "Please Enter A Number" message box. What I would like to do is change these variables to CStrings and then make sure that all values are exceptable when the user clicks the OK button of my dialog. However, when I create a handle to capture the BN_CLICKED message of the OK button, add some code and run my program, the dialog box remains when the user presses OK. The dialog box is invoked from the rest of the program in an if statement: if (MyDialog.DoModal()==IDOK) ... How can I have my dialog do all necessary value checking when the user clicks OK and still close and return IDOK to the main program? I'm new to the world of MFC and Visual C++ and I haven't had any luck finding anything like this. I really appreciate any help, thanks!
Joseph LeBlanc,
unixd0od@hotmail.com
|
|
|
|
|
Ah - the dreaded M$ screwed up DDX bug.
You make them CStrings, as you thought, and keep the ints as a seperate variable. Hungarian notation is good here, ie m_szValue/m_iValue. Now go to your dialog editor and click on each edit box and add a handler function for EN_CHANGE ( from memory, it's the one that you get when someone types text ).
Now in your handler, UpdateData() to get the value in, parse it and pass the value to the int only if it is valid, but bring up a dialog only if the value given is positively wrong, rather than empty or on the way to being right ( i.e. if you accept 5-100, don't complain about < 100 until user presses OK, as they may have been entering 10, 27, 43, etc ).
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|