|
This capability was removed from Visual Studio starting with Visual Studio .NET 2003*.
Discussion on the msdn.com and microsoft.com web sites indicate that this feature
will not be implemented in future versions of Visual Studio.
You can create a .bat file or makefile based on the buildlog.html. A buildlog.html file is created after building a project. You can find the file under the $(output) directory.
I am not a genius, but shed more sweat!
|
|
|
|
|
Just wondering.
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
[My articles]
|
|
|
|
|
Hi
This is more of a code architecture question. I'll try my best to explain what I'm trying to do.
I need to create a function that have access to a secondary thread, process it, and returns back to the primary thread.
Let say class B has FunctionX.
bool B::FunctionX(LPCTSTR lpszValue, CString& strResponse)
{
}
Then, class CMyView will call FunctionX like so
void CMyView::Foo()
{
B myB;
CString str;
if(myB.FunctionX(TEXT("TestValue"), str)
{
AfxMessagebox(TEXT("Oh Yeah!"));
}
else
{
AfxMessageBox(TEXT("Boohooo!"));
}
}
|
|
|
|
|
So u mean you want to create a thread(Secondary) inside a thread(primary) and then do the secondary processing and then continue the primary.
Величие не Бога может быть недооценена.
|
|
|
|
|
I think you didn't really understand how threading works. You can't "call" a thread, a thread is running in parallel of your main thread and you cannot call it.
From your example, it looks like you want to do some processing, get the results of the processing when done and display that result, all of that WITHOUT freezing the UI (that's why you want a thread, right) ? Am I correct ?
If yes, then this is not the way to do it: in your Foo function, you are anyway waiting for the result of your thread (thus blocking the main thread), which means that the UI messages won't be processed anymore.
The best way to solve your problem is to start the thread (in your FunctionX for instance) and then post a user defined message containing the result to the UI. I suggest you read this very good article[^] for more information.
|
|
|
|
|
Thanks for the link. Helps a lot
|
|
|
|
|
Hi all,
i m trying to sending Long SMS by AT command in PDU mode.
<br />
<br />
Here is a complete set of AT commands to send a message consisting of 2 parts:<br />
<br />
Part::1<br />
AT+CMGS=153<br />
0041000A8199176862600000FFA0050003000201C139889C9E8FEBF379990C4ABB416137A81C96B3D3653908FE9ED359A0FCBB0E1A87DDA0F1DBED2E8FE920FA1B14061DA74D50FB4D2EB741613719549F9741412A68FC6EB7C36EF21C447F83E6653719346D4E41EDF27C1E3E97E72E10155D9697416179192403C1DFF3795ACC2E83DA653AFA4D9EEB40D4329E0E6ABFC96550D84D06418955<br />
<br />
Part::2<br />
AT+CMGS=32<br />
0041000A8199176862600000FF0E050003000202A0F69B5C0699DF72D0B4397501<br />
<br />
return AT+CMGS Error.
please help me .
thanks in advance
|
|
|
|
|
I have read through www.flounder.com Asynchronous Process Notification/Worker Thread and Arjay thread articles but I can't figure out how to get the two work together
From Asynchronous Process Notification, I understand to use Afxbeginthread to create a thread to wait for the process to end and post a message.
From Worker Thread and Arjay thread articles, I understand that I can use SuspendThread() and ResumeThread().
void CProcessManagerDlg::OnBnRun()
{
ptrThread = AfxBeginThread(WaitThread, this, THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
ptrThread->m_bAutoDelete = FALSE;
ptrThread->ResumeThread();
}
void CProcessManagerDlg::OnPause()
{
ptrThread->SuspendThread();
}
UINT WaitThread(void *pParam)
{
CProcessManagerDlg* pThis= (CProcessManagerDlg*)pParam;
HANDLE hProcess = Launch(_T("notepad"));
::WaitForSingleObject(hProcess, INFINITE);
pThis->PostMessage(UWM_DONE, 0, (LPARAM)hProcess);
}
Press Pause wouldn't do anything. I am guessing WaitForSingleObject is preventing the thread from receiving suspend or resume(which would explain why TerminateThread and PostMessage(WM_QUIT) do not work either). So how would I go about suspending a thread that needs to waitforsingleobject on external process?
|
|
|
|
|
Why do you need to suspend the thread if it's already waiting for the external process?
|
|
|
|
|
I want the ability to pause/resume the external process.
|
|
|
|
|
The thread that launches the process is not the thread inside that process. Each process has its own threads.
If you want to pause the external process, you'll need to use the information in this article:
http://msdn.microsoft.com/en-us/library/ms686701(VS.85).aspx[^]
Specifically, see Traversing the thread list .
|
|
|
|
|
Ah so I can't use the thread that spawn the process to pause it. This is going to be a lot more complicated
Thanks for the link I am looking into it. I don't suppose there is an article with demo on here or CodeGuru for me to fiddle with it.
|
|
|
|
|
There very well might be an article here.
The idea is that you enumerate all the processes until you find the one you just launched, then enumerate all the threads in the process and pause each one.
|
|
|
|
|
I forgot to mention that if you want to start the external process in a suspended state, you can call CreateProcess() with a special flag called CREATE_SUSPENDED, and the process will be loaded, but will not run until you resume each of its threads.
|
|
|
|
|
I have to look into that. With Pause and Resume I noticed how much I could have used PROCESS_INFORMATION. I could have skipped thread list traverse with SuspendThread(pi.dwThreadId),if I am not mistaken
|
|
|
|
|
Yes, you could have. But if the remote process spawns any new threads, you would still have to enumerate them to see what they are.
|
|
|
|
|
Thanks again. You have no idea how long I have been racking over my brain over this problem.
|
|
|
|
|
|
Did u used ShellExecute to create the process?
Величие не Бога может быть недооценена.
|
|
|
|
|
Sorry if I wasn't clear my Launch() = ShellExecuteEx
|
|
|
|
|
Can you show the code inside Launch()?
Well i prefer to use CreateProcess.
Величие не Бога может быть недооценена.
|
|
|
|
|
You know while I was investigating this I have thought about switching back to CreateProcess base on what I read. Before, I had gone back and forth between CreateProcess and ShellExecuteEx (at one point I had two launch functions). But ultimately I stuck with the one that allows me to use lpOperation, open associated program automatically and open url using default application. Also I was influence by An Introduction to Processes: Asynchronous Process Notification[^], where Microsoft recommend the use of ShellExecute.
Now if there is someway for CreateProcess to use lpOperation that would be nice. OR have ShellExecuteEx populate PROCESS_INFORMATION.
I always wonder why there isn't a function that encapsulate both strengths.
|
|
|
|
|
Every time I run this code it fails at AppendCategory to the JumpList.
Any pointers or what effects that could cause that.
Thanks in advance.
ICustomDestinationList* pJumpList = NULL;
if (SUCCEEDED(CoCreateInstance(CLSID_DestinationList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pJumpList))))
{
MessageBox (NULL, (LPCSTR)"JumpList variable Created!", (LPCSTR)"JumpList", MB_OK);
if (SUCCEEDED(pJumpList->SetAppID(L"My App")))
{
MessageBox (NULL, (LPCSTR)"AppID Set!", (LPCSTR)"JumpList", MB_OK);
UINT uMaxSlots;
IObjectArray* pRemoved;
if (SUCCEEDED(pJumpList->BeginList(&uMaxSlots, IID_PPV_ARGS(&pRemoved))))
{
MessageBox (NULL, (LPCSTR)"Beginning to create JumpList!", (LPCSTR)"JumpList", MB_OK);
IObjectCollection* pContents = NULL;
if (SUCCEEDED(CoCreateInstance(CLSID_EnumerableObjectCollection, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pContents))))
{
MessageBox (NULL, (LPCSTR)"Created ObjectCollection!", (LPCSTR)"JumpList", MB_OK);
IShellItem* pItem = NULL;
if (SUCCEEDED(SHCreateItemInKnownFolder(FOLDERID_Downloads, KF_FLAG_DEFAULT, L"iTunes64Setup.exe", IID_PPV_ARGS(&pItem))))
{
MessageBox (NULL, (LPCSTR)"Identified Item to ShellItem!", (LPCSTR)"JumpList", MB_OK);
if (SUCCEEDED(pContents->AddObject(pItem)))
{
pItem->Release();
MessageBox (NULL, (LPCSTR)"Added ShellItem to ObjectCollection!", (LPCSTR)"JumpList", MB_OK);
IObjectArray* pContentsArr = NULL;
if (SUCCEEDED(pContents->QueryInterface(IID_PPV_ARGS(&pContentsArr))))
{
pContents->Release();
MessageBox (NULL, (LPCSTR)"Linking ObjectCollection to ObjectArray!", (LPCSTR)"JumpList", MB_OK);
if (SUCCEEDED(pJumpList->AppendCategory(L"Custom Category", pContentsArr)))
{
pContentsArr->Release();
MessageBox (NULL, (LPCSTR)"Appended ObjectArray to the JumpList!", (LPCSTR)"JumpList", MB_OK);
pJumpList->CommitList();
MessageBox (NULL, (LPCSTR)"JumpList Created!", (LPCSTR)"JumpList", MB_OK);
}
else
{
MessageBox (NULL, (LPCSTR)"Can't AppendCategory!", (LPCSTR)"JumpList", MB_OK);
}
}
}
}
}
}
}
}
|
|
|
|
|
Hi,
I'd like to use a transparent PNG image as the background of a top level window (WS_POPUP).
Using GDI+ I have the image displayed correctly, but the problem is the transparent area (eg what is under my window) is not refreshed when I move the window.
How can I get it refreshed?
case WM_ERASEBKGND:
{
Gdiplus::Graphics graphics((HDC)wParam);
graphics.DrawImage(myImage, 0, 0, myImage->GetWidth(), myImage->GetHeight());
break;
}
Thanks for your help !
|
|
|
|
|
I'm not completely sure what you are trying to achieve there but i think you should rather check this[^] out.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|