|
Hi All
I have a two class Class A and Class B.I have a public type function sun();in class A.And i want to call function sun() in class B. How can i call it?Plz help me.
Thanks in Advance
|
|
|
|
|
MsmVc wrote: How can i call it?
In the context of a class A object.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
class A
{
public:
void sun()
{
}
};
class B
{
public:
void B::callSun()
{
A a;
a.sun();
}
};
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks all it's working..
Your reply help me
|
|
|
|
|
Is there any way to pass some parameters to DialogBox function in win32 api
Actually I want to pass some values to it . I donot want to them global
INT_PTR DialogBox( HINSTANCE hInstance,
LPCTSTR lpTemplate,
HWND hWndParent,
DLGPROC lpDialogFunc
);
Ashish
|
|
|
|
|
use DialogBoxParam()
Prasann
|
|
|
|
|
Hi all,
i am writing this code
char Label[256]="";
char FS[256]="";
DWORD SerialNumber=0, MaxFileLen=0, FileSysFlag=0;
if (GetVolumeInformation(str,Label,256,&SerialNumber,
&MaxFileLen,&FileSysFlag,
FS,256))
{
Temp.Format(_T("%X"), SerialNumber);
Temp=CString(_T("Serial Number: ")) + Temp.Left(4) +
CString(_T("-")) + Temp.Right(4) + CString(_T("\r\n"));
Result+=Temp;
}
buts its giving a error
error C2664: 'GetVolumeInformationW' : cannot convert parameter 2 from 'char [256]' to 'LPWSTR'
how can i remove this
thanks in advance
|
|
|
|
|
i think ur project settings use Unicode character set. so u have to use unicode strings (wide char like WCHAR)
prasann
|
|
|
|
|
thanks it solved my problem but i wanted to know one more thing i want label of my drive... which api i can use for doing so???
|
|
|
|
|
VCProgrammer wrote: char Label[256]="";char FS[256]="";
Since you are using Unicode:
TCHAR Label[256] = _T("");
TCHAR FS[256] = _T("");
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi,
How to get the current style of ListView control at runtime and what message i need to pass to fetch the stle of List control.
Please reply me.
|
|
|
|
|
Can you tell us what exactly you want to do ??
I mean why you need the styles??
Regards,
Sandip.
|
|
|
|
|
Hi,
The Following styles are possible for ListView control
* LV_VIEW_DETAILS (Report)
* LV_VIEW_ICON (icon)
* LV_VIEW_LIST(list)
* LV_VIEW_SMALLICON
* LV_VIEW_TILE
i need to get the style of ListView control like listView stye as Report or icon or list. For that which message i need to send to fetch the style of List control.
i want to change the style of the ListView control according to user choice at runtime.
|
|
|
|
|
You can use CListCtrl member function GetView() to retrieve the view type.
If you are not using MFC you can pass LVM_GETVIEW message. check this link for details.
LVM_GETVIEW[^]
Regards,
Sandip.
|
|
|
|
|
If i am using that it throwing the Error at complie time itself.
"error C2065: 'LVM_GETVIEW' : undeclared identifier"
|
|
|
|
|
did you include
#include "commctrl.h"
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
Hi,
After i include "commctrl.h", still it throwing the same error. whether i need to inlcude any dll for that?
|
|
|
|
|
Bernaad wrote: How to get the current style of ListView control at runtime...
By calling GetWindowLong(hWnd, GWL_STYLE) .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
get this problem when trying to set a break point and debug with F10 in my code.
Any idea why this happens?
Any help will be appriciated.
Thanks
|
|
|
|
|
Where should I delete Dlg
If I delete in the MainFrame::~MainFrame(), it is giving following error
Unhandled exception at 0x006d7074 in ang.exe:0xC0000005
Access violation reading location 0xcdcdcdcd
LRESULT MainFrm::OnStart(WPARAM wParam, LPARAM lParam)
{
CString strPrgDlgTitle;
THREADSTRUCT_MF *_param = new THREADSTRUCT_MF;
_param->_this = this;
Dlg= new CDlg( this ,iMaxVal,iVal,str);
AfxBeginThread (StartProgThread, _param);
}
UINT MainFrm::StartProgThread (LPVOID param)
{
THREADSTRUCT_MF* ts = (THREADSTRUCT_MF*)param;
ts->_this->Dlg->DoModal();
return 1;
}
|
|
|
|
|
i'd delete it in the MainFrm destructor
and, i'd initialize Dlg to NULL in the constructor, and i'd make sure i checked that Dlg wasn't NULL before i tried doing anything with it anywhere else.
|
|
|
|
|
ptr_Electron wrote: Unhandled exception at 0x006d7074 in ang.exe:0xC0000005
Access violation reading location 0xcdcdcdcd
Have you used the debugger to step through the code to find the offending statement(s)?
ptr_Electron wrote: ts->_this->Dlg->DoModal();
It's not a good idea for a secondary thread to operate directly on a UI component owned by another thread. What you have looks as though it would block the primary thread.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
the crash is @ delete dlg;
|
|
|
|
|
I've a SDI project where View class is derived from
CFormView.
I need to change the form of the View on the fly in
order to show a different form for each application
status.
Is it possible to do that ? How ?
Thanks a lot !
|
|
|
|
|
I will suggest you to reconsider your design.
Having multiple views for SDI and switching between them i don't think is advisable.
Regards,
Sandip.
|
|
|
|