|
|
Hi,
I have written a control using MFC. The control uses COleControl as its base class.
I can see a property called "Visible" when presented with the property list in Visual Basic.
I intend to change this value when I resize the control, however, I cant find a virtual override or a windows message that I can use to handle any change in this property.
Is there another way to get notification of change in the visibilty of the control in my form?
GB
|
|
|
|
|
Your control probably doesn't implemented "Visible" property -- it's an Extended propery provided by VB and implemented through agregation in your control.
Therefore, there is no way for your control to be notified through "Visible" property change notification.
However, you always have an option either:
1. to imlement DoVerb method IOleObject interface (check for OLEIVERB_HIDE,OLEIVERB_SHOW);
2. check for empty device context returned by GetDC on the window of your control.
There maybe some other more "advanced" methods...
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
It works! Thanks. Just have to remember how I was going to use it!
Also I noticed from MSDN that this should be visible via the ambient properties set but I couldn't find a #define for DISPID_AMBIENT_VISIBLE... which should be available according the documentation.
In fact I couldn't really find much detailed info about the ambient properties at all.
Regards.
|
|
|
|
|
Yes, DISPID_AMBIENT_VISIBLE is not available. Plus, don't forget that even if it does: it's up to the container to implement it or not. So, to have your control as much container independent as possible it is better not to rely on ambient properties being implemented (if possible).
Regards
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I need to process large files (> 2Gig). The regular C functions "fopen" or MFC CFile operate with a long value offset which limits the file to 2**31. Is their a other option than using low level routines ( _open, _lseek, ...) ?
Andre
|
|
|
|
|
|
In addition to Ian's suggestion, this article might be of interest.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thank you for the info. CFile64 needed integration, but did the trick! (Will I ever need CFile128?)
|
|
|
|
|
Andre1234 wrote:
Will I ever need CFile128?
If you do, just check back here and I'll suggest it to you!
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
One of the possible ways is to write wapper class similar CFile
specially assigned to manipulate with VLF.
F.e. - inside, this class could use 64-bit lo-level functions.
Thanks for the interesting question.
Vitali
http://www.creative-case.com
|
|
|
|
|
Use CreateFile() & CloseHandle()
Phil
|
|
|
|
|
I'm using the CMSChart class to plot a x-y scatter chart in VC, but the value of y data is much bigger than the x data, e.g. 100 v.s. 0.1, how could i set the scale of x and y coordinate to get a good appearance? Thank you!
|
|
|
|
|
you can use a logarithmic scale on the y axis.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
Thanks for your resolution, but it still doesn't work! Because the scale of Y dataset is from 0 to 300, but the scale of X dataset is from 0 to 1, so i don't know how to plot them in a harmonic proportion. if i use logarithmic scale on the y axis, the Y axis will not be in proportion to the X axis. on the other hand, i can't change the scale of the axis.
e.g.: i have the following 5 points: (0.5,283),(0.01,186),(0.8,50),(0.1,11). how could i plot them?
Thanks again and have a nice day!
|
|
|
|
|
I have a Picture control on my dialog (taking up about 40% of the area).
I load several bitmaps during InitDialog as follows:
m_Image1.LoadBitmap (IDB_IMAGE1);
m_Image2.LoadBitmap (IDB_IMAGE2);
I have a member variable for the Picture control m_PictureImage
CStatic PictureImage;
Now when I click a button I want the Picture control window to be visable and then have the image loaded:
m_PictureImage.ShowWindow (SW_SHOW);
m_PictureImage.SetBitmap (m_Image1); // Button 1 pressed
All is fine but I need the Bitmap image to be resized, as don't always know its
size.
I cant fins any properties or methods to resize the Bitmap via the Picture control.
|
|
|
|
|
Use the functions of the parent class of CStatic in order to change size of the picture:
m_PictureImage.MoveWindow(0,0,200,300,TRUE);
You have to provide the new cooerdinates as Client coordinates (relative to the upper left corner of you dialog window).
You can also have its size to be equal to the exact bitmap size:
CSize size = m_Image1.GetBitmapDimension();<br />
m_PictureImage.MoveWindow(0,0,size.cx,size.cy,TRUE);
Peter Molnar
|
|
|
|
|
I added the following code onto one of the buttons:-
m_PrimaryFlight.LoadBitmap (IDB_FLIGHT);
m_Flight_Power_Images.SetBitmap (m_PrimaryFlight);
CSize size = m_PrimaryFlight.GetBitmapDimension();
m_Flight_Power_Images.MoveWindow(0,0,size.cx,size.cy,TRUE);
But no image appeared on the picture control, in fact size.cx and size.cy have the following values -858993460.
Note: m_PrimaryFlight is type CBitmap and m_Flight_Power_Images is type CStatic ( the picture control).
I am sure almost there, but one question @When adding control variable to the Picture control is iss of type CStatic, I would have though it would be of type CPicture.
Any comments?
|
|
|
|
|
Try to insert a line after
CSize size = m_PrimaryFlight.GetBitmapDimension();
by replacing CSize with some realistic value according to your loaded bitmap:
size.cx = ...; size.cy = ...;
In this way you will see whether the problem is with GetBitmapDimension() or MOveWindow().
Don't forget: the first parameters of MoveWindow are the upper left corner of your CStatic in client coordinates. If you code (0,0, size.cx,size.cy ...) then your Picture will be moved to the upper left corner of your dialog. If there is any other control at this position, your controls will conflict with each other.
Therefore try different values for the coordinates.
Peter Molnar
|
|
|
|
|
Still got a problem, GetBitmapDimension() return strange values (larger and negative) also MoveWindow just moves the bitmap (no resizing) to other locations on the dialog.
I thought that using the Picture control would be simple.
To recap it displays the bitmap(s) at the right location, just does not resize them to fill the required area; or in this case srink down the images to fit on the picture control.
Any other idears?
|
|
|
|
|
hi,
can someone pls tell me how can i make a graphic editor?
like the one they have in visual studio 6 resource editor where they let us edit the bitmap pixel by pixel and while we are editing it..simultaneously they show us the result in a corner...
can someone tell me how can i make a software to do that??
what language should i use?
what control is that that reperesents the pixels???
tks a lot for any help...
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Hi Joseph,
You can of course write your program from scratch but there are some workarounds:
1.If you are satisfied with what M$ Paint offers then you can host it in your application using automation.
This can be coded in no time and is an alternative for every plain Windows version from 98, no Office needed.
2.Third party libraries offer such features, e.g.: BCGControlbar standard version has such a built-in functionality. If interested see http://www.bcgsoft.com[^]
Peter Molnar
|
|
|
|
|
Hey,
i have my own kernel32.dll and i also have a test program which should use it! How do i tell the program that it should load my Kernel32.dll and not the Windows Kernel32.dll ? Has someone an idea ?
Thanks in advance!
|
|
|
|
|
what!!! One of the reason for creating COM was to eliminate the accidental versioning problem, and you want to purposely create the version prob,you must be out of ur head.
Peace
The World is getting smaller and so are the people.
|
|
|
|
|
don't panic! if you know how, then please tell me!
Thanks!
|
|
|
|