|
What I plan to do is to creat a managed app and perform the nessary sql to build a file containing the data and execute this managed app passing a report number. The approiate report will then be created using the file built and display the report. Do you have a better idea I will look into it.
|
|
|
|
|
Hi,
My software is a highly interactive application that uses lots of windows with sub windows (a few hundred windows is not an exception). Not all windows are visible at the same time, but at certain moments the user must be able to quickly switch to another window so I keep the relevant windows invisible and make them visible when needed.
Due to the structure of the software, it is not possible to decrease the number of windows.
Nevertheless I have succeeded to decrease the used pens, brushes, .... Cleaning up the used menu handles and icon handles is planned for the medium- to long-term.
To prevent my application from starving the available GDI and/or User Handles, I want to check the amount of free GDI/User handles (both for the process as for the global system).
I found out that there is a function (GetGUIResources) where you can get the number of used resources, but there does not seem to be a function to get the number of free resources?
Does such a function exist or is there another way of obtaining that value?
Or is there a simple trick to minimize the number of used resources (or to increase the number of available resources)?
Thanks in advance.
Enjoy life, this is not a rehearsal !!!
|
|
|
|
|
Simple Trick - Install video card with more Video RAM.
Avoid using DDB, use DIB bitmaps isntead (they can reside in regular memory).
'Share' handles to objects - instead of duplicating a 1-pixel wide black pen 200 times, etc.
No shirt, no shoes, no brains, no service.
|
|
|
|
|
I'm developing a Win32 Console application with Visual C++ 6.0.
When I've created the project, I've addeed the MFC support.
All MFC classes works fine in my project except CSocket.
I can create a new instance of that class (operator new),
but when I call the Create metod, this call generates an exception
in the method AfxRegisterWndClass.
Can someone tell me how to solve this problem ?
Thanks a lot to everyone!
|
|
|
|
|
Include afxsock.h Maybe it'll help...
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
I've already done it !!!
|
|
|
|
|
I may be wrong, but I am not sure why this function will even be called.
AfxRegisterWndClass().
MSDN says:
The Microsoft Foundation Class Library automatically registers several standard window classes for you. Call this function if you want to register your own window classes
It could be some windows you are creating in the console app.
this is this.
|
|
|
|
|
I don't directly call this method.
It is called by the method Create of the CSocket class
(or by the other functions called by Create).
|
|
|
|
|
I think you may already have done it, but did you call AfxSocketInit() before creating the socket ?
If yes, then it is some other error.
And by the way, CSocket does create a window "Socket Notification Sink". (just seen it)
this is this.
|
|
|
|
|
Hi,
You probably forgotten to call AfxSocketInit(); ;
This initializes all the classes for socket support
codito ergo sum
|
|
|
|
|
Greetings,
The CSocket class uses a window to manage the socket(timers and messages);
It sounds like it is having problems creating the socket window; I cannot recall if it uses the main window of the current app thread or creates its own;
1. can you create windows in a console app?
2. use the find in files function and search the source code for the create function for Csocket then breakpoint and find the problem;
|
|
|
|
|
Hello,
Short question:
How to get physical drive number, where specify volume letter i.e. C: is assigned ?
any idea ?
Mila
|
|
|
|
|
int a;<br />
a = PathGetDriveNumber("c:\\");
You also need to include "shlwapi.h" and link with shlwapi.lib
this is this.
|
|
|
|
|
Not that fast
This function returns ... quote: "0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise"
In fact, returned value corresponds an logical drive number and doesn't correspond with physical drive number.
Mila
|
|
|
|
|
I remembered it the moment I had hit the submit button.
You could still get all the drives in the system, and check if it is a logical or physical drive, maybe.
this is this.
|
|
|
|
|
I have an input stream which consists of a length marker and then data of the specified length, there can be any number of blocks and of any size. I am currently waiting until the complete data has been sent and then parsing but I now need to do it as the data comes in, any ideas how I might go about it, the method I have is:
BOOL DataRead(string szRequest)
The data is passes in via szRequest and returns TRUE when I reach the end of the data input, I need to parse the blocks and add to some sort of buffer if possible.
|
|
|
|
|
What I would do in this situation is:
Keep a static buffer (TCHAR m_Buffer[20000] etc) large enough for the incoming data. (Maximum size block should fit).
Read the incoming data, parse it for the required information. If the needed data is found, then use it, and discard the buffer; Else if needed data is not found, then save it to the static buffer , and add the incoming data to it at the end, and parse it again, and continue the cycle.
this is this.
|
|
|
|
|
Thanks for the reply, I have started to implement what you suggested but I cannot have a static buffer because the incoming data could be anything from 1k to 2GB, I have tried appending the data to the string with += but which seems to work well with the parse routine I have but I get memory errors at random points in the prog. I realise it is because I should not be appending to the string but what are my options to get round this?
|
|
|
|
|
Well, if all you need to do is parse the data, and extract the info, then create a buffer large enough, and append data to it when it comes, but make sure that it does not overlap the size of the buffer. If it comes to being full, then empty it, or save it to a file etc.
I dont think I have made it much clearer for you, but anyway.
this is this.
|
|
|
|
|
Hi,
I am creating a shell extension and having some problems in Dropping a file on the extension.
My extension actually communicates with an FTP server and whenever a file is dropped in it, I have to copy the file onto the FTP server. This process is working fine in a single threaded component. But I would like to show a progress dialog for the same and I am doing the file copy in a background thread and showing a modal dialog in the main thread.
The problem is IDataObject is created in the main thread and I am passing a reference of the same to the background thread. When I invoke the GetData(..) method of IDataObject, its returning failure. But when the same in inoked from the main thread, I am getting the results.
The extension runs in an Aprtment threading model.
Any help would be appreciated...
Thanks and Best Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
It sounds like you're not marshalling the interface across apartments.
|
|
|
|
|
Hi Jon,
You were right.
I was not marshalling the interface across apartment boundaries. I used CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream methods and was successfull.
Thanks for the support.
Best Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi! anyone who knows how to use CTreeCtrl's tvs_haslines in CListCtrl? actually, im using custom control - its a list control with first column like a tree control but actually just modifying the item using LVITEM attributes. It works ok but I cannot add the tvs_haslines property.
Please help.
|
|
|
|
|
What have you tried ? What goes wrong ?
~RaGE();
|
|
|
|
|
Hi fellow CPians,
In which dll or executable can I find the icons representing the two arrows IE uses in his toolbar to browse on the next or on the previous page ? it does not seem to be in shell32.dll, and i think it is the same image used twice, one is simply reversed.
Thanks
~RaGE();
|
|
|
|