|
Something else is going on. The theoretical limit is 2048 using default stack size. I would step into the MFC code and see what the problem is.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
The number of threads is limited by the amount of available virtual memory. By default each thread has one megabyte of stack space. This means that you can create at most 2028 threads. To obtain more threads you need to increase your virtual memory or reduce the stack size for each thread. See the CreateThread documentation for addition information.
|
|
|
|
|
What are the prefined control class names (WNDCLASS structures)? I can't find a list of them anywhere. Some I have figured out, EDIT, COMBOBOX, STATIC, BUTTON. But I need others as well, specifically the one for CDateTimeCtrl. Where can I get the list?
Ed
|
|
|
|
|
Try Spy++.
Regards, Larry Antram
Stardust Software
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones."
-- Albert Einstein
|
|
|
|
|
i m trying to show a large map in a small picture box control in VC++ (6.0). i dont want to stretch the image rather i want to slide the image in the control so that whatever part i wanna see i can move the image and see that. please let me know how to slove this problem. i am fed up of this problem and let anybody help me out as soon as possible.
|
|
|
|
|
You can choose any rectangle from the source bitmap to copy to the screen using the BitBlit function.
Like it or not, I'm right.
|
|
|
|
|
Just wondering if anyone out there could give me a simple example of how to create a string array. I am having problems, trying to do this. Any help and examples would be appreciated.
|
|
|
|
|
Are you implying a vector of strings or a CStringArray object?
Kuphryn
|
|
|
|
|
CStringArray myStringArray;
myStringArray.Add ("Hello");
CString myString = "world";
myStringArray.Add (myString);
myStringArray.RemoveAll();
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Once you have created the array, it is quite user friendly.
For example, if you are looping through the array, you can use array.GetAt(index) or just use array[index] since the [] is overloaded.
I am finding this to be a great solution for filling a listbox.
Has anyone found a better solution?
|
|
|
|
|
How do I get an apps X and Y size?
|
|
|
|
|
I assume what you want is GetWindowRect()
-Jack
To an optimist the glass is half full.
To a pessimist the glass is half empty.
To a programmer the glass is twice as big as it needs to be.
|
|
|
|
|
How to calculate the download rate when sending file over the the socket!?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Rate is just (data transfered / time)
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
You can use this class to help you compute elapsed and remaining times (the latter only if you know the final size of the data being received/sent).
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I'm trying to run a VB app as a service in windows 2000. Since VB is very limited, this is not really possible. Does anyone know if I could write something in C++ that I could run as a service that would execute a VB app every 5 minutes? Or does anyone have any thoughts on how I could do this???
Thanks alot!
Phil
|
|
|
|
|
If I properly understood your question, you do not have to use service to run VB (or any other) application every 5 minutes.
Instead, you can just use win2k task scheduler.
-Gile
|
|
|
|
|
|
You could make a COM Object in VB, and create a service using C++ that starts the COM Object. I have done that a couple of times...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
I'd second what A.M said. One more similar option for you(instead of creating a full fledged service in C++) is to build a winlogon notification package(that's just what I did. I coded it as a component)and then run your vb.exe file on winlogon events.
Matter of fact this is just what I did to make my VB program work as a service.
|
|
|
|
|
Hi,
I have created a Standard Dialog Application
Added CButton m_button to the class
and have the following OnInitDialog
BOOL CTestChekBoxDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_button.Create("Hello", WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,
CRect(10,10,100,30), this, 10000);
// m_button.SetFocus();
GotoDlgCtrl(&m_button);
return FALSE; // return TRUE unless you set the focus to a control
}
What I need is to programatically selct the checkbox so that it shows the focus rect around it i.e.
...........
O :Some Text:
...........
You get this effect if you Tab to the control
Thanks in advance
Andy
|
|
|
|
|
Set the tab order so that the control you want to have focus (upon initial display of the dialog) is first.
Regards, Larry Antram
Stardust Software
"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones."
-- Albert Einstein
|
|
|
|
|
Sorry this does not display the focus rect around the text.
The only way I know how to get this is by Tabbing around the controls.
But I need to set it programatically
Andy
|
|
|
|
|
The problem seems to be Win2000 and a soloution was provided by Jeff Partch [MVP]
Hi, Andy!
May not be relevant, but under what OS are you running? On Win2k and up, the focus rect is hidden by
default until you do things like: 1) Tabbing with the keyboard, 2) Hit the ALT key, or 3) Invoke the
dialog with the keyboard in the first place. The WM_UPDATEUISTATE may explain it better than I do,
but if I add a PostMessage of it to your OnInitDialog...
BOOL CTestChekBoxDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_button.Create(
_T("Hello"),
WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_AUTOCHECKBOX,
CRect(10,10,100,30),
this,
10000
);
GotoDlgCtrl(&m_button);
PostMessage(
WM_UPDATEUISTATE,
MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS)
);
return FALSE;
}
...it'll circumvent the expected behavior (which may not be a good thing, but that's your call). It
does do for me anyway. To get these 'UISTATE' defines you need to have the latest (or later than
that which ships with VC6) PSDK installed, and 2) You need to have defined (_WIN32_WINNT >= 0x0500)
way early in the build process. Personally, I think this conditional around a Window's message and
its parameter values is an error in judgement. Anyway, both these can be a real pain, so FWIW...
#ifndef WM_UPDATEUISTATE
#define WM_UPDATEUISTATE 0x0128
#endif
#ifndef UISF_HIDEFOCUS
#define UISF_HIDEFOCUS 0x1
#endif
#ifndef UIS_CLEAR
#define UIS_CLEAR 2
#endif
And in the not that you asked department: the way you've posted it, you dynamic creation of the
button looks like the hard way to go about it.
--
Jeff Partch [MVP]
|
|
|
|
|
How do I add items to a combo list generated by the MVC Wizard? The Wizard generates an ID under a DIALOG block in the .rc file. Using CCombo.AddString() works when you instantiates the object, but not, of course, on ID variables. I need somehow to link the ID to a CCombo object and go from there. Any suggestions? Thx.
ralf.riedel@usm.edu
|
|
|
|