|
Trollslayer wrote:
For rich text it's a bit more difficult
How so? SetWindowText() also works for rich edit controls.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
That works fine until you reach the buffer limit, tried it a couple of weeks ago.
After that you have to use StreamIn with a callback.
Elaine
The tigress is here
|
|
|
|
|
Trollslayer wrote:
That works fine until you reach the buffer limit...
Which is what?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
It isn't specified, but in my was case just over 4KB (4196 bytes if i remember correctly). This is the buffer size passed over to the StreamIn callback function. I assume that WriteWindowText uses the same internal mechanism.
The tigress is here
|
|
|
|
|
You obviously did something wrong. A regular edit control can handle 64KB of text. A rich edit control can handle several MB of text. I just tried it with a 791KB text file (it's the biggest one I could find within a few seconds) and it worked fine.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Trollslayer wrote:
Which version ?
I am using VC++ v6.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks for tha reply..It is simple edit box...not rich text..
but how I get the content of text file in cstring..
Thanks a lot
|
|
|
|
|
|
Use CEdit::GetWindowText() . One of them takes a reference to a CString object.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
|
Hello!
Question about UDP connections.
Is there a way to determine the destination port/address from an(y) active open UDP socket on my system?
Maybe a workaround or simple solution without using winpcap.dll.
<view next="">
|
|
|
|
|
I'm not sure but google on raw sockets I think you will find some info...
Well... I am a beginner ...
|
|
|
|
|
|
Hello,
For some reason when trying to compile, I keep getting error that TrackMouseEvent is an undeclared identifier. The TRACKMOUSEEVENT struct, however, compiles without problem. I have user32.lib imported in my project settings and I have the dll, and I have winuser.h included in my project (along with windows.h). I am running the MS platform SDK from Feb 2003.
Help?? What could be wrong?
Thank you
|
|
|
|
|
Got to command prompt.
Dump the exports from user32.dll and see if TrackMouseEvent is in there.
DumpBin /Exports User32.Dll
If not, then heed this warning and adjust your code and project accordingly:
Note The _TrackMouseEvent function calls TrackMouseEvent if it exists, otherwise _TrackMouseEvent emulates TrackMouseEvent. The _TrackMouseEvent function is in commctrl.h and is exported by COMCTRL32.DLL.
|
|
|
|
|
First of all I must admit, I am not a very experienced COM programmer.
But I managed to create my own COM automation server (exe). It runs well and can be used by clients on my development system. Now I am trying to package the server for installation on other systems.
I think I have properly created registry entries for CLSIDs etc. - at least to the best of my knowledge. Nevertheless, when a client calls "CreateDispatch" the instantiation of the server application fails. CreateDispatch returns "Server execution failed." When looking at the event viewer, I see the following message:
Source: DCOM
Category: None
Type: Error
EventID: 10010
Description: The server {CLSID} did not register with DCOM within the required timeout.
Any ideas? Am I missing something?
Comments greatly appreciated.
Jochen
|
|
|
|
|
Hi all,
i am working on an application that interacts with a print driver. However, when i use the Win32 API calls (EnumJobs, etc.) to determine what file was printed and where it was located, i can only get the file name (not the path). In some cases, i will need to do some examination of the contents of a file - so i need the path. Does anyone know how to obtain such a thing (i fear it doesn't exist)?
|
|
|
|
|
the_grip wrote:
Can the path to a file be determined from a print job?
I don't think so. When you print a file, you do so with some application that reads the file, make API calls to create a print document with some name, draw some content in it, and ends the operation. You then can see the print queue in the operating system, but the OS knows nothing about whether what it has to print was based on a file, its location, or its content. The print document may have the same name as some file, but for the OS it's just a name and nothing else.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
can you just write a class to manipulate bits in an int, so it would contain 32 bool values instead of wasting that one number for 1 or a char for 8 values or double for 64 diff. values, wouldn't this be a better solution?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
|
|
why don't you do it yourself ? is it so hard ?
look at this[^]...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Back in the old days of C when every byte of memory counted, we used to define a structure of bits so that it would be clearly referenced in code and only use a byte of memory. So, to declare six flags in a byte, you would define a struct like this:
typedef struct _tagBitFlags
{
unsigned char Flag1 : 1;
unsigned char Flag2 : 1;
unsigned char Flag3 : 1;
unsigned char Flag4 : 1;
unsigned char Flag5 : 1;
unsigned char Flag6 : 1;
unsigned char unused : 2;
} BitFlags;
Then to access the flags, you could write something like this:
if (BitFlags.Flag1)
printf("Flag1 is set");
else
printf("Flag1 is cleared");
Note that the value you can set a flag to must be in the bit range that the structure member can hold. This means that if, as in the above example, Flag1 is declared as one bit, it can only hold the values 0 and 1, whereas unused is declared as two bits and can be assigned the values 0, 1, 2, or 3.
Hope this doesn't date me too badly....
onwards and upwards...
|
|
|
|