|
Code[^] segment.
Nibu thomas
Software Developer
|
|
|
|
|
I tried that those functions do not take a string as argument.
|
|
|
|
|
Exactly they take a single char.
That is what I said before. Scan through the string picking out each character and checking it.
Nibu thomas
Software Developer
|
|
|
|
|
I personally use
long strtol( const char *nptr, char **endptr, int base );
long wcstol( const wchar_t *nptr, wchar_t **endptr, int base ); with which a 0 return value can be checked against the endptr parameter to see if a conversion occurred or not.
--
The Blog: Bits and Pieces
|
|
|
|
|
Can anyone tell me how to write entries into "History Fodler" programmatically?
Thanks and Regards,
Anil
|
|
|
|
|
I have a Check Box in a dialog, I set "Disabled" as "True" in its properties. How can I enable it after I click a event handler during the program executing? If I want to disable it again, how can I do it?
What about a Radio Button? same way?
Thanks,
Joy Anne
|
|
|
|
|
Joy Anne wrote: How can I enable it after I click a event handler during the program executing? If I want to disable it again, how can I do it?
GetDlgItem(IDC_YOURCHECKBOX_ID)->EnableWindow(TRUE);
Nibu thomas
Software Developer
|
|
|
|
|
Just for the records:
Calling GetDlgItem is extremly bad style!
For enabling/disabling items in a program, you use the
ON_UPDATE_COMMAND_UI(IDC_YOURCHECKBOX_ID, OnUpdateYourCheckbox) idiom.
If you really need to manipulate the IDC_YOURCHECKBOX_ID-control, make a control variable and use this (as described by WhiteSky).
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 12:38 Thursday 16th March, 2006
|
|
|
|
|
jhwurmbach wrote: Calling GetDlgItem is extremly bad style!
I don't think so. What are the reasons?
Nibu thomas
Software Developer
|
|
|
|
|
Well, my statement may have come across a bit too strong.
But I believe that, in an object oriented environment, ou should use the object oriented way to do something.
By using the ID_SOMETHING resource constants directly, you are breaching confidentiality of the inner workings of the control-class.
You are working 'across' the MFC mechanisms, which I view as a bad thing when you have decided to use MFC.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
jhwurmbach wrote: Well, my statement may have come across a bit too strong.
No. I just wanted to know.
jhwurmbach wrote: But I believe that, in an object oriented environment, ou should use the object oriented way to do something.
True.
jhwurmbach wrote: By using the ID_SOMETHING resource constants directly, you are breaching confidentiality of the inner workings of the control-class.
Well GetDlgItem(ID...) returns a pointer to a CWnd object . I don't see any breach here.
jhwurmbach wrote: You are working 'across' the MFC mechanisms, which I view as a bad thing when you have decided to use MFC.
This is still MFC because it returns a CWnd pointer.
Well some advocate against using GetDlgItem but I personally like it.
Have you ever had problems with GetDlgItem , well I never had. I you had let please me know.
Nibu thomas
Software Developer
|
|
|
|
|
or
m_checkbox.EnableWindow(TRUE);
yes it's same
|
|
|
|
|
"Eventyy Tspe : Fwll Wwvefwrm"
"Version : V 8.01-8.0 MiniMate Plus"
"Shmplk Reta : 1024 wps"
"avt : ret/s and "
"ueak wecter Swm : 8.41 ww/t"
"Mar 10 /06 15:38:54 Mar 10 /06 15:39:11 Event qecerded.
"
"PC SW Verqiwn : V8.01 - 8.01"
Tranw Vertw Longw
0.127 0.127 0.0
0.127 0.127 0.127
0.127 0.127 0.127
0.127 0.127 0.127
0.127 0.127 0.127
0.127 0.127 0.127
0.127 0.127 0.0
-- modified at 23:19 Wednesday 15th March, 2006
|
|
|
|
|
I know I just finished an adult beverage but I am clueless why exactly you posted this here. Is this an answer to a question that someone posted? Or did codeproject somehow mess up??
[EDIT]
Ok, I think I know what you want. You are asking how to read in data like this line by line and store the last data into a 3 dimensional array...
[/EDIT]
John
-- modified at 23:44 Wednesday 15th March, 2006
|
|
|
|
|
In treeview when the paricular expanded node is made unexpanded after then it is expanded again , it shows the duplicate node of the expanded node.
-- modified at 23:18 Wednesday 15th March, 2006
|
|
|
|
|
pankajgarg12 wrote: In treeview when the paricular expanded node is made unexpanded after then it is expanded again , it shows the duplicate node of the expanded node.
You could be doing something wrong.
Nibu thomas
Software Developer
|
|
|
|
|
|
When using the afxThread, like following articles
http://www.codeproject.com/internet/winsockintro01.asp#xx959651xx
How to call back the MFC function write in the MFC class.
I want to make a response where recevce the message.
I try to add following code in afxThread:
CTestingDlg::AddLog("Hello");
when compile it make error:
illegal call of non-static member function
Can i pass out the value or call back the function outside the afxThread ?
Thanks
|
|
|
|
|
stny2000 wrote: CTestingDlg::AddLog("Hello");
AddLog is a member function and you are accessing it as if it is a static member function.
Create an instance of CTestingDlg and then access AddLog .
Note: You will get better answers if you can post this question to the author of this article.
Nibu thomas
Software Developer
|
|
|
|
|
Hi,
This is how you should use your thread:
AfxBeginThread(YourThreadName , this);
Now , in your thread :
UINT YourThreadName(LPVOID lpvoid)
{
YourClass *dlg = (YourClass *)lpvoid;
dlg->AddLog("Hellow");
}
Regards,
Eli
|
|
|
|
|
I want to extract the icon of any file or folder .Earlier I solved this portion of treeview in vb.net using the implementation of the following API's. I want to know the implementation in VC++ 6.0
Private Declare Auto Function SHGetFileInfo Lib "shell32.dll" (ByVal pszPath As String, _
ByVal dwFileAttributes As Integer, ByRef psfi As SHFileInfo, ByVal cbFileInfo As Integer, _
ByVal uFlags As Integer) As IntPtr
-- modified at 23:16 Wednesday 15th March, 2006
|
|
|
|
|
It's the same. Loop up MSDN for SHGetFileInfo for more details.
Nibu thomas
Software Developer
|
|
|
|
|
Can I get the link for my Query in vc++ 6.0 ?
|
|
|
|
|
SHFILEINFO shfi;
memset(&shfi,0,sizeof(shfi));
SHGetFileInfo("somebmpfile.bmp",
FILE_ATTRIBUTE_NORMAL,
&shfi, sizeof(shfi),
SHGFI_ICON|SHGFI_USEFILEATTRIBUTES
);
shfi.hIcon;
Nibu thomas
Software Developer
|
|
|
|
|