|
Search MSDN for the TRACE() macros.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks, DavidCrow buddy!
George
|
|
|
|
|
A good utility for using the trace functionality in your application so that you can also send to a different viewer (for more real time debugging) go here http://www.dilascia.com/
and get the Trace Win app.
|
|
|
|
|
Thanks, Adam buddy!
George
|
|
|
|
|
Hi All,
How can I implement in VC++ a function like VB CreateObject Function.
I've make a Dll in VB with 3 classes how can I invoke those classes in VC++
Thank in Advance
CM
Carlos Mariano
|
|
|
|
|
Hy,
i hope somebody can help me to solve my problem.
I have a laptop and a lan network at my company and a lan network
at home.
At home i have a static ip address for my laptop ,
at company the ip address is given dynamicly.
I would like to write a little tool to change the ip address
and the setting how to receive the ip address,
to make the change more comfartable for me.
I know there exist some tools to do exactly this, but i want to
solve this problem on my own.
Now i am searching for examples or the orders to implement my tool,
because i do not find them until now.
I am very thankful for every advice.
Thanks
Micha
|
|
|
|
|
What is the purpose of changing dynamic IP?
In any case, you may consider creating local DNS mapping just by opening and writing/modifying new entry in "Hosts" file located in yours WINDOWS\SYSTEM32 directory. Make sure to do that before loading/calling any winsock/wininet functions in your program.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I have a Video system and I want to display permanently images that come from it when I run my application. Solution seems to be Direct Draw with 2 graphic board or a DUAL one. It is not really a problem, I suceed. But, there is a point that worry me. It is obvious that when my application is running on one monitor we will display video image and on the other normal interface and I'd like seeing mouse only on the normal inteface. But if we attach all the graphical boards to the desktop the mouse is moving on the 2 screen, I am afraid that is too confusing for customer. I'd like then use one board attach on the desktop (we need at least one anyway) and the other is sleeping, excepted when my application is running then it will display video. In term of programing that means we need to call Direct draw with the good board device. the function DirectDrawEnumerateEx is all what we need. It works well if all the board are attached to the desktop (that is to say we see all the board device) but any of the boards are not attached then I don't succeed in seeing them. However there is a flag DDENUM_DETACHEDSECONDARYDEVICES that seems to be specially provided for that use but it do not return anything about the detached devices. Is anyone can help?
Gwen
|
|
|
|
|
Hi there,
I have some MFC programs, which worked without a problem unter Windows NT.
But now I have Windows 2000 and when i change the resolution down to 640x480..the MFC Program doesn't change the own resolution?
What's wrong with my programs?
Thanks!
cheers
|
|
|
|
|
Hi,
In my VC++ server application ,i create a Process.I want to kill this Process after say 10 or 15 minutes if the Process is Ideal(in this case if the client/User doesn't connect to the server).Pls help.
I know that i can use KillProcess .But how to find the Process is ideal(that's if user is not connecting to server)
Thnks in advance
ram
|
|
|
|
|
When you created the process via CreateProcess() , the last parameter will contain the process' handle. Keep that handle around for use later on.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi !
Is it possible to create a CWnd which would have it's client area look like a dialog resource ?
Why ? Because CDialog class doesn't have a great support for menus, docking toolbars or other stuff a CWnd has.. CFormView is the closest thing to what I want to achieve (CFrameWnd with CFormView as the view), but I do not want to use the document template. And using a CFormView without a document template is daunting process (read: I have no clue how)
In addition to all this, my dialog MUST have a classname as well..
So, any suggestions on where to begin ? Namely, how to bind a dialog template to a CWnd
Thanks,
Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
You MUST not use the doc, you code your programm around. It only helps you with some routines.
Another approach can be the modeless dialog. There are some samples in the MSDN and maybe in CP.
Try this @ home. (B&B)
|
|
|
|
|
Thanks for the reply !
Unfortunately, I couldn't find any ways to 'code this around'.. Any hints on where I could find such articles ?
Like I described in my opening post, using a CDialog-derived class is NOT an option, unless you can tell me how I can specify a menu resource, a class name and a window name while building the dialog. Does the CDialog have a suitable overridden CWnd::Create for this purpose ?
Greets,
Antti
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
The application I work on can be ran through an automation model via DCOM, which is fine and works well, but it does mean that we must be able to run several instances of the application on one machine. I've found that I can run no more then 10 instances of the application on any given machine (regardless of the resources available to the machine), and this simply isn't enough, so I've been looking into why this is.
I've found that if I create a standard MFC (VC6) MDI app, accepting all the defaults, that that application can only be ran 102 times simultaneously, which seems very odd to me, the machine (according to task manager on WinXP) has plenty of memory available, but I can't open another instance of the application (or any other application, like notepad). When I trace into it with the IDE I find that it either fails on creating the main frame of loading the main menu resource.
So, I was wondering, does anyone know if there is a limit to the amount of resource's / GDI objects / USER objects / handles / threads Windows can open at once? Or am I barking up the wrong tree - can anyone give me a clue as to how I can get my app to run more simultaneous copies? (Note, I can't change the architecture at this stage, I'm stuck with the automation model, management's decision...)
Dylan
|
|
|
|
|
User Object Handles
User objects are one of three categories of objects handled by the Windows NT® and 2000 operating systems. User objects include items such windows, menus, cursors and icons. The other two categories, GDI and kernel objects, are discussed in subsequent sections.
There is a system wide limit of 65,536 user handles per system. According to Microsoft, there is no per-process limit2; however, testing yielded the following results on Windows NT 4.0 SP6a and Windows 2000 SP2:
Operating System Default Limit Maximum
Windows NT No default No per-process maximum
Windows 2000 10000 (0x2710) 10000 (0x2710)
On Windows NT, although it appears that the per-process maximum is theoretically the same the system maximum of 65,536, the actual maximum is dependent on the type of user objects as well as other system resources such as desktop heap (which is discussed later). On Windows 2000, the maximum number of user handles per process can be set in the following registry entry; however, the default value of 10000 (0x2710) seems to also be the maximum value.
HKLM/Software/Microsoft/Windows NT/CurrentVersion/Windows/USERProcessHandleQuota
In Windows 2000, user object handle counts can be monitored via the Processes tab of Task Manager by selecting View->Select Columns... and selecting the "USER object" check box. While this option also exists in Task Manager on Windows NT, it is not functional on that platform.
GDI Object Handles
The Graphics Device Interface is the means by which applications communicate with graphical devices (such as monitors and printers) in a device-independent fashion. GDI objects include pens, brushes, bitmaps, fonts, etc. The per-process defaults and limits for the number of these objects varies between the NT and Windows 2000 operating systems. Additionally, the registry entry where the per-process limit can be set varies slightly; however, that key is found in the HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion/Windows hive in both operating systems. Details on GDI limits and the registry entry name are provided in the table below.
Operating System Default Limit Maximum† Registry entry (DWORD)
Windows NT 12288 (0x3000) 16384 (0x4000) ProcessHandleQuota
Windows 2000 10000 (0x2710) 16384 (0x4000) GDIProcessHandleQuota
† Although this is a documented maximum, systems become fairly unstable
after about 15000 GDI handles have been allocated.
Like user object handles, GDI handles can be monitored on Windows 2000 via Task Manager. On Windows NT, GDI handle monitoring within Task Manager is unavailable, so some alternative tool, such as ResourceMonitor, is needed to monitor this resource
The final category of Windows objects is kernel objects, which include system level entities like processes, threads, events, mutexes and files. Each process has a limit of 230 (1073741824) kernel objects.
When a client makes a request to a server, a thread is created for that client, and that thread is generally used to execute the client request. The number of simultaneous client requests therefore has an upper bound equal to the number of threads that can be created within a process.
The number of threads a process can create is also limited by the available virtual memory. By default, when a thread is created, it is assigned one megabyte of stack space, therefore, a process can create at most 2028 threads. Thread stack size can be modified using the EDITBIN utility provided with Microsoft Visual Studio.
Desktop Heap
Desktop heap is a memory resource used to store data relating to graphical objects (such as windows and menus) created within an application. Any executable or library that is statically or dynamically linked with USER32.DLL may make use of desktop heap. Due to the interrelationship of user and GDI objects with the desktop heap, limited heap resources can reduce the effective limits on the per-process maximum numbers of user and GDI objects mentioned earlier in this document.
A desktop heap is allocated for each desktop associated with a window station. Each window station contains a default desktop and other optional desktops that might be created programmatically. In turn, each desktop can contain one or more windows. There is exactly one interactive window station (WinSta0) which is created automatically by winlogon.exe process and includes three desktops: the application (default) desktop, the Winlogon desktop and the screen-saver desktop.
Programs defined as services are also associated with window stations. There are three different options for running services, and each of these options results in a different association with a window station.
The combined size of all desktop heaps has an upper limit of 48MB on Windows NT and 2000. If Terminal Server is executing, the 48MB limit is reduced to 22MB. (On Windows XP the desktop heap is configurable to nearly 500MB). The amount of desktop heap assigned to the interactive window station and to window stations associated with services can be configured via a registry setting. The setting resides in the string value at
HKLM/SYSTEM/CurrentControlSet/Control/Session Manager/SubSystems/Windows
The value is a string that contains the following sequence SharedSection=1024,3072,512 (or perhaps, SharedSection=1024,3072, where the third value is not specified). The first parameter specifies the size of the heap common to all desktops. The second parameter is the size of the default heap for the application desktop (namely, the default desktop in WinSta0). The final parameter specifies the default heap size for desktops created as part of window stations associated with non-interactive services. If this parameter is not specified, all non-interactive services will share the same 3MB heap as the application desktop. If the third value is given, each non-interactive service will be assigned a desktop heap of the specified size. The minimum size for this parameter is 128KB. There is no specific maximum; however, given that the available combined desktop heap allocation can not exceed 48MB, the larger this value the fewer the number of non-interactive services that can be supported.
Big, I know, but there's quite abit of info in there.
John Theal
Physicist/Mathematical Programmer
Digital Immersion Software Corporation
Got CAD?
http://www.presenter3d.com[^]
http://www.merlin3d.com[^]
|
|
|
|
|
Thanks very much John, that's really interesting and helpful.
Dylan
|
|
|
|
|
With regards to the CEdit control, what is the multiline proporty and how do I enable it utilizing VC++6?
Thank you
|
|
|
|
|
The style is ES_MULTILINE . To enable it, double-click the edit box you want to modify, click the Styles tab. See the Multiline checkbox?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Dear All ,
I am developing an application for Windows 2000 using MFC VC++ Version 6.0.
I need to "refresh" the registry whenever somebody opens the registry using Registry editor.
I have done process enumeration to capture the regedit. When ever registry editor opens my program captures this event. After that i need to refresh it.
Is there API to refresh the registry.
Or any other way out to refresh the registry ?
Thankyou.
Regards,
Rohit
|
|
|
|
|
|
I'm not sure what you mean by "refresh the registry." When a change is made to the registry, it is immediate.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Dear DavidCrow,
I mean to say that i want to programmitically refresh the registry.
I have opened the registry and now i want to refresh the registry from my program. ie. Something like sending command from SendMessage.
SendMessage(
HWND_BROADCAST, // handle to destination window
WM_COMMAND, //message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
I donot know what parameters to send WPARAM and LPARAM.
I suppose we can do it from SendMessage.
Regards,
Rohit
|
|
|
|
|
Once you have Regedit's window handle, try:
SendMessage(hWnd, WM_KEYDOWN, VK_F5, 0);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Dear DavidCrow,
Thanks , i used in
SendMessage(WM_KEYDOWN, VK_F5, 0);
SendMessage(WM_KEYUP, VK_F5, 0);
my MFC application and it worked perfect.
........
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
Answer: 5
Am i correct ??
..........
Regards,
Rohit
|
|
|
|
|