|
Hi,
I wrote an application in which, i used lot of structures. Using STL list i push and pop the few same set of structure items. My friends said, STL list makes more weitage, So i decided for alteration. I got the solution now. Gokings thanks for ur effort.
Thanks
|
|
|
|
|
i am bulding a wave Player in vc++, i am using Playsound()(mmsystem.h) function to play wave file. So can any one help me how to stop, pause and set the Timer ( to control the Slider) for Wave file while playing.
|
|
|
|
|
Dear all,
i'm struggling since last week trying to find memory leaks in my web application when number of users increases, say 100 or more. We have a web based application which uses some VB as well as VC Com dll's. The InetInfo.exe crashes due to memory leaks caused by these dll's and also by the asp code.
We've used a microsoft application to generate the memory dump of InetInfo.exe
Its called LeakDiag. It generated the dmp file and also some xml logs. We also used microsoft's DmpChk.exe to read the dmp file. This is (text) the contents of the dump file
<br />
RVA 00000BB8, 01000000 - 01006000: 'C:\WINNT\system32\inetsrv\inetinfo.exe'<br />
RVA 00000C24, 77f80000 - 77ffd000: 'C:\WINNT\system32\NTDLL.DLL'<br />
RVA 00000C90, 78000000 - 78046000: 'C:\WINNT\system32\msvcrt.dll'<br />
RVA 00000CFC, 7c570000 - 7c628000: 'C:\WINNT\system32\KERNEL32.DLL'<br />
RVA 00000D68, 7c2d0000 - 7c332000: 'C:\WINNT\system32\ADVAPI32.DLL'<br />
RVA 00000DD4, 77d30000 - 77da1000: 'C:\WINNT\system32\rpcrt4.dll'<br />
RVA 00000E40, 77e10000 - 77e75000: 'C:\WINNT\system32\USER32.DLL'<br />
RVA 00000EAC, 77f40000 - 77f7e000: 'C:\WINNT\system32\GDI32.DLL'<br />
RVA 00000F18, 77a50000 - 77b3f000: 'C:\WINNT\system32\OLE32.DLL'<br />
RVA 00000F84, 6e5a0000 - 6e5c0000: 'C:\WINNT\system32\iisrtl.dll'<br />
...<br />
...<br />
...<br />
These are the lines of text which correspond to our application dll's
<br />
RVA 000039B4, 11000000 - 111b4000: 'C:\Apps\WebCache\WebCache.dll'<br />
RVA 00004518, 04200000 - 04573000: 'C:\Apps\WebCache\Admin.dll'<br />
...<br />
...<br />
But i'm stuck now. I do not know how do i understand and interpret the above data. Is there some other way i can track memory leaks in my dll's and/or web application.
Plz. help.
____________________________________________________________
rishabhs
I think therefore I am.
|
|
|
|
|
I always search on 'new' and 'delete'. (in C++ every new has a delete)
but this is not efficient though.
There are programs that do the search for you. I think "Purify" is one of them. (but I'm not sure)
During my studies they always said that you could easily write a garbage collector... ?
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I'm working with tree view ctrl with MFC and WTL.
What I really want is to get callback message (TVN_GETDISPINFO) into my tree view class and process or modify my tree items.
That's why I set I_CHILDRENCALLBACK to cChildren in TVITEM structure and set TVIF_CHILDREN flag into uFlags somthing when I insert items to tree ctrl..
My GetDispInfo handler look like this..
if(tvitem.mask & TVIF_CHILDREN){
tvitem.cChildren = (/*somecondion is true?%/)? 1: 0;
}
But I doesn't work..
Even though some items have children, button look like [+] didn't appear..but I could expand that..
Very strange, isn't it..?
Does anyone have idea to solve this problem?
|
|
|
|
|
i need to query the registry entry corresponding to HKEY_LOCAL_MACHINE as a user other than the administrator. but i m unable to do so. i cannot query unless i m administrator. why is it so?
|
|
|
|
|
|
Should the next C++ standard include support for "Design by Contract"?
I'm interested in hearing people's oppinions on the subject.
|
|
|
|
|
Post this to the lounge!
What has "Design by Contract" have to do with any language standard?
INTP
|
|
|
|
|
Stroustrup addresses this in D&E and, to sum it up, he feels that enforcing pre/post conditions in the language doesn't work because
a) The person writing the code usually can't predict all usages of the code before hand, so he makes the restrictions too tight
b) Later on, some perfectly valid user of the code runs into a wall with a restriction, and has to relax the restriction
c) After doing that a couple times, people get sick of having to maintain the list of restrictions and just ditch them completely.
If you think this is far-fetched, the exact same thing happened with exception specifications.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
I'd buy that for a dollar!
|
|
|
|
|
It seems to me that exceptions are different than pre/post conditions. Exception specifications are problematic because a sub-function the programmer uses and has no control over can throw an exception that he does not expect. With contracts, the writer is in control of the contracts.
I suppose it is possible for a person to make the restrictions too tight, but in my mind its better to have restrictions that are too tight than those that are too loose (or even non-existent).
The funny thing about the argument you presented is that this same argument applies as well to ASSERTs. Everyone I've talked to and everything I read encourage the use of assertions. In this Q&A session (http://66.102.7.104/search?q=cache:JUm2esOnHs8J:www.research.att.com/~bs/slashdot_interview.html+Stroustrup+assert&hl=en) Stroustrup argues that he prefers asserts and that some assertion templates should even be standardized. He just doesn't think that pre/post conditions add more than asserts can. However, there are people who disagree. Asserts can't be inherited with classes, where as pre/postconditions could.
|
|
|
|
|
Hi, all.
I have difficulty when I was trying to get texts from my dialog and show them on the View.
Does here have any examples relating this? I need one as my reference.
Thanks.
bonmeepon means pupcorn
|
|
|
|
|
Well, GetWindowText gets text from controls or any CWnd/HWND actually. Is you use the GetWindowText that is a member of CWnd then it either fills a text array or a CString. You can them pass those to the View where you wish to show them.
eg.
CString csText;
CEdit m_myEdit;
m_myEdit.GetWindowText(csText);
// pass the string to the view
pMyView->ShowText(csText);
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
hey how can i find out why a file doesnt open when im using fopen
?
|
|
|
|
|
|
Tyrus182 wrote:
how can i find out why a file doesnt open when im using fopen
By looking at errno .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hello,
I have 6000000 Records in my Bank and,
I want to Add theme in a DataGrid no by
a Repeat statement by setting the Recordset to
it. Like set Datagrid.Datasource="" in VB.
Best Wishes,
Thanks.
|
|
|
|
|
hi bosss .. it is not a good idea to go for datagrid and loading all these data into it thru datasource. Ofcourse, ur UI will be stucked for for more than 5 minutes.
Its better u use a flexgrid instad of datagrid and display a minimum of 10 or 20 rfecords at a time. On "next" / "previous" button click load the records accordingly by DB a query.
rgds..mil10
|
|
|
|
|
It seemed simple at first: support DBCS.
OK!
All the DBCS lower 128 characters are ANSI/ASCII; exception of '\' which is the Yen Sign in Japanese Shift-JIS.
BUT!
All the DBCS sets also provide a second set of characters representing: a-z, A-Z and 0-9. In addition some DBCS sets provide a second set of characters representing some other characters that must be recognised.
NOW!
First I made an invalid assumption that the _tcsXXX and ect... could be used to solve this problem, and second that any character represented in ANSI/ASCII set would be in the SBCS character set.
Quesions?
1) Should I provide a mapping a function that reconizes the same chacreter in ANSI and DBCS, and use that for all testing ( a.k.a. if( IsChar(*pChar, _T('-')) ) ).
2) Should I force useres to only use non-language specific characters, if they are aready defined in the ANSI/ASCII set.
Examples:
1) (LOCALE: Japanese Shift-JIS)
"0" and "\x82\x4F" both represent character '0', but _ttoi() does not recognise both of these as character '0'.
2) (LOCALE: Korean)
"+" and "\xA3\xAB" both represent character '+', but both _tcsncmp( pStr, _T("+") ) and *pStr == _T('+') does not recogize both of these as the character '+'.
Conclusion!
This is a pain in the 'BLANK'!
Ultimate Quesions!
1) Is this realy worth the effort?
OR
2) Is this just a ridiculously large amount of overhead to add proper support for DBCS character sets?
Note:
Requirements: support for ASCII, DBCS, UNICODE.
INTP
|
|
|
|
|
Hello i am trying to do something as soon as the program is fully initilized but as it starts up
where would i call a function that would do this
basicly im trying to open a file from arguments but when i call it in init dialog its just not able to open the file specified can someone tell me where a good place to call this function from would be? basicly is there something that gets called once the program is finished fully loaded?
|
|
|
|
|
How about near the end of InitInstance() in your application class?
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"
|
|
|
|
|
It does't matter where you try to open a file, if you are having a problem opening, then you should make sure it actually exists, or have access rights to it. Try using the function _access().
It shouldn't have anything to do with your dialog initialization.
If there's one thing I've learned, it's that life is one crushing defeat after another until you just wish Flanders was dead. - Homer Simpson
|
|
|
|
|
Hi all,
I would like to call a CDAODatabase class from my Regular MFC DLL, I have followed the instruction of Microsoft MSDN. But the following code run incorrect.
Can you help me on it ?
Thanks a lot for your reply.
Tuan
PS : This is my code
extern "C" BOOL PASCAL EXPORT VehicleChange()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CDaoDatabase* connData;
try{
connData = new CDaoDatabase ;
if(connData->IsOpen()) {
AfxMessageBox("The connection has been openned");
}else{
CString strConnect= "ODBC;DSN=FieldTrip;UID=;PWD=;";
connData->Open(_T(""), TRUE,FALSE, strConnect);
}
strSql = "update VehicleInformation set cAacity=11";
connData->Execute(strSql,dbSQLPassThrough);
} catch(CException *e){
connData->Close();
delete connData;
AfxDaoTerm();
return false;
}
AfxMessageBox("success");
connData->Close();
delete connData;
AfxDaoTerm();
return true;
}
|
|
|
|
|
hello,
i could'nt find a clear solution from google.
most of the result are in MFC or C#,.NET, etc
how can we communicate to serveral clients simultaneously ?
i am not concerned on establishing communication between cliets with the help of the server. all i
want is for the server to manage more that one client at the same time. and using multi-threading.
i tried, but could'nt succeed....
here is what i did,
1) a seperate thread which accepts connection
from clients. (acceptThread)
2) from acceptThread, whenever a client get connected, create a new thread (mainThread).
i am passing the client socket to the mainThread.
the main thread receives data and sends it back.
(an echo server)
is the method a correct one.....
my doubt :
whenever a client is connected, a thread (mainThread)is created. suppose when a client is half way through the thread, a new client connected with the server. i create a the mainThread once again, but with a different parameter. will this work.. should i create seperate theards, i.e., mainThread1,mainThread2.
in that case, if i wish to connect with 10 clients, i have to implement 10 threads. (ie 10 different threads, with different names).
another doubt:
can we use asynchronous sockets here.
suppose i am connecting to 15 clients, in the FD_READ, can i find from which client send me this
data. ie, i need the get the socket identifier.
please help...
|
|
|
|
|
deep_george Z wrote:
is the method a correct one.....
Yes, but...
deep_george Z wrote:
whenever a client is connected, a thread (mainThread)is created. suppose when a client is half way through the thread, a new client connected with the server. i create a the mainThread once again, but with a different parameter. will this work.. should i create seperate theards, i.e., mainThread1,mainThread2.
in that case, if i wish to connect with 10 clients, i have to implement 10 threads. (ie 10 different threads, with different names).
You need to read more on threads before you try to use them. This paragraphs suggests that this is the first time you have tried to use threads. Find a good tutorial somewhere on CP, or use Google to look up threading tutorials.
Basically, when you create a thread, it executes independently of other threads. Threads are multitasked by Windows in the same way that processes are. You can create multiple threads with the same thread function. Just be very careful about data synchronisation.
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"
|
|
|
|