|
I have a region object of 'CRgn' class. How can I resize this region?
|
|
|
|
|
Resize the region, the content of the region, with zoom, without...?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I Want to scalling only the region area by CRgn.
|
|
|
|
|
CRgn rg;
rg.SetRectRgn(x,y,x2,y2) or rg.SetRectRgn(LPCRECT)
is that what your after?
|
|
|
|
|
Oh no i have used this. It creates a rectangle like CreateRectRgn(LPRECT) function but use no memory . It performs no scalling.
|
|
|
|
|
ANyway this can be done. I don't know any API are there .
by using a simple idea, u will get the points from region (GetRegionData) .And try scaling those coordinates by simple multiplying. I hopes it will work.
If u can Dream... U can do it
|
|
|
|
|
I am getting heap corruption
Code:
BYTE *Image=NULL;
Image=(unsigned char *)malloc(50000);
Image=Dlg.CaptureImage();
free(Image);
Plz Help me
S.Yamini
|
|
|
|
|
do a check on the size of the image, you might not be allocating enough space?
|
|
|
|
|
I changed the size to 5000000.Still I am getting heap corruption when i am trying to delete the BYTE pointer.Suggest me some ways to solve the issue
S.Yamini
|
|
|
|
|
how does Dlg.CaptureImage() return the image data?
by value?
i'm not sure about the error if that isnt the problem.
would need to have access to a compiler which i dont at the moment
|
|
|
|
|
I use delete to free the memory but when i execute delete the exection goes to winheap
S.Yamini
|
|
|
|
|
Check the return pointer of CaptureImage , is that the same as the orginal (before calling CaptureImage ). Also Try Debugging CaptureImage. the problem is ur trying to delete a pointer which is not a valid head head. it can also happen in these case
int * p = malloc(100);
p+= nSomeValueLessthan100;
free(p);
So try to debug the function. rather than worrying. It will be ok.
If u can Dream... U can do it
|
|
|
|
|
ok i will try .Thanks
S.Yamini
|
|
|
|
|
yaminisridaran wrote: Image=(unsigned char *)malloc(50000);
Image=Dlg.CaptureImage();
free(Image);
In the first line, you are allocating memory into the Image pointer.
In the second line, you are reassigning that pointer to some other value.
In the third line, you are calling free(...) on the value obtained in the second line, not the value obtained in the first line, so you may be trying to free a invalid pointer.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Can u give me any solution for this
S.Yamini
|
|
|
|
|
yaminisridaran wrote: Image=(unsigned char *)malloc(50000);
Image=Dlg.CaptureImage();
free(Image);
Yes, if you skip step #2 and the error goes away, you have found the source of the problem. It seems that you are not passing the allocated memory to CaptureImage(...) , and since we do not know what is going on inside of that function, there is little other help that we can provide.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
What is a binary file ? How do u read / write into a binary file.
Thanx
|
|
|
|
|
Take a look in MSDN about CFile
The modus to read/write is spcified during the creation of the object
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Text mode treats end line characters differently. Check out the documentation.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
open it in notepad... if you find it readable, then it's probably a text file.
if it contains "hieroglyphs" or so, then it's a binary file, and you must know the format of how the data have been written in it to read them back
|
|
|
|
|
Hello everyone,
I have written two simple programs (source codes are the same),
1. In an exe, loading a class from another COM component by invoking CoCreateInstance;
2. In a COM DLL, loading a class from another COM component by invoking CoCreateInstance;
1 success but 2 fails. I am running in the same environment (machine) using Visual Studio 2005. Any ideas of this issue?
thanks in advance,
George
|
|
|
|
|
Can anyone tell how to convert a widechar string to VARIANT
I have an unsigned char* string , I am converting it to widechar using MultiByteToWideChar.
How to convert it to VARIANT ?
The data is getting lost if i use ColeVariant.
|
|
|
|
|
If you paste your code here, that would be more helpful but simply u can do it by setting the vt of variant to VT_BSTR and then create a bstr. Put the string in BSTR by using ::SysAllocString and set that BSTR in the variant.
Something like:
BSTR bstrString = ::SysAllocString(str);
VARIANT var;
var.vt = VT_BSTR;
var.bstrval = bstrString;
Regards,
"Some people believe football is a matter of life and death.
I'm very disappointed with that attitude.
I can assure you it is much, much more important than that. -- Bill Shankly"
|
|
|
|
|
I have sumthng like this
VARIANT getData()
{
unsigned char* puc_Data = " SOME TEXT ";
// I am converting the above unsigned char to whar_t* using
MultiByteToWideChar(CP_UTF8,..,puc_Data,len,wchar_t*,len);
// I want to take this wchar string and convert it to VARIANT
// Doing it thru COleVariant
ColeVariant var(wchar string );
// Data is getting lost sumwhere here ...
return var;
Can anyone suggest wat i m doing wrong??
|
|
|
|
|
Why not just do this and let COleVariant do what it is designed to do?
ColeVariant getData()
{
char* puc_Data = " SOME TEXT ";
ColeVariant var(puc_Data);
return var;
}
|
|
|
|