|
|
Thanks Paresh.
But I want to know which API system calls when we create a folder from explorer on vista.
|
|
|
|
|
CreateDirectoryEx()? SHCreateDirectoryEx()?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hi All,
If I place a button in a dialog box, my perception is that the button should be the part of my dialog class. But when I see my dialog box there is no Button object.
How can I access that Button object. I need that object because I want to enable and disable that button according to some condition.
I also want to attach toottip to that button.
Please let me know if further clarification is required.
Suraj
|
|
|
|
|
Gupta Suraj wrote: How can I access that Button object. I need that object because I want to enable and disable that button according to some condition.
You need to associate a variable with the button (how to do this depends of which IDE you are using). The variable type must be a CButton in order to access functionalities of your button.
|
|
|
|
|
Other way is....
CWnd *pWnd = GetDlgItem( IDC_BUTTON/* Ur Button ID */);
pWnd->EnableWindow( FALSE );//Disable the button
pWnd->EnableWindow( TRUE );//Enable the button
|
|
|
|
|
Gupta Suraj wrote: my perception is that the button should be the part of my dialog class.
Dialog class will be based on dilaog template resource, button would be part of that resource.
Gupta Suraj wrote: How can I access that Button object. I need that object because I want to enable and disable that button according to some condition.
Apart from method Cedric has suggested, you can use GetDlgItem function for accessing controls on dialog,too.
GetDlgItem(IDC_MYBUTTON)->EnableWindow(FALSE);
|
|
|
|
|
If u r using VC++
Put the button in the Dialog.
Right Click on it and select "add variable"
Select access type (public/private)
Select Variable type (CButton)
Give a variable name (ex: m_buttonHello)
Now in the source file (.cpp) for dialog class
write: m_buttonHello.EnableWindow(TRUE) or m_buttonHello.EnableWindow(FALSE)
wherever necessary
Cheers
|
|
|
|
|
Hi!
I am using Visual studio 2005.Net and writing an application in VC++.
I am using Microsoft Hirarchical FlexGrid Control 6.0 activex control in my project.
I want to use the combobox in the cell of the flexgrid while i am doing this i am
not getting the combobox dropped down while clicking on it instead it goes behind the
flexgrid.
Viral Joshi
|
|
|
|
|
Could you please share your code so that it would be easier to track down the issue ?
|
|
|
|
|
i am trying to pass a integer value to my thread
int i = 9;
int *k;
k = (int*)i;
AfxBeginThread(Test,k);
and then using it in my thread like this
UINT Test(LPVOID pParam)
{
time_test = *(static_cast<int*>(param));
}
time_test is declared globaly as integer variable.
but the line written in thread declaration is giving a debug error while running
please help me in this
|
|
|
|
|
sulabh_expert@rediffmail.com wrote: time_test is declared globaly as integer variable.
Why would you provide the thread with an integer value only to assign it to a global variable that could read from the thread in the first place if the main thread had assign the desired value to it?
To get started the right way when learning multithreading, have a look at Joe Newcomer's excellent article here[^].
It will teach you the basics and prevent you from making common mistakes.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
sulabh_expert@rediffmail.com wrote: k = (int*)i;
That's a mistake, you should do k = &i; .
If you need read-only access to the external parameter, use, something like the following code:
int i=9;
AfxBeginThread(Test, (LPVOID)i);
...
UINT Test(LPVOID pParam)
{
int iValue = (int) pParam;
}
On the other hand, if you need full access to the externa parameter, the code will be:
int i=9;
AfxBeginThread(Test, (LPVOID)&i);
...
UINT Test(LPVOID pParam)
{
int * piValue = (int*) pParam;
*piValue = 7;
}
Hope that helps.
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.
|
|
|
|
|
|
NO.
Simply CString class overloads the (LPCTSTR) cast operator. See MSDN.
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.
|
|
|
|
|
devvvy wrote: Question is, why'd this work? Is CString really LPCTSTR
CString::Left returns a CString and CString overloads the operator LPCTSTR. See here[^]
|
|
|
|
|
devvvy wrote: pTest = strSomeString.Left(3); < Question is, why'd this work?
Did you not read the documentation? CString::Left(int) will not return LPCTSTR value. What is that you exactly want to do?
devvvy wrote: Is CString really LPCTSTR?
No.
|
|
|
|
|
I think the question lies here:
"Be careful with this operator. If you change a CString object after you have obtained the character pointer, you may cause a reallocation of memory that invalidates the pointer."
|
|
|
|
|
devvvy wrote: "Be careful with this operator. If you change a CString object after you have obtained the character pointer, you may cause a reallocation of memory that invalidates the pointer."
I agree. But it's handy and hopefully prevents some guys to do things such
p=(char*)myString.GetBuffer(20); that may be even more dangerous.
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.
|
|
|
|
|
Why deleting your question ?
|
|
|
|
|
He did not want to overload the server hard disk.
|
|
|
|
|
Maybe he has classmate on the codeproject that deletes his message
|
|
|
|
|
Hi all,
lets say i have this function in a ReadWrite.cpp file:
void CReadWriteDlg::OnButton4()
{
AfxMessageBox("test");
}
how do i call this function from a function in a different file altogether, say, SystemTray.cpp:
void CSystemTray::OnMyDeviceChange(WPARAM wParam, LPARAM lParam)
{
CReadWriteDlg::OnButton4(); //whats the correct syntax for this???
.
.
.
.
}
any help is greatly appreciated!
thanks!
|
|
|
|
|
Is this code helpfuls
CMain *m_Main=(CMain*)GetParent();
m_Main->Variable for function;
|
|
|
|
|
If you work with Dialogs then have CWnd and handles. So it is right to use PostMessage with user defined messages ( ->RegisterMessage ). PostMessage is better then SendMessage because it puts the message in the internal message queue. Read the fine MSDN.
Greetings from Germany
|
|
|
|