|
The error is:
"Run-Time Check Failure #2 - Stack around the variable 'dlg' was corrupted."
COurProgramDlg dlg;<br />
m_pMainWnd = &dlg;<br />
INT_PTR nResponse = dlg.DoModal();
|
|
|
|
|
yeetins wrote:
INT_PTR nResponse = dlg.DoModal();
dlg.DoModal() willnot allocate any memory to nResponse!,that may be causing the problem
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
It occurs after I have these codes in my program.
m_pSocket = new CListenSocket();<br />
<br />
if (m_pSocket->Create(PORT, SOCK_STREAM) == FALSE)<br />
{<br />
AfxMessageBox("failure!");<br />
m_pSocket->Close();<br />
<br />
}<br />
<br />
if (m_pSocket->Listen(1) == FALSE)<br />
{<br />
if (m_pSocket->GetLastError() == WSAEWOULDBLOCK)<br />
{<br />
AfxMessageBox("failure!");<br />
m_pSocket->Close();<br />
}<br />
}
|
|
|
|
|
Is above code are successful during execution!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Do you handle any user defined messages in COurProgramDlg or any other class related with it, then check their signature is correct. Or are you calling any function with a different calling conventions ?
suhredayan There is no spoon.
|
|
|
|
|
Thank you very much!
I'v manage it.
|
|
|
|
|
yeetins wrote:
I'v manage it.
Just curious. Wot was the problem, so that others are also helped from your experience.
suhredayan There is no spoon.
|
|
|
|
|
Hi
Is there a way to calculate the distance between 2 computers?
Suppose I have 5 computers located in diff. parts of the world. Now I want to send information from 1st computer (say computer A) to the farthest (say computer E). I can easily evaluate the shortest path between 2 computers if I know how to calculate the distance between 2 computers.
Now my question is ->>> Is there a way to calculate a distance between 2 computers?
Some idea, hint or code!
Please help.
Thanks
|
|
|
|
|
u could get each computer to ping each other computer and then report back, then u get "distances"
bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
1. What do you mean by 'distance' - physical (i.e. miles), or network (i.e. hops) ?
2. If you mean physical then your premise: 'I can easily evaluate the shortest path between 2 computers if I know how to calculate the distance between 2 computers' is incorrect.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thanks for replay
I actually want to calculate the best path for sending information from one computer to another.
What I am trying is :
I am trying to build a network where several servers will be distributed to in a wide area. The purpose of these servers will be to deliver fax. I require calculating the best path for this purpose. Actually this is a final year project.
vikram
|
|
|
|
|
Then do a search for a network 'trace' implimentation.
e.g. Search on keywords: network trace route c++
...cmk
Save the whales - collect the whole set
|
|
|
|
|
i made one program in MFC(VC++). i want to give security to my program . i want that if i install my program on one pc. it cannot run on another pc. so i want to use hard disk serial number in my program. but i dont know how to get hard disk number in vc++
plz tell me if any other method to secure my program
|
|
|
|
|
Look for [GetVolumeInformation] which return Drives Serial Numbers.
if you really need HarDisk Serial Number I believe you have to Program Using WMI(Window Management Instrumentation.)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
|
i am not able to use getvolumeinformation in my vc++ code.
can u give me one example how to i use getvolumeinformation in my code
|
|
|
|
|
iam using Doc - View architecture for an MDI application.
I need to implement zoom-in & zoom-out functionality for the child windows within the application.
Iam not using any CScrollView class.All i have is the default View class that is generated by the application.
can anyone let me know the procedure.
thanx in advance
laiju
|
|
|
|
|
What are you showing in your view ? I believe you can set scaling on a DC, that's probably the way to go, if you override OnPaint and set the DC up so that the rest of the painting that takes place will be drawn at a larger than usual scale.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
IAM drawing rectangles, bitmaps and displaying text on the client area .I want to zoom these .
laiju
|
|
|
|
|
Then do what I said. The other person who replied told you exactly what I was trying to remember.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Try using:
SetMapMode(dc, MM_ISOTROPIC);
then,
SetWindowExtEx(), SetViewportExtEx().
...cmk
Save the whales - collect the whole set
|
|
|
|
|
UpdateData (1);
for(int m=1;m<=m_edit1.GetLength ();m++)
{
CString tr=m_edit1.Left (m);
tr.Delete (0,m-1);
ch=tr.GetAt (0);
tr.Format ("%d",ch);
data =(double)ch;
//calculate ((data)^e mod n) .i.e the remainder
c=0;d=1;
for(i=k;i>=0;i--)
{
c=2*c;
d=fmod(d*d,n);
if(bits[NO_BITS-i] == '1')
{
c=c+1;
d=fmod(data*d,n);
}//end of IF
}//end of for loop
int a,b;
// char buffer[50];
CString s=_fcvt(d,0,&a,&b);
if(s.GetLength()<2)
{
s.Insert(0,"00");
}
else if(s.GetLength()>1&&s.GetLength()<3)
{
s.Insert(0,'0');
}
UpdateData (1);
m_edit6 +=s;
UpdateData (0);
this is a code for encryption .here first i converted the string in the edit box 1 to its corresponding ascii value.after that i found the double value for that.for concatenating the values, i converted the double value into string&i stored that value into m_edit6.
for decryption i have to convert that string value in the edit6 to double using "strtod()".
plz help me with this..
|
|
|
|
|
nehathoma wrote:
for decryption i have to convert that double value in the edit6 to string using "strtod()".
Well, that's just plain impossible. strtod converts a string to a double, not a double to a string.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
sorry ,actually i meant string to double conversion.
|
|
|
|
|
if you want to convert string to double use this:
CString string;
char *temp;
double dNumber;
temp = string.GetBuffer(string.GetLength());
sprintf(temp,"%f",dNumber);
Eli
|
|
|
|