|
I am looking for some information on how to implement the computer system hardware classes and I am haveing ALOT of trouble finding
any info. I have looked on MSDN but it only shows me what some of the API's do not how to use them.
Can anyone help me with this one??
Cory
|
|
|
|
|
I'm drawing the text of a menu using DrawText. I have everything working nicely except that the tabs in the menu strings aren't the same length as the normal menu tabs are. I'll make a little picture of what this causes. 'Open' will be owner drawn and the rest will be normal.
Open---Ctrl+O
Save-------Ctrl+S
The owner drawn accelerator isn't aligned with normal accelerator... ignore the - I don't think the html will keep it spaced that way...
Is there any way I can draw it correctly?
Justin
|
|
|
|
|
Hi,
I have an MFC dialog application that uses an ActiveX component also written by me (in VB). The control has been updated to include some new methods and events. The original control was placed into the dialog resource with the dialog editor and Class Wizard generated the wrapper classes for it.
So now the control is updated how do I get the application to use the new control with the new methods available and new events in the dialog class?
Thanks
Sid
|
|
|
|
|
Hi,
Can anybody give me some informations or samples code about printing MSHFlexgrid data and structure
in VC++ ?
Thanks in advance
|
|
|
|
|
here i am doing a program with Windows Explorer style
my question is how to get context menu
when i right click on the empty part of the listview
if i right click an object things are under control
thx
|
|
|
|
|
Hello everyone:
I have a question about bringing a window containing an ActiveX control to the top if it is partially obscured by another window. It's kind of long but please bear with me.
For instance, say MyControl is my ActiveX Control I created that is inside a client consisting of a single window (we'll call it MyClient) - note that the client area of MyControl fills up the entire window of MyClient. Suppose another application's window obscures partially the MyClient window with MyControl in it (therefore, MyClient does not have focus). If I click on the non-obscured area of MyClient (which is actually clicking on the non-obscured client area of MyControl), how can I bring MyClient and coincidentally MyControl to the forefront and setfocus on MyClient?
Now, here comes the twist. MyControl follows the Single Document-View (SDI) architecture. That is, the client area of MyControl is actually a CScrollView, with a CDocument, as part of CSingleDocTemplate object created in the InitInstance of the MyControl's COleControlModule. The CMainFrame is derived from CFrameWnd, but it has no caption bar or border, thereby allowing for a more visually pleasing embedded appearance in the client.
So, what I did was handle the WM_LBUTTONUP handler of my derived CScrollView. I then propagated the the WM_LBUTTONUP msg up to my MyControl's derived COleControl class. There, I managed to get the IOleContainer interface pointer as illustrated below (CMyCtrl is derived from COleControl):
void CMyCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
IOleContainer* pContainer = NULL;
BOOL rc = FALSE;
if(SUCCEEDED(GetClientSite()->GetContainer(&pContainer)))
{
CWnd* pParent = GetParent();
if(pParent)
{
CRect parentrect, rect;
pParent->GetWindowRect(&parentrect);
GetWindowRect(&rect);
//pParent->SetWindowPos(&wndTop, parentrect.left, parentrect.top, parentrect.Width(), parentrect.Height(), SWP_NOMOVE | SWP_NOSIZE );
pParent->SetFocus();
}
}
if(pContainer)
pContainer->Release();
COleControl::OnLButtonUp(nFlags, point);
}
The "pParent->SetFocus()" works with the control inside a CWnd of a container application, but how can I make it work if MyControl is embedded in the _view of an SDI client application_? Is there anything that I can do with IOleContainer pointer pContainer to bring the container (be it a dialog, a window, or a CView) to the forefront when it is clicked on?
And here's the other thing - say that MyControl does not have focus and it is in MyClient's window. However, MyClient's window (that has MyControl in it) is partially obscured by another application's window, but the unobscured part of MyControl has an edit box (the edit box is a child MFC control and is part of MyControl's CScrollView) visible, and the user clicks on the edit box to set focus on it AND to bring MyClient to the top over the other application's window. How can I do this?
And to make things even more complicated, how can you do this without adding/changing code in MyClient, and only do it MyControl's codebase?
I know my message/query is kind of long, but I would appreciate any help that you can give me.
Thank you very much.
- Mike G
|
|
|
|
|
I am desperately looking for help as how to make my software 30 days demo (trial) version. How can I add security features. Can someone point me to some C++ classes or project.
Thank you all
James Khan
|
|
|
|
|
I've been using ShareLock by by Ken Nesbitt.
Go to http://www.nesbitt.com/products.html
Also look at "Install Maker" by Click Team at http://www.clickteam.com
|
|
|
|
|
Hello Mark:
Thanks for the reply. I appreciate your feedback. I downloaded "Install Maker"..However, I also wanted to add security features in my application. For that, I need either MFC classes or some sample code from codeproject. If you know anything then please let me know.
Thanks again.
James
|
|
|
|
|
Hi,
I am trying to develop a COM that will get the text from the browser & later on converted into Speech. I am working in SAPI & doing most of the core works. I just want to get some few suggestion from this board that is my steps (mentioned above) are suitable or not? If you have any alternate one please reply. Actually, I am novice in SAPI.
Thanks a lot.
With Best Regards,
Sarose joshi
Nepal
|
|
|
|
|
I am attempting to host of the band objects used by IE and Windows Explorer in my own application. Specifically, I wish to host the "Explorer Band" object, which displays the folder list in Windows Explorer (and is available in IE).
Has anyone successfully reused any of the bands that ship with IE or Windows? I would like some clues on what to do next. My hope is to not have to recreate the functinoality of the "Explorer Band" specifically for my app...
I am able to create the band object and host it. Presently I am having problems getting it to display properly but I believe I can overcome this (my host does not call IDockingWindow::ResizeBorderDW(), and the band is sizing itself to 0px x 0px).
But I am worried that I will not be able to do much with this band once it is displaying. Seemingly, the band accepts commands on IDispatch or IOleCommandTarget, but I have no clue what the actual calls might be. This is where I need help.
Any input appreciated!
Nick Hodapp
|
|
|
|
|
Hi Nick,
I hope I don't confuse the issue for you Nick, but a few things I have learnt are,
Useful interfaces are,
IOleWindow.
IObjectWithSite
IPersistStream
IDeskBand
and yes IDockingWindow,
I havent tried IDispatch or IOleCommandTarget yet
IObjectWithSite 's SetSite method allows access to the containers interfaces eg IOleInPlaceObject, and IInputObjectSite etc
Also IUnknown is real useful, to find the above,
eg Maybe with your current problem, use IUnknown to get the site of IOleWindow, Then use IOleWindow 's GetWindow method to get the HWND of the parent,
Then all you need to do is register and create the window,
Also normally the bands width is kept somewhere in the registry with other info.
OK, Sounds easy doesn't it
I wish it was.
|
|
|
|
|
Hi Colin:
Yes, I determined the same list of interfaces supported by the Explorer Band (or "Folders") band object using the OLE/COM Object Viewer. Fact is, I can host the band just fine -- it completely initializes itself and creates its HWND as expected, I just don't know how to make it do stuff.
This band object supports IServiceProvider, through which you can obtain interfaces that aren't necessarily implemented by the object itself. Unfortuntately, I do not know what interfaces it can provide. It would be nice if COM allowed one to enumerate the interfaces on an object...
Anyone else have input?
Thanks!
Nick Hodapp
|
|
|
|
|
hi!
can anyone tell me how to prevent the user from resizing
the listview column header? i'm using MFC btw.
thx!
|
|
|
|
|
I have not used column headers in a list view before but let me hazard a guess.
Try subclassing the listview and capturing the LVM_SETCOLUMNWIDTH message. Replace the new column width with your own hard-coded width then send the LVM_SETCOLUMNWIDTH message to the default control proc.
Tell me if it works.
|
|
|
|
|
umm, how do i catch the LVM_SETCOLUMNWIDTH message?
it's not available in the ClassWizard event list...
|
|
|
|
|
You should be able find LVM_SETCOLUMNWIDTH in the
ClassWizard.
Open the Class Wizard and (in the Message Maps tab) look at the list box labeled "Object IDs:". By default the class name of the dialog will be selected. Search further down the list until you find the resource ID of your ListView control then select it. The "Messages:" list box to the right will then show the messages appropriate for ListView controls. Search through the list to find the one you want.
Good luck.
|
|
|
|
|
I must appologize. I went through the steps that I previously gave you and didn't find LVM_SETCOLUMNWIDTH.
After further thought I feel that you will have to subclass the ListView control (CListCtrl) with your own class that inherits from CListCtrl. Override the WindowProc function. (You'll find WindowProc in class CWnd.) The prototype should look as follows: (I hope all this formatting doesn't get lost. I'll double space to be certain.)
LRESULT CYourClass::WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
And the body should appear somewhat as follows: (I have not actually done this with CListCtrl but it should work.)
// Begin Body
{
int nFixedWidth = 100; // Hard-coded width
switch ( message ) {
case LVM_SETCOLUMNWIDTH:
// override lParam
lParam = MAKELPARAM( nFixedWidth, 0);
break;
}
return CListCtrl::WindowProc(message, wParam, lParam);
}
// End body
The value assigned to nFixedWidth is in list view coordinates.
It looks fairly simple. I hope this works for you
|
|
|
|
|
Hi
I think you should use the HDN_* notification messages,
together with HD_HITTESTINFO and may be WM_MOUSEMOVE and then if conditions are fullfilled just not route these messages any further.
Kurt
|
|
|
|
|
Hello ,
I am new to Internet Programming in VC++.
Can anyone of you out there inform me about how i can generate a form post that a browser generates when send the form post to the webserver.
Thanks in advance.
Regards
|
|
|
|
|
Hi,
Using Windows Sockets you are connecting to the HTTP server and then you send/receive data in the HTTP protocol. You can find all information you need in RFC 1945 "Hypertext Transfer Protocol -- HTTP/1.0" at http://www.rfc-editor.org/rfc/rfc1945.txt.
I you are not experienced in RFC reading/implementing check our Ultimate TCP/IP 3.0 product at www.dundas.com. This product can help you a lot.
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.as HTTP/1.1
Content-Length: 17
[empty_line]
lastname=Alfadhly
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname and a submit button named Send in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.as HTTP/1.1
Content-Length: 28
[empty_line]
lastname=Alfadhly&Send=Submit
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Hi Alex,
to add to your answer.
I have noticed a common mistake most people fall in
they forget to target the correct url
for example if they have an in box called Lastname and a submit button named Send in an asp page called page1.asp
they would send their post Request as follow
using telnet connect to www.anyserver.com port 80
then they would send the following ascii lines
// SNIPP
POST /page1.asp HTTP/1.1
Content-Length: 28
[empty_line]
lastname=Alfadhly&Send=Submit
[empty_line]
// SNIPP
although these steps are correct since it includes the three most importent pieces of the post i.e
1) POST command and the target url plus the protocol version
2) The conent length header of the data in the request
3) the data it self e.g lastname=Alfadhly
[NOTE:] I have ommited other headers such as referer and Host, and Cookies ] if they are used in the aps page
Most programmers tend to forget to look at the source of the asp page and forget thaat the target should be the one identified by the ACTION parameter of the post
I hope this might help
|
|
|
|
|
Can I simulate the process of moving a mouse to an edit control and click the mouse button,
type in some words or password, and click an OK button (or press enter)?
Thanks
|
|
|
|