|
|
Hi,
Iam Using CTreeView to Construct a Tree. If i delete any node in the tree
it is collapsing.
void CRunSetView::DeleteFilters(HTREEITEM hselected)<br />
{<br />
CTreeCtrl& TreeCtrl = GetTreeCtrl();<br />
HTREEITEM Parent = TreeCtrl.GetParentItem(hselected);<br />
<br />
short nRunsetId = GetItemID(Parent);<br />
HTREEITEM ChildItem = TreeCtrl.GetChildItem(hselected);<br />
<br />
do<br />
{<br />
short nMapId = GetItemID(ChildItem);<br />
<br />
<br />
CMigratorClient* pManager = GetDocument()->GetManagerPtr();<br />
<br />
CMigratorDoc* cmap = GetDocument();<br />
_RecordsetPtr rsMap;<br />
rsMap.CreateInstance(__uuidof(Recordset));<br />
<br />
<br />
CString strSQL;<br />
strSQL.Format(_T("SELECT * FROM DQMap WHERE ID = %d"),nMapId);<br />
rsMap->Open( _variant_t( strSQL ), _variant_t(( IDispatch *) pManager->GetDatabasePtr(), <br />
true), adOpenStatic, adLockOptimistic, adCmdText);<br />
<br />
if ( !rsMap->GetEndOfFile() )<br />
{<br />
CString MapNm = VariantToStr( rsMap->Fields->Item["FilterName"]->Value );<br />
rsMap->Close();<br />
<br />
<br />
_RecordsetPtr rsMapDQ;<br />
rsMapDQ.CreateInstance(__uuidof(Recordset));<br />
strSQL.Format(_T("SELECT * FROM DQMap WHERE FilterName = '%s'"),MapNm);<br />
rsMapDQ->Open( _variant_t( strSQL ), _variant_t(( IDispatch *) pManager->GetDatabasePtr(), <br />
true), adOpenStatic, adLockOptimistic, adCmdText);<br />
<br />
while( !rsMapDQ->GetEndOfFile() )<br />
{ <br />
<br />
nMapId = _ttoi( VariantToStr( rsMapDQ->Fields->Item["ID"]->Value ));<br />
<br />
<br />
short mapid;<br />
<br />
<br />
<br />
CMigratorClient* pManager = GetDocument()->GetManagerPtr();<br />
pManager->DeleteRunSetMap(nRunsetId,nMapId);<br />
<br />
cmap->deletefilters(nMapId);<br />
<br />
rsMapDQ->MoveNext();<br />
<br />
<br />
}<br />
rsMapDQ->Close();<br />
}<br />
<br />
<br />
}while((ChildItem = TreeCtrl.GetNextSiblingItem(ChildItem))!=NULL);<br />
<br />
HTREEITEM item = GetRootItem();<br />
DeleteItem(item);<br />
OnInitialUpdate();<br />
<br />
<br />
return;<br />
}<br />
Plz look at it , give any idea.
|
|
|
|
|
I'm writing a MFC application and I want to make it run when window start. I found an article in CodeProject but it is written in VB. Some one can help me, plz ...
|
|
|
|
|
Just put your application in startup. It will run when windows start.
Mukesh Kumar
Software Engineer
|
|
|
|
|
|
ok...
then add your application's path under
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" registry key.
Mukesh Kumar
Software Engineer
|
|
|
|
|
Can I know why my answers are voted down?
Mukesh Kumar
Software Engineer
|
|
|
|
|
I wonder if you could show me how to write those codes in C++/MFC ? ( I have an assignment with that problem ...
|
|
|
|
|
Oh... It means if I write complete code for your assignment then it is ok, otherwise you will voted down my answers.
Hints are not enough for you.
Thanks buddy...
Mukesh Kumar
Software Engineer
|
|
|
|
|
I don't mean so. If you know any useful function about that problem you can tell me & I'll make my own code ... Anyway, thanks for your reply. Ofcourse, I'll vote for you
|
|
|
|
|
I need help,I need construct a suffix tree for large string data.
content:the string is read from a inputfile(*txt).The size of the txt should be over 30M.the string include only A,G,C,T.(biography sequence).
the output should include string match and the LCP.
And I cannot solve this problem.
so I help all of you.
Please help me with solve this problem.
thank you all.
|
|
|
|
|
|
dear everyone,
now I have a problem .I can't call dll array ,which is fortran's
who can help me.
thank you greatly.how to use the dll declaretion.
email:yuhongwei4101@126.com
|
|
|
|
|
I have not gone through all of the sub-posts but I found this.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=16115&SiteID=1[^]
Hope it helps!
I have a blog but I won't link it because some people can't take sarcasm. I might hurt someone's feelings! Check the 'email' button on a post of mine if you want the blog address. If you know the blog address and post something back at CP about whatever I post, you are a hypocrite.
|
|
|
|
|
Maybe a new entry [^].
(sorry for the extra-work)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
As we all know.the control of VC++6.0 is very ugly!How to change the Scrollbar's color and picture of CTreeCtrl control in VC++6.0?
|
|
|
|
|
who can help me ? The knowlege about this is very little on internet.
|
|
|
|
|
Hi,
Does anyone know if a thread name has been set is there anyway to retrieve it ???
|
|
|
|
|
ForNow wrote: Does anyone know if a thread name has been set is there anyway to retrieve it ???
Do you mean thread name for the debugger, the simple way is to remember the name that you have [set for the thread^], you may use [thread local storage^] to store the name but not required.
|
|
|
|
|
Actually in processing my DLL_THREAD_ATTACH I only want to process certin threads and I was thinking of Getting the thread name and comparing it to see if its the thread I want to process
However there doesn't seem to bet a GetThreadName API
|
|
|
|
|
Then don't think about debugger SetThreadName, It is available for debugging purpose, if the debugger is not attached then no use you should not use that for final product.
You may use [Thread Local Storage win32 API^] to store the name of the thread at a particular index and retrieve the value.
|
|
|
|
|
Problem is in DLL_THREAD_ATTACH
I only want to Process certin threads so...... I want to know the nature of the thread
Tried StackWalk but go to KiAPC.... it was an asyncourous procedure call which lost track of the stack
When going throgh the debugger I get the thread id, the statement after CreateThread or in this case since the orignal app is in C is _beginThreadx it would be nice if some how using the thread id I could some how tell the DLL_THREAD_ATTACH message the nature of the thread
Thankx
|
|
|
|
|
Hi all,
What is the counter part of the FtpCommand function for http? I need this inorder to find out if a certain http site supports pause and resume
BOOL bRet = ::FtpCommand(hConnect,FALSE,FTP_TRANSFER_TYPE_ASCII, "REST 0",0,&,hResponse);
This is the line
Thanks,
Jj
|
|
|
|
|
Hello again monsieur_jj,
You can use the code I posted yesterday[^] to pause/resume your download. You can easily implement it yourself. First you need to acquire some knowledge about HTTP. The ability to pause/resume a file download is actually taking an advantage of a function of the HTTP 1.1 RFC[^] over at the world wide web consortium[^].
If you take a look at section 14[^] and scroll down to 14.16 Content-Range you will see the description of how to obtain a range of bytes from the requested file. For example:
1.) When the HTTP download begins you should store the content length.
DWORD dwFileSize;
pSession->QueryInfo(HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER,dwFileSize);
2.) Open the URL with the sample code I provided in my last post and begin writing the bytes.
3.) If the user pauses the download close the CInternetSession in the middle of writing to the file. Save the number of bytes written to a variable for later use.
4.) User resumes the download and you compare content-length with amount you previously wrote to disk. Re-open the file on disk and reopen the CInternetSession and URL.
But this time we add the Range header! For example:
"Range: bytes=1024-2048"
"Range: bytes=1024-"
"Range: bytes=-1024"
Any library which allows to add HTTP headers can be made to pause/resume HTTP downloads by simply adding the correct headers. Hope this helps!
Best Wishes,
-David Delaune
|
|
|
|
|
Hello David,
May i ask you one question? actually i am working on project suggestion list and for every hit a request is send to server and than responce occur. this is done using http connection.now we are using thread for sending the request because we do not want that user will wait for responce while typing and one more condition i use is that i am taking an Id for requset and responce. when they are equal than only suggestion list is display.
It is working fine but after typing some lines a crash appear. IT is because of thread that is created everytime. I dont find any clue why is it so. bcause it take time to destroy a thread but on every hit thread is created.
Can yo please suggest me what is wrong .I am regularly checking your reply
Thanks
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|