Click to See Complete Forum and Search --> : controls
AltayKarakus
April 16th, 2003, 02:27 PM
Hi I try to use progress bar for my appplication that I code them with vc++ and non-mfc. I could add button, edit box and some others but when try to add progress bar or tree control it runs but noting show and close as soon as posible.
why this happens?
mahanare
April 17th, 2003, 04:25 AM
in order to enable other codegurus to think abt your problem, you can provide the source code you are working with.
that will help others to help you.
cheers
mahanare
AltayKarakus
April 18th, 2003, 04:37 AM
Ok thanx for your mentions, here what I do and what I want to do.
I open a new Win32 project from visual c++ projects in Visual Studio.NET 2002. Then from application settings I select windows application as Application type and select empty project. Then I include the following code to it.
*************************************************
//WinMain.cpp
#include <windows.h>
#define ID_TIMER 1
BOOL CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
hInst = hInstance;
int DlgResult = DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINDLG), NULL, DlgProc);
return 0;
}
BOOL CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
//....
//....
//....
return 0;
}
return 0;
}
*************************************************
then I try to make my Dialog by using resource editor. It work with no problem when I add simple items like button edit area but when I try to use smthg like drag and drop a progress bar or tree view the project does not give any errror but does not appear. If you want I could pass you the hole solution file. I only think that there could be a project setting needed to use this kind of controls. I also try to create the prograss bar by using createwindow function. Also it does the same thing: no effect.
If you pass me a full solution files that created with Visual studio which use a progress bar I could check its setting with mine.
Also I do not get any problem while try same things to do with visual studio 6.0.
It is a very bad stuation I do not take any error message but ýt does not work.:confused:
mail for attacs
karakusal@itu.edu.tr
regular mail:
altaykarakus@hotmail.com
Ajay Vijay
April 18th, 2003, 04:52 AM
... but you should put your code in .... It will also help it understand your code better.
Please disregard 'x' in [] above as that may have its effect!
rxbagain
April 22nd, 2003, 11:47 AM
To use common controls in Win32 Application (eg. progress bar). You have to register first the window class by calling InitCommonControlsEx before calling DialogBox.
For example in using Progress bar:
INITCOMMONCONTROLSEX icc = {sizeof(icc), ICC_PROGRESS_CLASS};
InitCommonControlsEx(&icc);
DialogBox(...)
For complete list of common controls, see INITCOMMONCONTROLSEX in MSDN.
Hope this will help you.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.