|
nope... no hard limit. But you are going to run out of memory. Default each thread has a 1MB stack... so go from there. Also performance vise is that too many threads running (and doing stuff) you will start to loose so much time in the thread switches that the system will grind to halt.
Magnus
|
|
|
|
|
I don't think (so I'm not sure) there is a limitation to the number of thread an application can spawn. However, each thread need some resources to be maintained and there is a time sharing process which becomes inefficient if you have too many threads.
In brief, having a huge amount a thread will decrease a lot the performances of your app. In general, having so many thread results from a bad design.
|
|
|
|
|
Hi Everyone,
Can anyone tell me how to delete the entire selected row in a LISTCTRL using the keyboard delete key
Thanks in advance
With regards
Raja Bose
-- modified at 8:48 Tuesday 9th May, 2006
|
|
|
|
|
Capture the LVN_KEYDOWN message. You can then check to see if the key pressed is the delete key (VK_DELETE). If it is, then call your deletion routine as normal.
For e.g.
void CMyDialog::OnKeydownList(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
switch( pLVKeyDow->wVKey )
{
case VK_F2:
ActivateEditing();
break;
case VK_DELETE:
OnDeleteitem();
break;
default:
break;
}
*pResult = 0;
}
I Dream of Absolute Zero
|
|
|
|
|
Hi,friends
Can anyody guide me about the secon round of interview
at microsoft. What they are genarally asked in that round ?
Rastogi
|
|
|
|
|
|
|
Try asking this in the Lounge, and good luck for the interviews.
~RaGE();
|
|
|
|
|
Hi,
How are you all?
This is my first post here. I am new to MFC and just a college passout.
I hope to have nice answers here for all the "Greats"!
My program is having memory leakage.
In my view function,
I use
CDC *pdc=GetDC()
But I am not releasing it.
Can this be a reason for leak?
In view function what is the best method to use Contect devices to avoid such errors? Should CClientDC be used?
I assume I am understandable here .
--
LinDaSu
|
|
|
|
|
Hi
What you have there is not a regular memory leak... it could be a GDI resource leak. But that is depending on how the window class is created. If any of the following styles were used CS_CLASSDC, CS_OWNDC or CS_PARENTDC, then the above is not a resource leak, other wise you should use ReleaseDC to reclaim the GDI resources.
Also for you information, VS C++ will not report GDI resource leaks only normal memory leaks from the built in memory handler.
Magnus
|
|
|
|
|
give me a sample for service in c++,mfc
|
|
|
|
|
Have you tried Googling for such an example?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
|
We need to create an IE instance from our application,navigate to a particular site programmatically and load the DOM document tree for that page.
When we do it from a ATL GUI application ,and create the IE instance on the click of the Button control,the browser duly fires the beforenavigate,navigatecomplete and documentcomplete events ,and we can load the DOM tree on documentcomplete.
However,when we try to do the same from a win32 console application ,the browser fires the 'beforenavigate' event and waits.
It fires the remaining events and navigates to the site only after we exit out of the application.
How do we make the browser complete the navigation to the site,without exitting from the program?We have even tried to fire the navigate event on a separate thread,but to no avail.
int main()
{
CoInitialize(NULL);
IIEdispatcher* disp;
HRESULT hr;
hr=CoCreateInstance(CLSID_IEdispatcher,NULL,CLSCTX_INPROC_SERVER,IID_IIEdispatcher,(void**)&disp);
if(SUCCEEDED(hr))
{
disp->createIE();//this method navigates the browser to a url
}
CoUninitialize();
}
The browser completes it navigation only after we exit out of this process.We are creatign the browser as a out-of-proc component.
|
|
|
|
|
Hi all,
I have to send tag points to two differnt operators(A&B).
Till we are sending to one operators.But now i have to send two different set of tag points to two different operators.
My coding
BOOL OpenReadFile()
{
CString strFileName;
strFileName = WorkDirectory;
if(FodFlag==TRUE)//Its for A operator
{
strFileName += "\\FODCS\\Tag.FODCS";
}
if(OPSTATION == CENTUMXL)//it may be B opr
{
strFileName += "\\YXL\\Tag.YXL";
}
else if(OPSTATION == CS3000)//it may be B opr
{
strFileName += "\\YCS\\Tag.YCS";
}
else if(OPSTATION == HONEYWELL)//it may be B opr
{
strFileName += "\\TDC\\Tag.TD3";
}
else if(OPSTATION == FOXBORO)//it may be B opr
{
strFileName += "\\FOX\\Tag.FOX";
}
else
{
AfxMessageBox(IDS_OPSTATION);
return 0;
}
if(!PFile.Open( strFileName, CFile::modeRead ))
{
AfxMessageBox("Failed to read Tag Point information");
return 0;
}
return 1;
}
The StrFile Name refers C:\\ABC
As we have to select two operators at a time,the file path got wrong and display the ("Failed to read Tag Point information")
Pls help me
|
|
|
|
|
I think you have to filter out everything that is your application specific: we cannot understand what you are looking for. Explain the problem in a way that is understandable for us (remember that we cannot see your screen and the project you are working on).
We don't know what a tag point and an operator are (in the context of your application I mean).
|
|
|
|
|
Here I will explain my problem in detail…
First here Operator means my trainee. and I am a Trainer.From my trainer coding I have to send some Tag details(Tag Name like Controller,Indicator,Guage ;Scale value;Alarm color) to my trainee coding.Each trainee should receive different tag details.
I have two different trainee coding as AA and BB. I have saved the tag details in a file in C Drive as c:\\FOD file for Trainee AA and c:\\YCS file for BB. I have to send details at a time.
Till now my application is running by having one trainee as BB.So, my coding referring the file with out any confusion. Now I have to develop for two trainee codings.
So I changed my previous coding by adding these two lines,
if(FodFlag==TRUE)//Its for A operator
{
strFileName += "\\FODCS\\Tag.FODCS";
}
I set a flag for the selection of AA trainee. But it’s the wrong way Coz’
For eg; If I choose A operator as well as OPSTATION == CS3000 operator..then the file directory get changed and showed the error message box.
BOOL OpenReadFile()
{
CString strFileName;
strFileName = WorkDirectory;
///Newly added coding
if(FodFlag==TRUE)//Its for AA operator
{
strFileName += "\\FODCS\\Tag.FODCS";
}/////end of new coding
if(OPSTATION == CENTUMXL)//it may be BB opr
{
strFileName += "\\YXL\\Tag.YXL";
}
else if(OPSTATION == CS3000)//it may be BB opr
{
strFileName += "\\YCS\\Tag.YCS";
}
else if(OPSTATION == HONEYWELL)//it may be BB opr
{
strFileName += "\\TDC\\Tag.TD3";
}
else if(OPSTATION == FOXBORO)//it may be BB opr
{
strFileName += "\\FOX\\Tag.FOX";
}
else
{
AfxMessageBox(IDS_OPSTATION);
return 0;
}
if(!PFile.Open( strFileName, CFile::modeRead ))
{
AfxMessageBox("Failed to read Tag Point information");
return 0;
}
return 1;
}
Among Two trainees,Here AA is compulsory Trainee and BB may any of the above BB operator.
|
|
|
|
|
I didn't understand anything. Could you make abstraction of your program (so explain the problem clearly without digging with the details of your application that in fact, we don't care). What is the problem ? What do you have actually as code (explain what it should do and what it does exactly) ?
If we don't understand what the problem is, it will be difficult to provide you with a solution.
|
|
|
|
|
hai
i want to apply Microsoft XP visual styles to my dialogs.i have gone through the article"using windows XP styles in your MFC/Win32 applications" by Kluch and i have developed an application according to him but i couldnot see any effect.even iran his demo but no result.can anybody help me out this problem.
sathish
|
|
|
|
|
mosali satish wrote: i want to apply Microsoft XP visual styles to my dialogs.
You have to specify a manifest file for your project.
Open your RC file and add the following line...
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ".\\YourApp.manifest"
YourApp should be replaced by the exe name of your project.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Hi,
I use an owner draw menu (handling WM_MEASUREITEM, WM_DRAWITEM, WM_MENUSELECT, WM_MENUCHAR messages).
Under MFC, if you use a popup menu with several menu items
(for example: recent files), two automatic menu scroll button appear on the top and the bottom of the list.
These buttons appear when there isn't enough place on the screen to display the menu items.
How can i change the default drawing of this buttons?
|
|
|
|
|
Hi,
Has anybody worked on MixerControl API.. I want to find the audio level from my microphone attached to the PC. I am using mixerGetLineControls function to get the volume. but it is not returning the correct volume. always returns some negative value.
Can anybody help me in this issue.
Thanks in advance
Poornima
|
|
|
|
|
You're asking for way too much to hope for a reply here. Vector graphics means that to zoom, all you need to do is scale all the vectors before drawing. You need to post some code, and ask specific questions about where you're getting stuck.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am quite sorry that the only help I can offer is the following:
Check out ZedGraph on SF and the articles here on CP. ZedGraph is a Graphing Control capable of zooming into and out of Graphs. Looking at it's source might help you to find a solution. It was written in C#, though.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Sebastian Schneider wrote: ZedGraph is a Graphing Control capable of zooming into and out of Graphs
Mmmhh, I don't think this will help. I don't know ZedGraph but for a chart control, the most logical way of zooming and unzooming is simply to change the min and max values of the axis. And the rest should be done automatically .
|
|
|
|