15,917,321 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Shiva S.S (Top 17 by date)
Shiva S.S
2-May-11 0:16am
View
Thanks Niklas,
You are absolutely right, i have to use binary mode for both reading and writing.
For this i need to add a single line before fopen_s().
_set_fmode(_O_BINARY);
After this it works very fine.Once again thank everyone helped me in this.
Shiva S.S
30-Apr-11 4:35am
View
Deleted
Thanks for your reply niklas,
Can you please suggest me, which mode will be better to hold this kind of binary data?
Shiva S.S
30-Apr-11 2:52am
View
Hi everyone,
After a bit struggle, finally i found where i went wrong.I thank everyone, who helped me in this,Special thanks to Olivier, who spent lot of time for me,i learned a lot from his answers.
Now i am able to access my controls in my Base dialog, from any of my derived class.
Problem was with this line,CBaseDialogLogicDlg objBaseDialog;
objBaseDialog.ChangeCheckStatus(2);
Here i am creating an object of my base class,and simply calling my base class member function, which updates the control.
I made two correctionsin my derived class.
1.Instead of a normal object, i've created a pointer object to my base class.
CBaseDialogLogicDlg *objBaseDialog;
2.Then i need to add the following lines in my derived class, before using my pointer object.
LPVOID lpParam;objBaseDialog = (CBaseDialogLogicDlg *)lpParam;
This lpParam is 'this' pointer of my CBaseDialogLogicDlg dialog class.
Now i can access any of my control of my base dialog from my derived class itself.
Hope i fixed the problem correctly.
Shiva S.S
11-Apr-11 9:50am
View
Thanks Olivier,
Here i am not calling OnInitDialog() anywhere in my code, but if i put a breakpoint in my derived OnInitDialog and see, control never comes inside, when will be this derived OnInitDialog get called?.
Shiva..
Shiva S.S
11-Apr-11 9:33am
View
Hi olivier,
Now i want to glarify one thing here, i tried this line in my derived OnInitDialog(),
return __super::OnInitDialog();
but it is giving assertion error(ASSERT(::IsWindow(m_hWnd))continuously, My doubt is , how this OnInitDialog() should be called, in my derived class?
Will it be called automatically like in CBaseDialog Class, or i should call?, I know that OnInitDialog will be called when 'DoModal' the dialog.
If i should 'DoModal', how it should be done, which will be the best place to do?. if this is clear, it will be much helpful for me. Please reply.
Shiva..
Shiva S.S
11-Apr-11 8:12am
View
Hi Olivier,
I found the probelm and cleared it. It is running, but sorry to say, it is giving Assertion error again at the same line.i tried with all the possibilities(SetCheck,SetCheckState,SetItemState). How can i fix it?,Please reply me.
Shiva.
Shiva S.S
11-Apr-11 6:46am
View
Hi Olivier,
Thanks for your quick reply,the idea you gave me was very much helpful, i tried to replace that line, with your code. But it gives the following compile time error.
CSampleDialogLogicDlg::ChangeCheckStatus(2); //Compilation error at this line
error:'CSampleDialogLogicDlg::ChangeCheckStatus' : illegal call of non static member function.
What should i do to rectify this? Please reply.
Shiva.
Shiva S.S
11-Apr-11 2:44am
View
Thanks for your reply Albert. i shall post part of my code, please go through.
In Base.h file,
class CBaseDialogDlg : public CDialog
{
public:
CSampleDialogLogicDlg(CWnd* pParent = NULL); // standard constructor
virtual BOOL OnInitDialog();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
/****Some Variable declaration********/
};
In my Base.cpp file,
CBaseDialogDlg::CBaseDialogDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBaseDialogDlg::IDD, pParent)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CBaseDialogDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST2, m_gridCtrlEx); // List control
DDX_Control(pDX, IDC_EDIT1, t_findVar);
DDX_Control(pDX, IDC_LIST1, m_gridOutput); // List control2
DDX_Control(pDX, IDC_BUTTON1, b_startThread);
}
BOOL CBaseDialogDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Some auto code
//Inserting items into list control
m_gridOutput.SetExtendedStyle(m_gridCtrlEx.GetExtendedStyle() | LVS_EX_CHECKBOXES);
m_gridOutput.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE | LVS_LIST | LVS_EX_CHECKBOXES | DFCS_CHECKED,0,0);
for(int index = 0; index <(sizeof(Nv_OutputBits) / sizeof(int));index++)
{
m_gridOutput.InsertItem(index,Nv_OutputBits[index]);
}
ChangeCheckStatus(1); // NO PROBLEM WITH THIS CALL
}
void CBaseDialogDlg::ChangeCheckStatus(int VarId)
{
m_gridOutput.SetCheck(VarId,TRUE);
}
In my derived .h file,
class CMlkOne : public CBaseDialogDlg
{
public:
CMlkOne();
//Some code
virtual BOOL OnInitDialog();
protected:
virtual void DoDataExchange(CDataExchange* pDX);
};
In my derived cpp file,
CMlkOne::CMlkOne()
{
}
BOOL CMlkOne::OnInitDialog()
{
return TRUE;
}
void CMlkOne::DoDataExchange(CDataExchange* pDX)
{
CSampleDialogLogicDlg::DoDataExchange(pDX);
}
void CMlkOne::ChangeVariableValue(int VarId, int VarValue)
{
CSampleDialogLogicDlg objBaseDialog;
objBaseDialog.ChangeCheckStatus(2); // Assertion Error bcos of this line
}
Should i add some extra initialization code in DoDataExchange(Derived) or OnInitDialog(Derived)?, what i am missing in my derived class, i am struggling with this, Any help will be very much helpful.
Shiva.
Shiva S.S
9-Apr-11 1:39am
View
Hi Albert,
Thanks a lot for your answer.So if i want to access any control(of CDialog)from my derived class ,before i need to create the window, here what is meant by creating the window?.
And ofcourse, i am doing all my GUI initialization in OnInitDialog(), not the constructor. Should i reinitilaize all my GUI controls in my derived class, if i want to access it from Derived one?.
Please glarify this, it will be very much helpful for me.And i already googled related to this, if you can please provide any articles related to this.
Shiva.
Shiva S.S
9-Apr-11 1:26am
View
Thanks a lot Olivier, for your reply. Here I am answering your questions.
->Yes,CSampleDlg is fully functional one.I can display it, using DoModal.
->I am not using different resource for CDerivedOne,as you said it is just to add some methods.
Pls reply.
Shiva S.S
8-Apr-11 6:19am
View
Deleted
Thank you so much Olivier, It seems, there is some problem with page or something else,i dont know. I am not able to see, reply link anywhere, any pbm?
Shiva S.S
8-Apr-11 6:10am
View
Deleted
Thanks a lot Olivier, for your reply. Here I am answering your questions.
->Yes,CSampleDlg is fully functional one.I can display it, using DoModal.
->I am not using different resource for CDerivedOne,as you said it is just to add some methods.
Pls reply.
Shiva S.S
8-Apr-11 6:06am
View
Deleted
Thank you so much Eugen. I cannot find, DoDataExchange in my derived class. Should i include it,by using properties window(or) it will be auto generated?. Pls reply.
Shiva S.S
31-Mar-11 5:55am
View
Thank you so much for your excellent answer. Now i realised that, my assumption was wrong, and learned this.
Shiva S.S
26-Mar-11 3:26am
View
Hi Joan,
Thanks a lot for your excellent answer. But I need one more assistance from you.
If i use this GetExtendedStyle, I am getting Checkboxes only in the first column.
I am not able to insert values with checkboxes at the second column of grid.
Am i missing something here. Pls help me in this.
Shiva.
Shiva S.S
26-Mar-11 0:20am
View
Thank you so much Joan. I got it.
Shiva S.S
1-Jul-10 10:50am
View
Reason for my vote of 3
for reference link
Show More