|
I am developing an ActiveX control to display a image. if image size is big i should provide scroll bar. i attached the scroll bar by changing the cs.style = cs.style | WS_HSCROLL | WS_VSCROLL;
But when i click on scroll bar at run time it is not scrolling the image.
how to do this please me.
|
|
|
|
|
How to get the location of a button placed in a dialog box designed with resouce editor?
i tried with mybutton->GetWindowRect() and mybutton->GetClientRect().
but both does n't give the location of the button.
|
|
|
|
|
in what way it does not give the position of the button ?
CRect rect<br />
mybutton->GetWindowRect(rect);<br />
will give the pixel rectangle of the button relative to its parent window.
CRect rect<br />
mybutton->GetClientRect(rect);<br />
will give the pixel rectangle of the client region of the button.
remember that the positions and sizes in the resource editor ARE NOT PIXELS.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have a couple of modeless dialogs as children of a parent dialog ( also modeless ).
when I DestroyWindow the parent dialog, the different child dialogs are beeing destroyed; but one of them behaves weird.
in one dialog, I have a CListBox; and when the child dialog gets destroy; somewhere; the call stack is not really usefull ( NTDLL, CWnd::OnCommand, CCmdTarget, ... ), and the only place where I actually
SetFocus<code> to the CListBox is not called there.<br />
<br />
The question, When doing a DestroyWindow, will/should the child controls of a modeless dialog individually receive the focus ?<br />
<br />
Thanks ... <br />
<br />
<hr><a href="http://www.thesorus.qc.ca">Maximilien Lincourt</a><br />
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
When doing a DestroyWindow, will/should the child controls of a modeless dialog individually receive the focus ?
No. They'll get destroyed without receiving focus, unless one of your WM_DESTROY handlers is explicity setting the focus to one that is about to be destroyed.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
this is what is bugging me; I call DestroyWindow on my dialog, and it goes directly to the handle for the LBN_FOCUS even if there is no call to SetFocus; and the call stack goes from the function that calls DestroyWindow to the Handler for the LBN_FOCUS.
Are there other ways that a control can get/receive the focus ?
I will try to reduce the problem to something more manageable and get more info.
Thank.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
I call DestroyWindow on my dialog, and it goes directly to the handle for the LBN_FOCUS even if there is no call to SetFocus
That will be because it previously had the focus, and it is now losing the focus as it's destroyed.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I need to put together a sample project that does one simple(?) task in C++
Inherit System.Exception
override Message
return my own Message
What I have so far...help is greatly appreciated.
<br />
<br />
<br />
#pragma once<br />
<br />
using namespace System;<br />
using namespace System::Diagnostics;<br />
<br />
namespace TestCPlus<br />
{<br />
class MyException : public System::Exception<br />
{<br />
public:<br />
int rCode;<br />
char* blah;
char* Message : System::Exception::Message<br />
{<br />
return blah;<br />
};<br />
};<br />
}<br />
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
Hope this will help,
Serge
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
__gc class MyException : public System::Exception
{
public:
__property virtual String* get_Message() {return "Hello, World!";}
};
int main()
{
try
{
throw new MyException;
}
catch (MyException *e)
{
Console::WriteLine(e->Message);
}
return 0;
}
|
|
|
|
|
Serge,
Thank you very much. So here is the big question:
Is there a way in C++ to append comments to methods and properties as there is in C#. I know that C++.net does not recognize the triple-slash, but I also saw something about Output Browser Information and was wondering if that was the mechanism for exposing method comments???!!
Michael
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
Michael,
MSDN states that “Visual C++ provides limited support for XML documentation comments”. I do not know what they mean by that (what is supported and what is not), but as per the .NET 2003, even if I want to attach a simple summary to a class, like this:
/// <summary>
/// This is my Visual C++ class
/// </summary>
class MyClass
{
};
Visual C++ would generate an empty Comment Web Page (via the “Tools | Build Comment Web Pages…” option). And the Visual C++ compiler does not support the /doc compiler option as the C# compiler does.
May be other people have something to say on this?
Serge
|
|
|
|
|
Hello, I want wo know if somebody know what can i use to see in my computer the files of other computer without FTPConnection because when you use this library you have to write a Ftp address but if i only want to write a IP address, it's the same, Can i use Ftp connect or i have to use other library.
Thanksss.
/Densitet
|
|
|
|
|
I have included code to try and draw a button with a different background when the button has been activated (pressed once).
I have a bool which tracks the state of the button.
HBRUSH CEmuGUI::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = NULL;
CFont LabelFont;
if(nCtlColor == CTLCOLOR_BTN)
{
if((pWnd->GetDlgCtrlID() == IDC_1ST_BUTTON) && (g_bFirstButton))
{
LabelFont.CreateFont
(10,10,0,0,FW_BOLD, FALSE, FALSE, 0,
DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,
CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH, NULL);
pWnd->SetFont (&LabelFont, TRUE);
pDC->SetBkColor(LTGRAY_BRUSH);
pDC->SetTextColor(RGB(255,255,0));
return (HBRUSH)GetStockObject(LTGRAY_BRUSH);
}
}
return hbr;
}
I am getting in a bit of a mess.
What I would like is when the button is pressed, background color is green and button text is bold and when pressed again revert back to normals colors.
Any suggestions.
|
|
|
|
|
I have a CListCtrl with some text. I have an add, edit and delete
button that functions according. Instead of delete a row, Id like
to just strikethrough the text that is displayed in that row. That
way, they can always undelete. Any ideas on how to make a row of
text in a CListCtrl look like it was striked out? I can change the
row color, but that just doesn't do it.
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
The first thing that comes to my mind is: Get the bounding rectangle of the item (GetItemRect) or subitem (GetSubItemRect) you want to strikethrough and draw a line in the middle.
MS
|
|
|
|
|
How to check if the logged on user has admin privileges on the system ? Is there any API to do that ?? The API should be supported on all windows platforms ( Win NT, XP, 2000, Win 98/95/ME).
Thanks for ur help.
|
|
|
|
|
|
Salam
I want to display memory utiilization in graphically. i.e When i press the ADD button then a processes add to memory and graph goes up and when i Press the REMOVEPROCESSES button then graph comes down . I can add and remove process.
Thanks
|
|
|
|
|
Hi,
did you consider Visual C++ Performance Monitoring?
Here is the link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcconatlperformancemonitoringclassesandattributes.asp
Serge
|
|
|
|
|
I want to draw a rectangle on a bitmap image that i have displayed on the client area by moving the mouse. It is like the selection that we do in mspaint. Can anyone please help?
|
|
|
|
|
Take a look at the CRectTracker class, which implements what you need.
If you vote me down, my score will only get lower
|
|
|
|
|
Thank You Roger Allen for the prompt reply. I have implemented it and is working well. But how do i get the selection rectangle remain there after i release the mouse button.
|
|
|
|
|
Rather than using CRectTracker, just use the function DrawFocusRect. It does not go away until either the area is repainted, or you call DrawFocusRect again to erase the rectangle.
onwards and upwards...
|
|
|
|
|
Hi everybody !
Can you tell me where I find resources(article,forum,sample,etc)about translation the application text to a different language ?
Thanks.
|
|
|
|
|
Hi all,
I'm trying to develop an application, that will get an avi file and preview the video, and, whenever needed, will write a part of video into one file (copy a clip from time x to y) and write corresponding audio data to separate file. Is there any other way to do this, than just building a preview graph and, whenever it's needed, adding (or maybe just linking/unlinking pins) some kind of splitter and two file writers? So I will be able to seek the stream? What filters I should use? I'd be very grateful for any tips..
|
|
|
|