|
Hi there,
That's it, I fixed it. Actually, I was mislead by the first debugger comment when opening the EXE. It said that it could not locate the SYMBOL info, but later when it crashed, it correctly reported the error using the PDB (and source code?) I put in the Symbol folder.
Okay, thanks very much for your help. I hope next time I have a crash in my RELEASE I will be able to find the exact reason... althgouh now I've chanegd my code to run in Multi-Thread ... so debugging is even more complicated.
By the way I have a question about multi-threading, are you familiar with it?
-Lyu ABE
|
|
|
|
|
Somewhat....What's your question?
Steve
|
|
|
|
|
Humm.. I was about to ask why one of my two threads was finishing the job much before the other (they are performing the same task, but on separate memory spaces, so no lag due to access to shared ressources). Then I realized it was because I used a (stupid) while to wait for some bool flags in each thread to be set to true, and the laggy thread was running on the same core than the main program. That's why it was slown down. Now I'm using Events to signal the state of the thread, using CreateEvent , SetEvent and ResetEvent . I have the same crashing issue on the AMD proc . It runs fine on the Intel laptop, but crashes on the AMD (both with RELEASE EXEs). (if you have suggestions, they are welcome...)
Anyway, I am now wondering if these multithread functions _beginthread , etc. are portable to other platforms (i.e. is that standard C++)??
|
|
|
|
|
I found why the code crashed on the AMD machine: it is because I got this strange crashing issue (the origin of my message). But now what is puzzling me is that when I use WinDbg to launch the EXE, it runs fine, but when I use console command, it crashes . Any explanation to that?
|
|
|
|
|
Okay, I guess I've found the cause of the crash: I was not freeing some (small) arrays in one of my subroutines... However, it seems strange to me that it made my code crash. I thought that if it was not freed, then the memory space was just allocated and not available to other allocation during the code execution...
Anyway, I got it solved, so I'm happy
Thanks all for your suggestions to this thread.
Lyu ABE
|
|
|
|
|
Hi,
Can u please help me to solve the problem.
I have two property pages in a property sheet.
The first one is CCmpListSetupDlg
and the second one is CCmpDataEntryDlg.
In the first propertypage i am getting a string into the variable "str".
BOOL CCmpListSetupDlg::OnKillActive()
{
CString str;
// I used CListCtrl two create grid lines and when user click on a row(item)
// i am getting the text value into the CString variable "str"
CListCtrl* pListCtrl = (CListCtrl*) GetDlgItem(IDC_LISTITEMS);
POSITION pos = pListCtrl->GetFirstSelectedItemPosition();
if (pos == NULL)
{
AfxMessageBox("No items were selected!\n");
}
else
{
while (pos)
{
nItem = pListCtrl->GetNextSelectedItem(pos);
str=pListCtrl->GetItemText(nItem,0);
AfxMessageBox(str);
return CPropertyPage::OnKillActive();
}
}
}
//This is my second property page
//When ever my second property page is activated i want the text
//value of "str" to get displayed .
BOOL CCmpDataEntryDlg::OnSetActive()
{
AfxMessageBox("Hi Dataentry page is active");
// here str value should be displayed.
return CPropertyPage::OnSetActive();
}
Thanks in Advance.
|
|
|
|
|
tejaswini.g wrote: AfxMessageBox("Hi Dataentry page is active");
// here str value should be displayed.
return CPropertyPage::OnSetActive();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
tejaswini.g wrote: AfxMessageBox("Hi Dataentry page is active");
// here str value should be displayed.
return CPropertyPage::OnSetActive();
is CPropertyPage* CPropertySheet::GetPage(int nPage) of any help!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Can u show me please How can I use it in my program.
|
|
|
|
|
|
www.codeguru.com/forum/showthread.php?t=394676">http://www.codeguru.com/forum/showthread.php?t=394676[
|
|
|
|
|
Hello,
i#m looking up and down the vc++-documentation to find an idea about listing all the files a local computer has opened on the network. I found numerous functions like 'NetFileEnum' but they only provide information about a number of open files and pipes. But i am interested in the names of the open files. Does anyone have an idea about this?
Thanks in advance,
Richard
|
|
|
|
|
Richard Ernstberger wrote: NetFileEnum
Richard Ernstberger wrote: But i am interested in the names of the open files. Does anyone have an idea about this?
I never tried, but you can use NetFileGetInfo with level as 3
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: I never tried, but you can use NetFileGetInfo with level as 3
NetFileEnum() will work, too, using level 3. I'm unclear as to why the OP suggested otherwise.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote:
NetFileEnum() will work, too, using level 3.
yeah.. it will work.. sorry i overlooked that!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks for your response.
NetFileEnum is working in some cases.
This means: i can get open files on my local machine and on some Windows-2000-computers. XP-computers fail with the ERROR_ACCESS_DENIED code.
Another try with a NAS-device lets crash NetFileEnum, as it returns an errorcode that is not listed in the VC-docs.
I feel there are some restrictions on this function: maybe i have to change some network-settings on XP. And for the NAS-device: maybe there is no way to query a SMB-device.
If someone has experienc with this, it wold be nice to hear from you.
Thanks,
Richard
|
|
|
|
|
|
Hi, I dont have code for a 64 bit crc, but maybe this crc16 might help you.
Hope it will help.
Function:
short int crc16(int *pBuf, short int Len, short int InitialCrc){
short int crc=0, i=0;
crc = 0;
for (i = 0; i < Len; i++ ) {
crc = (crc >> 8) | (crc << 8);
crc = crc ^ *pBuf;
crc = crc ^ ((crc & 0xff) >> 4);
crc = crc ^ (crc << 12);
crc = crc ^ ((crc & 0xff) << 5);
pBuf++;
}
return(crc);
}
int main()
{
int *ibuf = new char[len];
short int crc;
Memo1->GetTextBuf(ibuf,len);
crc = crc16(&ibuf[0],len,0);
Edit2->Text = len;
Edit3->Text = IntToHex(crc,4);
delete[] ibuf;
}
Regards Programm3r
|
|
|
|
|
Programm3r wrote: Hi, I dont have code for a 64 bit crc, but maybe this crc16 might help you.
Hope it will help.
Thanks. I don't need code for Crc. I just need a widely used 64 bit Crc polynomial. Just like the ones we have for 32 bit Crc's.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
|
Programm3r wrote: Well in that case .... my bad .
Have you tried checcking google?
God bless you. I did search google. But these days you should search Wikipedia too. Just what I wanted.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
This[^] might help. You can look at the source is you just want to see how it's done.
Steve
|
|
|
|
|
Stephen Hewitt wrote: You can look at the source is you just want to see how it's done.
I do get lost trying to find out a proper polynomial myself. I am still lost. That's why I try to go for a widely used polynomial. I will try out that link.
Thank you.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Hello all,
I have an Activex Control in vc++ 6.0.It is a player plays cam files.
I have designed in the way that everytime the Activex control opens ,cam file will be downloaded from the server(Download Dialog) and after downloading the download dialog is closed automatically using OnThreadFinished.
LRESULT CHttpDownloadDlg::OnThreadFinished(WPARAM wParam, LPARAM )<br />
{<br />
m_bSafeToClose = TRUE;<br />
m_ctrlAnimate.Stop();<br />
<br />
if (m_bAbort)<br />
EndDialog(IDCANCEL);<br />
else if (wParam)<br />
{<br />
AfxMessageBox(m_sError);<br />
EndDialog(IDCANCEL);<br />
}<br />
else<br />
EndDialog(IDOK);<br />
<br />
return 0L;<br />
}
OnThreadFinished is for closing the dialog after the cam file downloads
fully.
1.Is ther any method to close the dialog while downloading the file.
Help me please and give me ur suggestions.
thanks in advance
Sunita
|
|
|
|
|
Create a dialog having a progress bar. In Its OnInitDialog start a thread to update the progress bar. Set the progress bar initalizations in OnInitDialog. The thread fun must have a infinite loop and setPos fun to update the progress bar.
From downloading thread update the progress bar value using a static variable and use this var to update the bar in Thred fun() and when this value become 100 or like u can call end dialog which will close the progress dialog.
|
|
|
|