|
toanmtkh@yahoo.com wrote: I have tried subclassing the CFileDialog and set size of it in OnDestroy() and on OnInitDialog() but not successed.
What didn't work? It works for me.
|
|
|
|
|
I think you could specify a hook, and in that procedure, respond to the WM_INITDIALOG message. In addition, you'll most likely need to use GetOpenFileName() instead of CFileDialog .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Friends,
I've a simple dialog based application and when user right clicks on the dialog window, a menu gets opened.
Now the menu gets closed when user presses escape key or click on the dialog. I want to detect that the menu has been closed.
How can i determine that the menu has been closed ? Is there any such event ?
Imtiaz
|
|
|
|
|
|
Hi,
int id;
const int ********::get_id() const
{
return id;
}
I want to do these operations.
**** gh;
int th = gh.get_id (how is it possibele to type cast)
int th =10;
if (th == gh.get_id) (how is it possible to compare)
COleDateTime& CTableInfo::edit_date()
{
return edit_date;
}
CtableInfo in;
COleDateTime ct;
ct = in.edit_date(); //this is not happening and
//'=' : cannot convert from 'class COleDateTime (__thiscall
CToleranceTableInfo::*)(void)' to 'class COleDateTime *'
give me some solution...
thanks in advance..
bye
kk
kk
|
|
|
|
|
to understand problem easily, can you reword your problem. Are ***** placeholders for something ?
|
|
|
|
|
Hi,
int id;
const int Cinfo::get_id() const
{
return id;
}
I want to do these operations.
CInfo gh; //take obj of the class in some way.
int th = gh.get_id (how is it possibele to type cast)
int th =10;
if (th == gh.get_id) (how is it possible to compare)
COleDateTime CTableInfo::edit_date()
{
return edit_date;
}
COleDateTime ct;
CtableInfo in;
ct = in.edit_date(); //this is not happening and
//'=' : cannot convert from 'class COleDateTime (__thiscall
CToleranceTableInfo::*)(void)' to 'class COleDateTime *'
|
|
|
|
|
Cinfo::get_id() is a member function, so to call it you have to use the parameters at the end to denote the parameter list. If not you are getting the address of the function.
int th = gh.get_id(); kk_mfc wrote: COleDateTime CTableInfo::edit_date()
{
return edit_date;
}
Give your function and member variables different names. Right now the function is trying to return it's own address, cast to a COleDateTime pointer. It can not do that.
|
|
|
|
|
Thanks ...
the first solution worked out...
i am already using a different variable name...
COleDateTime CTableInfo::get_edit_date()
{
return m_edit_date;
}
COleDateTime dt;
CTableInfo cy;
dt = cy.get_edit_date();
error mess binary '=' : no operator defined which takes a right-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
and i am trying to compare the current date with previous date
if(dt == cy.get_edit_date())
if(dt > cy.get_edit_date())
error
binary '==' : no operator defined which takes a left-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
kk
|
|
|
|
|
What are the error numbers that the compiler gives you (C####)? Looking up those numbers in MSDN can be very helpful in figuring out the errors.
|
|
|
|
|
kk_mfc wrote:
COleDateTime dt;
CTableInfo cy;
dt = cy.get_edit_date();
error mess binary '=' : no operator defined which takes a right-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
The code you've shown is correct. The problem is related to other code that you've not shown. Change your CTableInfo class such that only necessary statements are present. In other words, remove the statements that have nothing to do with the problem.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You are not described complete code here.
This code with some spelling correction should work.
kk_mfc wrote: if (th == gh.get_id) (how is it possible to compare)
I think you want to use ,
if (th == gh.get_id ())
{
}
kk_mfc wrote: COleDateTime CTableInfo::edit_date()
{
return edit_date;
}
You have kept class member variable name and function name same.
kk_mfc wrote: ct = in.edit_date(); //this is not happening and
//'=' : cannot convert from 'class COleDateTime (__thiscall
CToleranceTableInfo::*)(void)' to 'class COleDateTime *'
If you corrected above mistake , this error should not come.
whats CToleranceTableInfo
? Thats why I said, you have not desribed your problem clearly.
|
|
|
|
|
Thanks ...
the first solution worked out...
i am already using a different variable name...
COleDateTime CTableInfo::get_edit_date()
{
return m_edit_date;
}
COleDateTime dt;
CTableInfo cy;
dt = cy.get_edit_date();
error mess binary '=' : no operator defined which takes a right-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
and i am trying to compare the current date with previous date
if(dt == cy.get_edit_date())
if(dt > cy.get_edit_date())
error
binary '==' : no operator defined which takes a left-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
kk
|
|
|
|
|
Thanks ...
the first solution worked out...
i am already using a different variable name...
COleDateTime CTableInfo::get_edit_date()
{
return m_edit_date;
}
COleDateTime dt;
CTableInfo cy;
dt = cy.get_edit_date();
error mess binary '=' : no operator defined which takes a right-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
and i am trying to compare the current date with previous date
if(dt == cy.get_edit_date())
if(dt > cy.get_edit_date())
error
binary '==' : no operator defined which takes a left-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
kk
|
|
|
|
|
prasad_som wrote: Are ***** placeholders for something ?
My first thought was a pointer to a pointer to a pointer...
My eyes just glazed over!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
kk_mfc wrote: const int ********::get_id() const
{
return id;
}
I want to do these operations.
**** gh;
int th = gh.get_id (how is it possibele to type cast)
ACtually you are returning const int and your are taking it value in normal int..
either change th to const int th or remove const declaration from Get_id function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
Thanks ...
the first solution worked out...
i am already using a different variable name...
COleDateTime CTableInfo::get_edit_date()
{
return m_edit_date;
}
COleDateTime dt;
CTableInfo cy;
dt = cy.get_edit_date();
error mess binary '=' : no operator defined which takes a right-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
and i am trying to compare the current date with previous date
if(dt == cy.get_edit_date())
if(dt > cy.get_edit_date())
error
binary '==' : no operator defined which takes a left-hand operand of type 'class COleDateTime' (or there is no acceptable conversion)
kk
|
|
|
|
|
Hi,
I intend to integrate the functionality of two dlls into one by means of merging the code. I'm adopting the following steps.
1) Create a master framework for the merged entity say dll A.
2) Include all the files that are distinct for the two dlls(B & C) into the project created for dll A.
3) For all the files that are same in dll B and C, include a single file into the merged entity and into that file put all the functions that are distinct in the file under B and C.
I think this should suffice. Please correct if there is something to be done
The problem comes for functions that are same in the common file.
Say in dll B We have a function like
class B : function()
{
}
Say in dll C We have a function like
class C : function()
{
}
Here the two different functions need to be merged into a single function under a class name.
Now my question is how does the merged entity break into two workflows similar to the functional behavior in the previous separate dlls? What kind of conditional can be put for identifying the different behaviors?
Thanks
|
|
|
|
|
When you say they are two different functions then I feel there is no need to merge them as single function . Still , to do that just pass a boolean variable to function(bool flow) to determine which block of function() should be executed
redindian
|
|
|
|
|
how do i determine the boolean value
|
|
|
|
|
Hello everyone,
Could someone help me for how to open a RAS dial up using RasDial function knowing that
an adsl modem used, i wrote this code below
bool DialUp()
{
// Fill RASDIALPARAMS structure
RASDIALPARAMS rdParams;
rdParams.dwSize = sizeof(RASDIALPARAMS);
rdParams.szEntryName[0] = '\0';
lstrcpy(rdParams.szPhoneNumber, szPhoneNumberToDial);
rdParams.szCallbackNumber[0] = '\0';
lstrcpy( rdParams.szUserName, szUserName );
lstrcpy( rdParams.szPassword, szPassword );
rdParams.szDomain[0] = '\0';
HRASCONN hRasConn = NULL;
DWORD dwRet = RasDial( NULL, NULL, &rdParams, 0L, NULL, &hRasConn );
// Everything OK?
if (dwRet == 0)
return true;
// Error occurred - get error description and alert user
char szBuf[256];
if (RasGetErrorString( (UINT)dwRet, (LPSTR)szBuf, 256 ) != 0 )
wsprintf( (LPSTR)szBuf, "Undefined RAS Dial Error (%ld).", dwRet );
RasHangUp( hRasConn );
MessageBox( NULL, (LPSTR)szBuf, "Error", MB_OK | MB_ICONSTOP );
return false;
}
but when i excute the program i see the error message tell me that i have a bad modem configuration or modem port problem (my modem cofiguration is good)
any idea??
Thank you
---
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
First thing to try is to properly initialize the RASDIALPARAMS structure before you use it.
bool DialUp()
{
RASDIALPARAMS rdParams = {0};
rdParams.dwSize = sizeof(RASDIALPARAMS);
...
|
|
|
|
|
It working fine when I tried this function to open the remote access service via telephone line and without adsl, But the function fail with adsl modem (USB cable), my question is:
does RAS dialing used for such connection ??(As you know most adsl connection use PPP protocol), beside that the DUN or WININET APIs are not important for me bcos i can set all connection configuration easily by filling RASDIALPARAMS structure ..
I welcome any idea
--
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
Oh! damn!! the problem is self explained, i forgot that the RAS used for phone line and not for
adsl and particularly Virtual Private Network !
Thanks for help anyway
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
Just wondering what the most compact way of writing this code is and how the c++ compiler implements the evalution order.
ps is a ptr to an unsigned char *
Under gcc-3.3.4 with -Wall there are no warnings with
*ps++=0xFF-*ps;
*ps++=0xFF-*ps;
*ps++=0xFF-*ps;
Under gcc-4 ps might be used unitialised.
The code below fixes the ordering problem But I was wondering if the LHS and RHS are evaluated in parallel in non deterministic order?
*ps=0xFF-*ps; ps++:
*ps=0xFF-*ps; ps++;
*ps=0xFF-*ps; ps++;
I would be interested in faster / more compact ways of doing this. Assembly?
I was also wondering without going to assembly if this is the fastest way of accessing the values in the register.
Thanks,
|
|
|
|