|
HI
If i not Delete data , it also occured , i am very much confused why it is happening.
I am using Windows XP.
thanx
Regards.
|
|
|
|
|
What happens exactly? Are you ASSERTing or getting memory could not be read or what?
|
|
|
|
|
A crashing Error Occurs that windows XP usualy generates of Send or Dont Send
Regards.
|
|
|
|
|
zahid_ash wrote:
dcMeta->CreateEnhanced(dcRef, NULL, NULL,"Cca-Graph" );
Don't know if this has to do anything with your problem. But the documentation says : "The string pointed to by the lpszDescription parameter must contain a null character between the application name and the picture name and must terminate with two null characters —for example, "XYZ Graphics Editor\0Bald Eagle\0\0," where \0 represents the null character. If lpszDescription is NULL, there is no corresponding entry in the enhanced-metafile header."
suhredayan There is no spoon.
|
|
|
|
|
No your tip not works . sorry.
Program crashes before pData->SetClipboard(); when the its is copied 2nd time.
On first click it works ok , but on 2nd click it crashes
Regards.
|
|
|
|
|
I am sorry.
To get the result I displayed inthe previoous thread I wrote;
result.Format("%16I64d",(_int64*)GivenLongLong);
|
|
|
|
|
Using _int64 _atoi64(const char* string);
I wrote:
_int64 myLonLong=_atoi64("FFFFFFFFFFFFFFFF");//16 F
To display the result as a string:
CString result;
result.Format("%16I64d",myLongLong);
The result displayed is: 14 186 792 374 763 520
I am wondering if this is correct.
Thanks for any help.
|
|
|
|
|
This is incorrect. The range of an _int64 is –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. The problem however is that _atoi64 does not read in hex numbers, only decimal numbers.
|
|
|
|
|
Thanks very much.
What to do than to have a conversion of a LONGLONG from hexadecimal to decimal ?
|
|
|
|
|
sscanf from stdio.h will do the trick. Observe:
unsigned _int64 myLonLong;
sscanf("0xFFFFFFFFFFFFFFFF", "%I64i", &myLonLong);
note that I made _int64 unsigned to get the extra bit which 16 F's will use. The preceding 0x is to let sscanf know that the number coming in is hex.
|
|
|
|
|
Thank you so much for your help.
This is what I wrote:
//////////////////////////////////////
GetDlgItemText(IDC_MYHEX,hexNb);
// FFFFFFFF FFFFFFFF (16 F) is input.
unsigned _int64 myLongLong;
CString strResult;
sscanf("0x"+hexNb,"%I64i", &myLongLong);
strResult.Format("%I64i",(unsigned _int64*) myLongLong);
GetDlgItem(IDC_MYRESULT)->SetWindowText(strResult);
This is displayed result:
14 186 796 669 730 815
Do you think it is the correct answer ?
|
|
|
|
|
fardak wrote:
This is displayed result:
14 186 796 669 730 815
Do you think it is the correct answer ?
No, this is not correct for an input hex number of 0xFFFFFFFF FFFFFFFF (16 Fs). You can use windows calculator to check. If you set it to advanced mode it will let you enter hex numbers and convert them to dec. The problem you're having is you're casting myLongLong into a pointer which on a 32bit platform will be a 32bit value. The correct answer is 18 446 744 073 709 551 615. You want something like:
strResult.Format("%I64u", myLongLong);<br />
Notice that I changed the formatting from i to u, for unsigned. You don't need a cast because it will take anything as it's an ellipse argument and the format string is what interprets it.
|
|
|
|
|
Thanks.
But if I write,(without the type casting) :
strResult.Format("%I64u",myLongLong);//myLongLong);
GetDlgItem(IDC_MYRESULT)->SetWindowText(strResult);
The result is 0.
|
|
|
|
|
Check your code. The following has been tested.
unsigned _int64 myLongLong;<br />
CString strResult; <br />
sscanf("0xFFFFFFFFFFFFFFFF","%I64i", &myLongLong);<br />
strResult.Format("%I64u", myLongLong);<br />
|
|
|
|
|
You are right.
I fond the error:
sscanf("0x"+hexNb,"%I64u", &myLongLong);//error
Which should be formatted with i.
Thank you so much for your time and effort.
(My head stopped spinning !)
|
|
|
|
|
fardak wrote:
I am wondering if this is correct.
No. 0xffffffffffffffff is 18,446,744,073,709,551,615 in base 10.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
You are absolutely correct.
Many thanks.
|
|
|
|
|
Hi everybody !!
I have drawn several lines between several pairs of points. Each line represents the link between an IP address source and one destination. Its width depends on the traffic between these IPs. I want that if I do R-Button (mouse) on them, they show a TIP.
My problem is how to implement that...I know that I have to use the WM_RBUTTONDOWN...The problem is what do I have to put inside it to know if I am selecting one line or another...I have had a similar problem before buit with rectangles...but it was easy because with a FOR I could go through all the structure CRect and using PtInRect I could know if the point given by WM_RBUTTONDOWN was inside or not a rectangle...But with a LINE? How can I know that?
Thanks you very much
|
|
|
|
|
Hi,
You should save the line equation for each line(Y=aX+b) and when you push the right button of the mouse,you need to place the point arguments in each line equation and check which equation is the right one.
regards,
Eli
|
|
|
|
|
Another method to do this is to use the simple formula that a point lies on the line if the sum of its distances from both ends of line is equal to the length of line. i.e., distance of X from A plus distance of X from B is equal to the distance of A from B (where A and B are the endpoints of line and X is the point at which mouse is clicked). This way you can add a small bias in it as well if you wish to coz clicking exactly on line is obviously not what you want.
Hope it helps.
"I would luv to change the world, but they wont give me the source code"
My Articles
|
|
|
|
|
Hi,
I have an application where an icon is created in the systray when the program is executed . On click of the icon the apllication is launched again.
What i want is tht when the program is executed only the systray icon is shown n the dialog box is not launched. only when i click on the icon the dialog box should be launched..
I am calling the functions to show the icon in the initdialog function,
How do i hide the dialog box so tht it doesnt pop up till i clickon the icon in the systray.
Please someone help me out wid this.
thanks
U get wht u Give
|
|
|
|
|
|
You will have to start you application with your dialogbox as hidden. This[^] article's has the tip to do it.
suhredayan There is no spoon.
|
|
|
|
|
I’m about to move from Visual Studio 6.0 to Visual Studio .NET. I’ve heard that it might be problems when I should copy resources (e.g. a dialog) from one project to another. Any known issues?
_____________________________
...and justice for all
APe
|
|
|
|
|
I am trying to update the text display box when a button is pressed.
If the user presses the button "1" once, then "1" appears on the display. If he presses it again, "11" . Max display length is 10.
Apart from the counter(if n=x, print "1" x-times), is there an efficient way to do this?
-hithesh
|
|
|
|