|
led mike wrote: I'll give you the same advice I do to others, and then you can ignore it also.
LMAO, great sig material.
|
|
|
|
|
led mike wrote: Learn basics and fundamentals ( pointers is a basic in C/C++) before you move on to things like STL and developing applications.
So much for my "cart before the horse" theory.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I should have known that was you.
led mike
|
|
|
|
|
Dear Friends,
Is there any API to get list of installed products in Windows?
Regards,
Krishnakumar
|
|
|
|
|
No. Even Windows doesn't know what's installed. You could just copy an app into a folder somewhere - the OS doesn't have to know anything about it.
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
I mean that, the list that is shown in the 'add/remove programs' in control panel.
|
|
|
|
|
Krishnakumartg wrote: I mean that, the list that is shown in the 'add/remove programs' in control panel.
That would be on HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Phil J Pearson wrote: You could just copy an app into a folder somewhere - the OS doesn't have to know anything about it.
But that doesn't count as an "installation", does it?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
It depends who's counting!
Phil
The opinions expressed in this post are not necessarily those of the author, especially if you find them impolite, inaccurate or inflammatory.
|
|
|
|
|
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Good Afternoon !
I have opened a handle of a COM port using CreateFile()
COMPortHandle = CreateFile ("COM1", GENERIC_READ | GENERIC_WRITE, 0,\
0, OPEN_EXISTING, 0, 0);
Now after that i do some other tasks.
Now i want to check the status of the handle i.e COMPortHandle
and close it if still opened, how to do it?
I do it in this manner, but i think it is not correct
if (COMPortHandle != NULL)
{
CloseHandle (COMPortHandle);
}
|
|
|
|
|
What do you mean by 'still opened' ? If you didn't close the handle yourself and if the CreateFile function succeeded, then your handle will still be opened. If you want to check if CreateFile was successfull, take a look at the documentation[^]: it returns INVALID_HANDLE_VALUE if it failed.
|
|
|
|
|
Hi
I want to have a scroll bar for a group-box control.
This is not possible bcoz the windows-os does not provide one , hence i was thinking of using a vertical-scroll control , but i was not successful.
Hence i thought of using a html page where in i can have a template and i can populate the values in the html page as i want programmatically.
I know this can be done in MFC , but i dont know whether the same can be done in win32 also.
Could any one help me
|
|
|
|
|
What I've done in the past is a bit complex, but a lot simpler than wiring up an HTML control - especially in Win32.
1/ Make a big overall window. Maybe a dialog box... The choice is up to you.
2/ Place a group control on it. This is just decoration.
3/ Place a vertical scroll bar next to, or just inside the right edge of the group box.
4/ Handle messages from WM_VSCROLL in your parent (eg) dialog.
5/ Create a child window taking up most of the space inside the group control. We'll call it PaneParent. This is blank, and does nething interesting except...
6/ Create a child window (call it Pane) inside the above child window. This Pane can be very large, and was also a modeless dialog box (with the WS_CHILD style set).
7/ When the scroll bar is used, move the Pane window about inside PaneParent. PaneParent will clip the Pane, so you only see a part of it.
Caveats - you'll also want the CONTROL and CONTROLPARENT styles set, to help the TABbing about.
None of this is easy, but it's OK if you break it into simpler bits. Make a dummy dialog with "I'm the top!", "I'm the middle!" and so on static controls on it until you have things working a bit more. But it's still easier than handling callback interfaces from an embedded browser control...
Iain.
|
|
|
|
|
gayatri.neelema wrote: I want to have a scroll bar for a group-box control.
Isn't a group box supposed to be static? How did you get this bad idea?
Why do you want to keep in so many things such that you will need a scroll bar? Not only will it require extra coding efforts, but it will look terrible. Ever heard of a tab control?
gayatri.neelema wrote: I know this can be done in MFC , but i dont know whether the same can be done in win32 also.
Yes.
gayatri.neelema wrote: Could any one help me
No, not for attaching a scroll-bar to a group box.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How can we a tab control be useful,
I am clueless about it.
I have lots of data to be displayed in a dialog , could you please help me
|
|
|
|
|
Rajesh's idea is a good one - mine was just telling you how to do something.
But his point is good. If you really have tons of stuff there, can you break it into sections? If so, read up on property sheets / property pages. Window's uses those in the control panel.
And MFC has CPropertyPage/Sheets all ready and waiting for you when you come back from reading.
Iain.
|
|
|
|
|
gayatri.neelema wrote: could you please help me
Of course yes, but read up on tab control (there are plenty of samples all over the internet) and if you encounter a trouble, come back and post what do you need help with.
It is not a very daunting task, if you ask me.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Create a group box with WS_VSCROLL style.
|
|
|
|
|
Hi,
I am working on an mfc application and implementing chat module. In chat module i need to give the function of sending emoticons. I am using a button with text emticons and when i click it i am opening a dialog box which is having several smiley.
Now the problem is that I want open the DialogBox having emoticons just above the button having text as emoticons. How can i position my DialogBox at just top of the button.
Thanks In Advance.
Dhiraj Kumar Saini
|
|
|
|
|
Make the coords of the button available to the dialog and then use SetWindowPos [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Please if u dont mind let me know how to get the coordinates of a button control.
Thanks.
|
|
|
|
|
GetWindowRect(), ScreenToClient() and things like that...
Just attempt to use the documentation. That will be the first step.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, in the chat window class (say CMyChat ):
(1) define a (public ) accessor for button coordinates, for instance,
CRect GetMyButtonRect();
(2) pass the this pointer to the dialog constructor, i.e.
CMyDialog myDlg(this);
Hence the dialog is able to get Button coords:
CMyChat * pParent = reinterpret_cast< CMyChat *> (GetParent());
CRect rcButton = pParent->GetMyButtonRect();
BTW: to retrieve button coords, use CButton::GetWindowRect() method.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
when debug my program, an error happens: Unhandled exception in **.exe (user32.dll) : 0xC0000005: Access Violation.
the stack information showed as follows:
USER32! 77d3e176()
USER32! 77d2927b()
USER32! 77d3a193()
USER32! 77d2c89a()
USER32! 77d306ec()
USER32! 77d18709()
USER32! 77d187eb()
USER32! 77d1c00e()
USER32! 77d1e366()
CWnd::DefWindowProcA(unsigned int 332, unsigned int 0, long 458752) line 1000 + 32 bytes
CWnd::WindowProc(unsigned int 332, unsigned int 0, long 458752) line 1586 + 26 bytes
AfxCallWndProc(CWnd * 0x0013b0a4 {CSkinComboBox hWnd=???}, HWND__ * 0x0016048e, unsigned int 332, unsigned int 0, long 458752) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x0016048e, unsigned int 332, unsigned int 0, long 458752) line 368
AfxWndProcDllStatic(HWND__ * 0x0016048e, unsigned int 332, unsigned int 0, long 458752) line 57 + 21 bytes
USER32! 77d18709()
USER32! 77d187eb()
USER32! 77d1b743()
USER32! 77d1e2f7()
CComboBox::FindString(int 0, const char * 0x00070000) line 746 + 26 bytes
CDlg::Fun1() line 599 + 20 bytes
CDlg::Fun2() line 408
_AfxDispatchCmdMsg(CCmdTarget * 0x0013a4a0 {CDlg}, unsigned int 1116, int 1, void (void)* 0x00ac1541
but my codes is:
if (dwOldItemData != 0)
{
//error place, but not every time. and comboSource is a CSkinComboBox object
int nNewSel = m_comboSource.FindString(0, (LPCTSTR)dwOldItemData);
if (nNewSel != LB_ERR)
{
m_comboSource.SetCurSel(nNewSel);
return;
}
}
so, what's the problem? thk u!!!
|
|
|
|