|
Oh.
Here's the code:
BOOL CPropertyPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
SetColumnHeaders();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPropertyPage::SetColumnHeaders()
{
m_lstPage1.InsertColumn(0, "Text here", LVCFMT_CENTER, 50, -1);
m_lstPage1.InsertColumn(1, "Text here", LVCFMT_LEFT, 100, -1);
m_lstPage1.InsertColumn(2, "Text here", LVCFMT_CENTER, 100, -1);
m_lstPage1.InsertColumn(3, "Text here", LVCFMT_CENTER, 100, -1);
m_lstPage1.InsertColumn(4, "Text here", LVCFMT_RIGHT, 100, -1);
m_lstPage1.InsertColumn(5, "Text here", LVCFMT_CENTER, 100, -1);
m_lstPage1.InsertColumn(6, "Text here", LVCFMT_CENTER, 100, -1);
}
This is all inside the Property Page class.
|
|
|
|
|
I think I got it figured out. I needed a separate function for each page in the Property Sheet.
But I'm still having a problem with placing buttons on the Property Sheet. No matter what I do, the button will not show up.
Any ideas or suggestions are appreciated.
|
|
|
|
|
bcemick wrote:
I think I got it figured out. I needed a separate function for each page in the Property Sheet
Correct. For each page/tab on the sheet, a separate CPropertyPage object is needed.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
bcemick wrote:
m_btnRead.Create("Text Goes Here", WS_VISIBLE | BS_PUSHBUTTON, CRect(10, 50, 100, 208), pWnd, 1);
You need the WS_CHILD style, WS_TABSTOP would also be helpful if you want to be able to use the tab key to get to your buttons. Also, make sure the rect you specify is in your sheets client coordinates, and not off the sheet somewhere.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hello gurus,
I would like to know how to read and write bytes on a USB connection device?
I do ::CreateFile(strUsb, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL) where strUsb contains the path to the port "\\.\[path] I obtain my handle, then when I try to read and write bytes via ReadFile and WriteFile , nothing happens.
Can any one show me how to read and write bytes on a usb port?
Thanks.
Best regards.
There is no spoon.
|
|
|
|
|
to write to an usb port....the application should know tye existence of the usb driver....
for that u should have written the inf file for the driver which gives the detailz abt the driver.....ofcourse u can avoid that if u r using the windows builtin drivers.....
check out this link.....
http://www.lvr.com/usb.htm [^]
hope that helpz.....
cherrz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hi,
I've got a project where for some reason unicode support is turned on in the code, I've come to this conclusion because it is using the "W" versions of certain functions. I've done a search for #define UNICODE but didn't find in the code. I don't see an option for this in the Visual Studio Preferences either. Is there another way to turn it off?
Thanks
Hua-Ying
|
|
|
|
|
Did you search for both UNICODE and _UNICODE in the .h, .cpp and .dsp files?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes I searched for both UNICODE and _UNICODE.
|
|
|
|
|
I found it!!
My project was generated by another program and it set the Preprocessor define UNICODE in the project. So it was in the Project Properites setting under C/C++ > Preprocessor > Preprocessor Definitions. This is the reason it didn't show up when I searched the code for #define UNICODE.
Thanks for the help!!
Hua-ying
|
|
|
|
|
I am trying to display an avi file in Aniomate control.
The frames are not displayed right. Bottom ( aroung 1 cm ) is getting clipped and displayed at top and the right ( about 1 cm )is displayed on the left. Could some one help me with this.
I want to copy the frame and put it on the clipboard. I don't know how to do that.
Appreciate any help. Chunk of code would be great.
Meena
|
|
|
|
|
try editing the dialog view.....(if itz a dialog based application nad if u have derived ur own static control from the CStatic)u get the avi clipped maybe becoz u have got the static frame smaller in diamension.....
dunno if u hacve done the sam eway.....hope thiz helpz.....
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hello , i want to count the no. ofwindows opened on my computer , with their names , 4 that i am using EnumWindows and EnumWindowProc ,but i am getting the following error , i had tried my hints but the condition remain same
error C2440: 'type cast' : cannot convert from '' to 'int (__stdcall *)(struct HWND__ *,long)'
what 2 do ??
Thx
Rahul Agarwal
|
|
|
|
|
You EnumWindowsProc function is declared wrong. It has to be either a global function
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) or a static class member
static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
this little piece of code will help you.
BOOL EnumVisibleWindows(CStringArray *arWindowsName,CPtrArray *arhWnd)
{
HWND hWnd,hWnd1=NULL;
CString Str;
char lpString[201];
hWnd=::GetDesktopWindow();
do
{
hWnd1=::FindWindowEx(hWnd,hWnd1,NULL,NULL);
::GetWindowText(hWnd1,lpString,200);
Str.Format(\"%s\",lpString);
//select only visible desktop window
If((::IsWindowVisible(hWnd1)==TRUE)&&(Str!=\"\"))
{
arhWnd->Add((HWND)hWnd1);
arWindowsName->Add(Str);
}
}while(hWnd1!=NULL);
return TRUE;
}
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I've been reseaching Property Sheets for a couple of days now and I'm starting to get the hang of them. I have created a Property Sheet with 5 Property pages; each page contains some controls for displaying and manipulating data.
What I'm wondering is how do I go about adding buttons and a menu to the Property Sheet, not the Property Page? I've read a few things here and other places, but nothing seems to fit (or work) with what I'm working on.
Any help would be appreciated.
|
|
|
|
|
Everything is done in your propertysheet's OnCreate() member function.
For a menu, add a CMenu variable (m_Menu) to your property sheet class. In OnCreate call
m_Menu.LoadMenu(IDR_MENU1);
SetMenu(&m_Menu);
For buttons, add CButton members to your property sheet class. In OnCreate call m_Button.Create(...) for each button.
You can handle the commands from the menu and buttons using regular MFC message mapping.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Thank you. I was expecting some long, drawn-out ordeal. Once again, I was over-thinking the whole process.
|
|
|
|
|
Hi,
I'm new to Win32 programming, and I have to add dialog resource and management in a static lib in order to be used by other application.
I've added dialog resource in lib project and include all ATL stuff inside lib.
Everything compile ok but ATL create dialog function failed with 1812 error, complaining that no resource are present in exe image.
The base application is a classic win32 project without MFC.
What should I check ?
Thanks
Fabrice
|
|
|
|
|
Resources go into Dynamic Link Libraies or executables. They do not go into static link libraries.
|
|
|
|
|
Hi everyone.
I would like to connect to an sql database using MDAC. Can anyone give me a piece of code that shows how to create the connection object and what headers/other file I have to use ?
THANKZ.
|
|
|
|
|
|
Thankz ... I have found there the clues I needed
|
|
|
|
|
How do you open another form when you click on a command button.
I tried looking up the information using the forum search etc but it comes up with no results.
Thank you
|
|
|
|
|
BritishEmpire wrote:
How do you open another form when you click on a command button.
This sounds like VB syntax, or have the terms "form" and "command button" been moved into VC++ .Net also? What exactly is it that you are trying to do?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|