|
how to crop an image in an application based on dialog? with thanks!
qqworm
|
|
|
|
|
|
(Cropping images)there is an image,which is 696*344,I want to put a box(200*150) on it, then i move the box to the right position with the mouse , at last,i can get a new image which is 200*150. Now I can't complete this , for help,With thanks.
qqworm
|
|
|
|
|
i have two questions:
•say i have a class 'xyz' for example!and i create dynamically the objects!now to create this object,there must be information abt the class in the code!,so where does this code reside?
•is 'delete this' a valid statement?if so,where all is it valid and where all does it become invalid!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Don't use delete this.
If you write code for the class xyz:
<br />
class xyz<br />
{<br />
xyz(){<br />
_a = 5;<br />
}<br />
<br />
public int someFunction(){<br />
return _a;<br />
}<br />
<br />
private int _a;<br />
};<br />
when you say dynamically create I assume you write "xyz variable = new xyz();"
Then you acess it "int retVal = variable.someFunction();"
Then you delete the dynamically created object "delete variable;"
This is very basic stuff you need to google.
Take a look at some of these[^]
|
|
|
|
|
I can't understand your first question. When you do new XYZ(); , the compiler emits code to allocate enough memory for XYZ(sizeof(XYZ)) and to call XYZ's constructor. When you run the program, that code executes and you get back a pointer to a dynamically allocated instance of XYZ.
delete this is valid, but is not recommended (except for special situations, like COM reference counting implementation..). Just make sure that you don't reference any member variables after you call delete this ;
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Just make sure that you don't reference any member variables after you call delete this;
yes.....does that go with all the variables in that AFTER the 'delete this' in that function/class or does that go with ALL THE VARIABLES after the 'delete this' even for other classes and functions of the the program?
by the way,the first question is not how the new /delete operators work(that was just to quote!),i guess i didnt make that clear enough.....
what i meant is that:
if i need to create an instance,be it dynamic/static,where does it actaually reside before it is called/created?
that is.....say for example.....
class xyz
{
int a;
}
void main()
{
.....
.....
.....
if(some condition becomes true only the do the following loop)
{
xyz r;
}
}
if the above condition becomes true, only then the variable is created!if not(since static)does the compiler anyway allocate the space in the stack even before checking the condition?coz if it doesnt,doesnt that mean itz almost equivalent to saying that it is dynamically creating the object(though the object isnt created dynamicaly)!
what i mean is ,where is the class actually stored?is it along with the code?
ps:dumb doubtz though.....but i would like em cleared!
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hello..
How to record voice or sound using DirectX's DirectSound???
Any links or code?
I want the functions such as Record, Pause and Stop.
Please help me.. its urgent!
Thank you
Pallavi
|
|
|
|
|
Is it essential that you use DirectSound?
If not try using mciSendString , you can do all the things you want very easily using this function.
|
|
|
|
|
I am using MDI , Doc -View Arch.
I want to capture the mouse move event all over my application Window.
For this I tried overriding OnMouseMove function for the CMainFrame class.
But the function wont get invoked.
Request for a solution.
thanx in advance
laiju
|
|
|
|
|
The mouse movement messages go to the window with focus.
It is sent to your controls, MDI windows, etc. instead of the mainframe, when the mouse is over those other windows.
If you want to identify where the mouse is located at other times I think you have at least two choices:
1. Every one of your child windows needs to send a message to its parent, and you interpet these special messages as mouse movement - passing them up to each 'parent' will eventually get them to the mainframe.
2. Install a low-level mouse hook handler, and only pay attention to movement messages if the mouse coordinates intersect the screen coordinates of your main frame window. In that case, then, the mouse is 'over' your mainframe window somewhere. The low level mouse hook handler would need to go into a DLL, as I recall.
|
|
|
|
|
Hi,
I have one button in Winform. I want to call Windows Dial up Thr Win API after pressing the Button. Can anyone tell me which dll should be called for displaying dial up
waiting for the code
Thanks & Regards
sanjeev
|
|
|
|
|
|
How to protect a folder that nobody can delete, copy, paste it, or into it. File drivers don't work in safe mode. ICopyHook gives only notification for the folder copy, not file copy into that folder.
http://www.priyank.in/
|
|
|
|
|
Change its security settings?
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"
|
|
|
|
|
|
you canoot do this under Win98 as is uses FAT32.
it is not the operating system but the file system that stores such information, and only NTFS knows security options for each file
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Then there should be a method to do this, like a very complex one I guess is to make a new drive with your own format.
http://www.priyank.in/
|
|
|
|
|
so, write your own file system, and why not your own operating system...
Fat32 cannot read files written on a NTFS File system
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
void CMyView::OnActivateView(BOOL bActivate, CScrollView* pActivateView, CScrollView* pDeactiveView)
{
CScrollView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}
Iam overriding the OnActivateView function in my view class dervied from CScrollView.But this function is not invoked.
Whats the problem.
laiju
|
|
|
|
|
How can I load an image and play a wave file?
Thanks!
|
|
|
|
|
::LoadImage
::PlaySound
I'm not joking.
If you want to load something that's not a bmp, you need to either use GDI+ ( built in if you have VS.NET 2002 or 2003, even if you're not using managed code ). My articles explain how to use it, and how to set it up if you're stuck in VC6.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there a way/method to modify the current date value so that it will end up become the last day of the next month in c runtime library?
e.g.
Lets say date is 15/05/2005. After modification, it should become 30/06/2005 and then 31/07/2005 and so on.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Could you be more specific? Is it the system's time that you are trying to change? Or is it a file's or folder's access/creation/modification time that you are trying to change? Also, I would suggest that you take a look at time.h which is the a standard C library with date and time related functions. difftime function might be useful to you, and also the tm structure.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
Actually, the standard file is called ctime. all C++ headers dropped the h when they were standardised ( i.e. iostream, not iostream.h ) and additionally, a C was prepended for the C runtime files ( so ctime, not time.h ).
The old ones are there for compatibility only, although in reality, because most people still use them, they are probably there to stay.
Christian Graus - Microsoft MVP - C++
|
|
|
|