|
On Win2000 the File dialog is resizable. So it has to handle WM_SIZE in order to properly move/size child controls, including the listview showing folder contents. Calling SetWindowPos causes WM_SIZE to be sent to your dialog and controls are repositioned.
You can't just place a button on File dialog, if you want to extend/customize its functionality, you'll have to read "Explorer-Style Custom Templates" topic in MSDN. It's somewhere under User Input/Common Dialog Box Library/Open and Save as dialog boxes.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sir,
Thanks for the reply...
I have used this flag while at the DoModal Time but its behaviour is same..
Also I have got some thing new as
CListCtrl* pLCtrl;
BOOL bWin2k = FALSE;
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(osvi);
::GetVersionEx(&osvi);
if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion == 5)
bWin2k = TRUE;
if (bWin2k)
{
CWnd *pWnd = GetParent()->GetDlgItem(lst2);
pLCtrl = (CListCtrl*)pWnd->GetDlgItem(1);
}
else
pLCtrl = (CListCtrl*)GetParent()->GetDlgItem(lst1);
return pLCtrl;
can u tell me sir why
pLCtrl = (CListCtrl*)pWnd->GetDlgItem(1);
is used..........
|
|
|
|
|
I have used this flag while at the DoModal Time
What are you talking about? Which flag? If you want your dialog to behave correctly under W2K, read the MSDN article I've pointed you at.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Sir,
I have read this article and it is about Hook procedures as i am new to VC programming tell me what are these.........
|
|
|
|
|
Check the KB article Q195034: "HOWTO: OfnKing Demonstrates CFileDialog Customization"
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
maybe look at this server's dialog section
t!
|
|
|
|
|
maybe look at this server's dialog section
Sorry I can't Understand Please Explain..?
|
|
|
|
|
there are some articles about file dialog at
http://www.codeproject.com/dialog/
Windows Common dialogs and others sections
i thought it will help you
t!
|
|
|
|
|
yes
I have seen all these but all these are using resource dialog but i want to use the windows standard dialog by deriving a class from the CFileDialog......
|
|
|
|
|
minimaly example you giving in another thread not thinks about w98
t!
|
|
|
|
|
Why don't you just use Paolo Mesina's CResizableDialog class (article posted here on Code Project. It's very comprehensive.
|
|
|
|
|
Geez - he's using common File Open dialog, and is having problems with resizability introduced in W2K. How do you think CResizableDialog fits into this picture?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am using MSComm OCX in my VC++ project. Basically, I want to transmit & receive a Data from PC ( Com port1) to an embedded device also designed by me.
The problem is that, '0' is not being transmitted or received by VC++, while it is possible in VB.
Can anybody help me?
Thanking you in advance.
Sr. Engineer
R & D,
Hi-rel Electronics LTd.
INDIA.
|
|
|
|
|
Hello,
I would like to know how to integrate an excel sheet in an VC++6.0 application.
Can you help me? or tell me where can i find such an information.
Thanks.
|
|
|
|
|
|
I have a bunch of printers installed and I want to choose which to print to at run time (using code only - no user interface).
I know the names of the printers (as they appear in control panel printers folder) and i know the name of the one i want to use.
So what i need is, something like a SetCurrentPrinter(strMyPrinterName) func.
Any ideas?
|
|
|
|
|
If you're using Win32 API only, pass the name of the printer as 2nd parameter to CreateDC. With MFC, you can also use CWinApp::SelectPrinter and CWinApp::CreatePrinterDC.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thanks, i am using MFC, so i'll try SelectPrinter. I cant use the DC oriented methods since i am using a library to do all the printing legwork (i just need to select a printer in advance...)
|
|
|
|
|
Depending on what your library does, you may check the docs for SetDefaultPrinter API function. It's available only on Win2000, but documentation contains code that performs the same thing on earlier systems with GetProfileString, WriteProfileString and SendNotifyMessage.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi all,
I'm writing ActiveX ...
I have simple question, How can i get size of my ActiveX ? (I mean RECT)
Thanks for all helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi all,
I wrote some functions in my header file,
I wanna create .LIB file of my header file, How can i do that ?
Thanks for all helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I would put the declarations in a header file, and the implementations in a cpp file. Then all the files should go into a DLL project (if it's MFC it should be a MFC extions DLL project). All the classes should be exported (AFX_EXT_CLASS). The compiler will generate a .dll file and a .lib file that you can include into your project.
If you don't want to use a DLL then AFAIK you cannot make a lib file. Then just include your .h and .cpp files in the project in question.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Hi Steen, Thanks for reply,
You said, "All the classes should be exported (AFX_EXT_CLASS).", I didn't understand,
Can you explain more with an example ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi Hadi,
if you want to use the classes in your DLL outside the DLL you have to export them. And, in the program that uses the classes you have to import them. This is how you do that:
class __declspec(dllexport) CYourClass
{
public:
int m_iSomeInt;
void SomeMethod();
....
};
void CYourClass::SomeMethod()
{
...
}
Now, put all this in a DLL project and compile it. It will produce a .dll file and a .lib file.
To use this class in another program you'd have to import it:
class __declspec(dllimport) CYourClass
{
public:
int m_iSomeInt;
void SomeMethod();
....
};
#include YourClass.h
class CSomeOtherClass : public CYourClass
{
.....
};
As you can see, the file YourClass.h contains the declaration of CYourClass in both the DLL project and in the application project. The only difference between the two YourClass.h files is the use of __declspec - to export the class you use __declspec(dllexport), to import it you use __declspec(dllimport). Since it's stupid to maintain two versions of the YourClass.h file MFC uses conditional compiles to solve it. The define AFX_EXT_CLASS is defined as __declspec(dllexport) in DLL projects (more precisely in MFC extension DLL projects where the symbol _AFXEXT is automatically defined) and as __declspec(dllimport) in MFC application projects (_AFXEXT is not defined).
So the bottom line is: Put the declaration of your extension class in a header, and put AFX_EXT_CLASS between the class keyword and the class name. Include this header in your extension dll project along with the cpp file containing the implementation of the class and compile it. Put the generated lib file in the lib path in the project settings of your application project, and include the header file (containing the declaration of the extension class) in the application project - but not the cpp file with the implemention. Then everything should work nicely!
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thank you for your reply ... That was very nice,
If i defined class in LIB ...
I must first link .LIB to my project ...
Then i'll can use of class in .LIB ...
And i don't need to any otherthings ..
Is it true ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|