|
You can modify the version by editing the Version section in your DLL project's resource file.
|
|
|
|
|
|
Hi,
I am creating a dialog in which I have to use the Spin control.Firstly I am code for the very first time in MFC.
I have created the dialog and drag dropped the controls on it.
I have taken the Edit control and on its right side I have placed the Spin control.
Please tell me that how I will attach the two controls and what are the property setting to be done in both the control.
Thanks
|
|
|
|
|
Dear friend, i think it will better if you try a hand with the book "Programming Windows with MFC(Jeff prosise)" [^].
The properties you need depends on your requirement, by default some properties are set.
Величие не Бога может быть недооценена.
|
|
|
|
|
Thanks Adam for your reply
Regarding properties I want to is that "Can we do it by setting the property or we have to do it by programming."
|
|
|
|
|
It depends on your need, if you want to set at run time then surely depend on APIs.
else you can set some properties are default.
Величие не Бога может быть недооценена.
|
|
|
|
|
I want to set it through properties.I have done with all the other part by the help of Rajeesh. Can u please tell me how to set the range
|
|
|
|
|
For a spin control, for setting range property you have depend on CSpinButtonCtrl::SetRange() [^] function itself.
Величие не Бога может быть недооценена.
|
|
|
|
|
You can set 'Auto Buddy' property of the spin control to True. This property will automatically attach spin control to the pervious window (editbox in this case) in z-order. You may have to set the 'Set Buddy Integer' property to True as well.
|
|
|
|
|
I have made the Auto Buddy property of spin control as true and also set the Set Buddy Integer as true.
I didn't get "in z-order"
Is there any changes to be done in the properties of edit box
|
|
|
|
|
You will have to make sure that edit box comes before the spin control in tab order. You can open the dialog in resource view and press Ctrl+D to make sure that the tab order is correct.
|
|
|
|
|
I made the tab order as u said.One more question can we give the range say for example 0 - 40 in the edit box which can be incremented or decremented by the spin control (by clicking upward and downward arrow).If yes then where to put it.
Thanks
|
|
|
|
|
Thanks,
I did the same.
Now please tell me how set the range
|
|
|
|
|
|
Hello everyone !
I want to find some files in the whole disk drive , the code like this :
void C***Dlg::EmuFiles(CString strPath, CString strType)
{
WIN32_FIND_DATA data;
CString csPath(strPath);
csPath = csPath + "\\*." +strType;
HANDLE handle = FindFirstFile((LPCSTR)csPath,&data);
BOOL ret = (BOOL)handle;
while(ret)
{
if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
if(data.cFileName[0] != '.')
{
csPath = strPath;
csPath +="\\";
csPath += data.cFileName;
EmuFiles(csPath,strType);
}
}
else
{
csPath = strPath;
csPath +="\\";
csPath += data.cFileName;
m_ListBox.InsertString(nCount,csPath);
m_ListBox.SetCurSel(nCount);
m_nTotal = nCount;
UpdateData(FALSE);
nCount ++;
}
ret = FindNextFile(handle,&data);
}
FindClose(handle);
}
when I use EmuFiles("C:\WINDOWS","exe"), it can be found.
but if I use EmuFiles("C:","exe"),it can't be found as more.
how to set the WIN32_FIND_DATA's parameters to find whole disk?
|
|
|
|
|
You should ideally be calling it as
EmuFiles(_T("C:\\Windows"), _T("exe"));
and
EmuFiles(_T("C:"), _T("exe"));
|
|
|
|
|
wangningyu wrote:
HANDLE handle = FindFirstFile((LPCSTR)csPath,&data);
BOOL ret = (BOOL)handle;
What in the world is this? If FindFirstFile() fails, it will return -1 , thus assigning TRUE to ret .
wangningyu wrote: UpdateData(FALSE);
While I would not use this at all, I especially would not use it in a loop.
wangningyu wrote: when I use EmuFiles("C:\WINDOWS","exe"), it can be found.
This should not even compile.
wangningyu wrote: ...it can't be found as more.
Which means what exactly? Do you have any .exe files/folders in your root folder?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Don't use the extension as the parameter for FindFirstFile/FindNextFile, use "*.*" and then filter out the files with the extension you're looking for. This is probably also the reason why it doesn't recurse into directories.
|
|
|
|
|
but MS only give us this function to find files .
any else ?
|
|
|
|
|
You lost me.
Anyway, try something like this:
BOOL EnumFilesRecursive(CString csStartDir)
{
CString csCurFile;
CString csDir = csStartDir;
if (csDir.Right(1) != "\\")
csDir += "\\";
csDir += "*.*";
CFileFind ff;
BOOL bWorking = ff.FindFile(csDir);
while (bWorking == TRUE)
{
bWorking = ff.FindNextFile();
if (ff.IsDirectory())
{
if (ff.IsDots())
continue;
EnumFilesRecursive(ff.GetFilePath());
}
else
{
csCurFile = ff.GetFilePath();
}
}
return TRUE;
}
Edit: code corrected.
modified on Wednesday, December 16, 2009 11:12 AM
|
|
|
|
|
A directory is just a special kind of file.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all,
i've a question(hypothetical situation):
There are two class
class1 with a void funct_cl1()and other methods;
(class1 use observer paradigm, funct_cl1 will be called with high frequency)
class2 is a thread with some functions;
In class2 i initialized class1 pointer like this: class1* cls1 = new class1() and i use some method of its but never funct_cl1.
if i put in pause (p.e with a long sleep) the thread of class2, the funct_cl1 belong to cls1 can be anyway executed with observer paradigm or is it block?
Regards
Marco
|
|
|
|
|
Hi Marco, I try an answer.
Yes you can call a method from another thread, any object can be accessed from other threads. The real question is if the called functionality will be multithreading safe. Maybe this isn't even an issue in your case and you just wondered about ownership: Sleep() will only stop execution of one thread, but not prevent memory access from other threads. For example if class 2 creates an object of class1, which then is only used/called from another thread context, you don't even have to worry about multithreading (as long as lifetime of "class2 object thread" is longer than "class1 object thread").
Hope it helps
/M
|
|
|
|
|