|
Actually, ShowWindow (SW_HIDE) .
/ravi
|
|
|
|
|
si_69 wrote: as i have three radio controls within a group i can only add a control variable to the first item in the group
This is a common misconception. Each radio button can have it's own control variable.
si_69 wrote: can anyone help. hope that all makes sense
I prefer to use this[^] class.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I am new to windows programming. In my code I would require to change the slider bar position, which I have accomplished by sending message.
::SendMessage( aControlHWnd, TBM_SETPOS, (WPARAM) (BOOL) TRUE, (LPARAM)(LONG) aPosition );
The problem is with the updation of the window according to the new sliderbar position, I mean, when I change the position of the sliderbar it is changed visually, but the corresponding values in other objects (like textbox showing the value related to this sliderbar) are not updated.
To accomplish this I tried
::NotifyWinEvent( EVENT_OBJECT_VALUECHANGE, theDialogHWnd, OBJID_HSCROLL, CHILDID_SELF );
where theDialogHWnd is the handle for the dialog window containing the sliderbar and the textbox, but it didn't work. I am not sure if the parameters I am using are correct, or the event I am trying to notify, or may be my approach to the problem itself is wrong. I do understand that this can be easily accomplished by sending a keyboard or mouse event, but I am tryin not to use it.
Any help would be greatly appriciated.
Thanks.
|
|
|
|
|
I'm not too sure, but try to set
UpdateData(TRUE);
on the control
|
|
|
|
|
Instead of NotifyWinEvent(), you could just add a function to your dialog window class
(or wherever appropriate) which updates all the related controls based on the trackbar's position.
Call this function whenever you set the position programmatically and also call it when you're
notified that the user has changed the position.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
i want to check greater than 255 value in ipaddress field but when i enter value greater than 255 it automatically change to 255 at that time i cant get what i typed.so i cant check greater than 255 value.how can i do that
|
|
|
|
|
Then It wouldn't be an IPaddress
What's your purpose of doing that?
--
=====
Arman
|
|
|
|
|
when the user type greater then 255 i want to post a error message.
In windows Local area Connection wizard display this kind of message.i want to do that like this.
|
|
|
|
|
Hi,
The one way could be by customizing the CEdit control using mask. You create ur own IPAddress control class, in which u can handle all validations as per your requirement.
Manoj
Never Give up
|
|
|
|
|
prathuraj wrote: when i enter value greater than 255 it automatically change to 255 at that time
If you are using a SysIPAddress32 window class (CIPAddressCtrl if using MFC), this is done automatically.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to read line by line in a text file by using CStdioFile .But I have some problem when my application run.VC++ notice a error messages.Please help me to fix where wrong in my code.Here is my code :
<br />
void CTestForm::LoadFile()<br />
{<br />
TRY<br />
{<br />
CStdioFile file("cauhoi.txt", CFile::modeRead|CFile::typeText);<br />
CArchive ar( &file, CArchive::load );<br />
CString data;<br />
<br />
BOOL finished = FALSE;<br />
<br />
while (!finished)<br />
{<br />
CQuestionData * pQues = new CQuestionData();<br />
pQues->Serialize(ar);<br />
if (pQues->GetData() == "") <br />
{<br />
delete pQues;<br />
finished = TRUE;<br />
}<br />
}<br />
ar.Close();<br />
}<br />
CATCH( CFileException, cfe)<br />
{<br />
}<br />
CATCH(CMemoryException, cme)<br />
{<br />
cme->ReportError();<br />
}<br />
CATCH(CArchiveException, cae)<br />
{<br />
}<br />
END_CATCH<br />
}<br />
void CQuestionData::Serialize(CArchive &ar)<br />
{<br />
CObject::Serialize(ar);<br />
<br />
if(ar.IsStoring())<br />
{<br />
}<br />
else<br />
{<br />
if (!ar.ReadString(data))<br />
{<br />
return;<br />
}<br />
ar.ReadString(data);<br />
while(data != "")<br />
{<br />
if(data == "#Q")<br />
{<br />
m_count++;<br />
ar.ReadString(data);<br />
m_sQues = data;<br />
ar.ReadString(data);<br />
}<br />
else if(data == "#A")<br />
{ <br />
ar.ReadString(data);<br />
while(data != "#Q")<br />
{<br />
m_arrAns[dem++] = data; <br />
ar.ReadString(data);<br />
}<br />
}<br />
<br />
}<br />
<br />
}<br />
}<br />
nothing
|
|
|
|
|
|
What is the error message?
|
|
|
|
|
From your code snippet, two things are missing in the serialize function. The variables "dem" and "data" do not seem to have been declared. I'm assuming based upon your naming conventions that member variable start with a "m_" so it would appear these are not member variables at first glance.
// Copy of your snippet
void CQuestionData::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if(ar.IsStoring()) {
} else {
// TODO: add loading code here
if (!ar.ReadString(data)) {
return;
}
ar.ReadString(data);
while(data != "") {
if(data == "#Q") {
m_count++;
ar.ReadString(data);
m_sQues = data;
ar.ReadString(data);
} else {
if(data == "#A") {
ar.ReadString(data);
while(data != "#Q") {
m_arrAns[dem++] = data;
ar.ReadString(data);
}
}
}
}
}
}
|
|
|
|
|
|
whale84 wrote: when my application is running, it suddenly stand by.
So why not use your debugger to step through the code to find the statement(s) that are "standing by?"
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I click on menu File=>Open Workspace then select *.dsw file that I want.
but nothing load to VC++.
Please advise me for solve this problem.
I use Visual c++ 6.
|
|
|
|
|
|
Try the following:
1. Close VC++.
2. Delete the *.opt, *.ncb, *.aps and *.clw files (don't worry - they will be recreated later).
3. Reopen the VC++ and select your *.dsw.
|
|
|
|
|
|
Can you tell me more.
What is the root cause of this problem?
|
|
|
|
|
These files are generated by VC++. They contain information about your project/workspace, for example the *.clw holds Class-Wizard information and *.ncb contain intellisense data for your project.
When VC++ loads your project, it collects data from these files (if they do not exist, they are rebuilt).
If one of these files gets corrupted (don't ask me why, but it happens , then VC++ fails to load your project/workspace. So the solution is to just delete these files and let VC++ rebuild them properly ...
|
|
|
|
|
What is the function that can be used to clear the data in the list box to display new data?
--Star
|
|
|
|
|
|