|
|
I search on Web, and did not get clear answer. Now here is the way to catch double click action by a ordinary button.
create CMyButton based on CButton.
add WM_LBUTTONDBLCLK message handler.
use wizard add variable for the IDC_BUTTON1. let it's type be CMyButton.
that's it.
You will catch Bouble Click action my CMyButton.
Easy huh!
|
|
|
|
|
Maybe so, but you need to question using double-click with a standard button. Windows users don't typically double-click buttons, so you're going to have a hard time training them to do so in your application. Presumably, the normal click on your buttons performs some other action. You'll also have the danger of that action being performed instead, even though the user thought they were performing a double-click.
Software Zen: delete this;
|
|
|
|
|
Try to use BN_DOUBLECLICKED and your button need to be Notify.
|
|
|
|
|
I am currently familiar w/ VC 6.0.
I downloaded the trial of VS 2005 Express (just C++) to try out.
I created a new "Windows Forms App" and added a couple of controls.
When I add an event handler (such as _Click for a button), the IDE creates the entry in the .h file, but I don't see a .cpp file.
Here's what's in the .h file:
private: System::Void button1_Click(....
I don't think I am now supposed to put my code in the .h file, so... 1) am I supposed to create the .cpp file myself? or 2) did I miss something such that the .cpp file did not get created when it should have?
I know this is really simplistic, and I feel like I'm just overlooking something, but some advice to point me in the right direction would be nice.
Thanks.
PS: One other simple thing. I figured out the following to do a simple MessageBox:
System::Windows::Forms::MessageBox::Show("Button pressed!");
Surely there's a shorter way...!
Thanks again.
|
|
|
|
|
This is the VC++ forum, your questions are about C++/CLI, for which there is the C++/CLI forum.
David Fleming wrote: am I supposed to create the .cpp file myself?
Guess so. I tried it and got the same result.
David Fleming wrote:
PS: One other simple thing. I figured out the following to do a simple MessageBox:
Provided you have using namespace System::Windows::Forms in the translation unit, you can simply do MessageBox::Show(...)
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Try in the CLI u might get the proper response
as people here are yet on vc++
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Crap! I thought CLI was for regular (non-Visual) C++... where's that then?
Thanks!
BTW, David, I don't know how to do it in C++, but in C# you used:
using System.Windows.Forms;
It should be quite similar...
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
There is an icon ,and I want to set the icon as a item's image without backgroud color in a CTreeCtrl in MFC.
How do I do?
attaching my code:
hIcon=(HICON)LoadImage(NULL,GetIconFromFile ("CLSDFOLD"),IMAGE_ICON,16,16,LR_LOADFROMFILE|LR_DEFAULTSIZE);
iconIndex=m_DeviceImage.Add (hIcon);
HTREEITEM hti1=m_wndDeviceTree.InsertItem
(_T("CATEGORY"),iconIndex,iconIndex,hti);
DestroyIcon(hIcon);
The icon is able to display,but it is black backgroud color.why??
help me
would you write some code?
|
|
|
|
|
Try:
LoadImage(NULL,GetIconFromFile ("CLSDFOLD"),IMAGE_ICON,16,16,LR_LOADTRANSPARENT|LR_LOADFROMFILE|LR_DEFAULTSIZE);
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Hi,
i have created a plugin for Windows media services4.1 by using COM and VC++. And also set the registry settings.
But,after completing all the necessary settings,also windows media server not reconizing the plugin.
How can i solve this problem.
i am using the windows media services 4.1 which come along with "winodws 2000 server" OS
Spend Every minute for sucess
|
|
|
|
|
I have a number like 400
I have another number like 666
Is there anyway using bitwise operators I can extract ONLY the bits which are used to make 400 and determine if all those bits are set???
I have read PJ Arends bitwise article numerous times, but still I am missing something and I need this for a solution...
Basically MASK only certin bits and determine if all are set???
Is this possible? Can you show me how please???
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hockey wrote: Is there anyway using bitwise operators I can extract ONLY the bits which are used to make 400...
if ((666 & 400) == 400)
... Hockey wrote: Basically...determine if all are set???
This makes no sense. If all of the bits of a number are set, then the number is 'fully intact' (i.e., there's nothing to test).
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Basically whats happening here is I am trying to determine which checkboxes in an FTP program should be checked...
Based on the linux permissions of the file...
So, For example:
777 would require all the checkboxes RWX for Owner/Group/Other to be checked...
Whereas 400, would require ONLY the READ/Owner to be checked...
I have the permission bits, ie: 777 or 666 or 400...
Now i'm trying to use this number and programatically determine which of the corresponding checkboxes need to be checked...
I cannot use any FTP helper functions, etc...I must do this completely independant of any library...
The reason I asked if it's possible to localize a certain number inside another...is because...
400 in binary = 110010000 - 3 bits are SET, but ONLY one checkbox (READ/Owner is checked)
However, 666 in binary = 1010011010 - 5 bits are SET and all READ/WRITE for Owner, Group, Other are checked!!!
A trivial:
((666 & 400) == 400)
Doesn't work!!! I'm not sure why it doesn't work...but it doesn't work...atleast the last time I tried it it didn't work
Now does it make sense what I am trying to accomplish???
Any ideas???
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
666 => 1010011010
400 => 0110010000
bitwise & => 0010010000
It probably will not match 400 ( 0110010000 ).
In Unix, those permission are in octet.
So, you may want to try
((0666 & 0400 ) == 0400 )
If I understand your problem correctly, I probably will try
different approach.
You probably have 9 checkbox for all permissions.
I probably will have a function to take the
permission & all 9 checkbox.
Inside the function.
if ( permission & 0400 )
ownerRead->SetCheck ( TRUE);
if ( permission & 0200 )
ownerWrite->SetCheck ( TRUE);
& etc.
Kevin
|
|
|
|
|
You're missing the fact that the Unix numerical permissions are octal (base 8) numbers. This means 400 octal is 100000000 in binary and 666 octal is 101101101 in binary.
|
|
|
|
|
Indeed. Each digit in an octal number, is represented by three bits in the binary number system. E.g: base 8: xyz => base 2: x0x1x2y0y1y2z0z1z2
--
Pictures[^] from my Japan trip.
|
|
|
|
|
markkuk wrote: ...and 666 octal is 101101101 in binary.
Correction. 666 in base 8 is 110110110 in base 2.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I have an SDI app with several views (mostly CFormView), one of which is a CEditView class. From this class I need to add a "centered" heading with a larger font and set a decent margin to print only text.
I would like some help understanding how to use OnPreparePrinting, OnBeginPrinting, and OnEndPrinting functions that are already in my edit class. I know there are a few classes for printing but if I don't understand how it all works, they are of little value to me.
Another problem is that the book stores in my area have mostly .NET stuff and I'm using VC++ 6.0.
Thanks!
Mark
|
|
|
|
|
Printing in an MFC app is supposed to be just like drawing on the screen. The On...Printing functions are there to help you in the places that drawing during printing is different. The main difference is that, when printing, you probably want to keep track of pages. For example, if you're printing text, you wouldn't want to print the top half of a line on one page, and the bottom half on the next.
If your view class is derived from CEditView, you might look to see if CEditView has any printing support built-in.
Software Zen: delete this;
|
|
|
|
|
I've got two structs that I want to be able to typecast to one another, so I have something like this:
struct S1
{
S1( const S2 &s2 ) { a = s2.b }
float a;
};
struct S2
{
S2( const S1 &s1 ) { b = s1.a }
float b;
}; But each struct needs to know about the other, so I can't get this to compile. Is there a way to tell each class the other exists or some other way to get around this?
- Steve
|
|
|
|
|
use a "forward declaration" of S2 prior to defining S1:
struct S2;
struct S1
{
//
};
struct S2
{
//
};
http://www.catch22.net
|
|
|
|
|
Hi,
I have a CFormView-based SDI project in which I need to programmatically create & update an array of buttons in a view window. It seems that a CFormView would be the best class to use for this window, but I can't seem to create the window. What type of parent should the window have? I need to create it in the app's main CFormView window. Can that be done? Can anyone point me to a sample project?
Thanks,
Royce
|
|
|
|
|
A CFormView is basically a modeless dialog. It's nothing special really. What window fails to create? The buttons, or the CFormView?
--
Pictures[^] from my Japan trip.
|
|
|
|
|
The CFromView fails to create a window when the class ctor is called.
|
|
|
|