|
ROFLMAO....
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I would think it would look something like this:
CString strFart =
_T("123456789ABCDEFGHIJKLMNOPQRSTUVW123456789ABCDEFGHIJKLMNOPQRSTUVW123456789ABCDEFGHIJKLMNOPQRSTUVW123456789");
int pos = 0;
while( pos < strFart.GetLength())
{
CString temp = strFart.Mid(pos, 32);
someFunc( temp);
pos += 32;
}
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I ran into something interesting while I was sifting through code at work.
Instead of seeing a typedef for a pointer like this:
typedef CClass* CClassPtr;
I found that they use:
typedef CPtr<CClass> CClassPtr;
Why the difference? Is one method better than another? I'd ask someone around here, but since the code is so old, most of the people who wrote it are not still around.
Any ideas?
-- Adam
"If you can't beat your computer in chess, try kickboxing"
|
|
|
|
|
are you sure that CPtr is not a typedef for something else ?
maybe CPtr is a void* ? which would be bac for C++ me think.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
will appreciate if tell me how to find ASCII strings from middle of a file.txt
really thank you
|
|
|
|
|
Open the file, read it completely into a buffer, convert the buffer into a CString , and use it's powerful searching functions to find what you need.
An alternative is to open the file, and use the file pointer to check adjacent characters if they match your search criteria. This is a LOT slower way code-wise, but uses less memory, as no extra CString objects are needed.
If you can't use MFC, then use normal string searching functions such as strspn on the buffer. Do not search through the direct file pointer (although files may be considered as buffers), because this will lead to problems if different file systems are used.
For reference, see MSDN or any C++ book for functions like fopen , fread and so on.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi there,
Can someone let me know what is the valid range for user messages used by controls/objects (WM_ ) ?
My MS VC++ Help refuses to run, somehow, and I don't have any means of finding out the answers I need... so if someone could please drop me a line, it would be much appreciated.
Thank you.
David
PS: Also, could you take a look at the thread "Making objects talk with each other?", which I have also started, and let me know of what you think?
|
|
|
|
|
|
( lets see if CP will allow me to answer .... )
you can use RegisterWindowMessage to create a unique message ID.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Thank you all for the great links you've supplied me with.
David
|
|
|
|
|
Hi,
I'm using PreTranslateMessage to intercept the RETURN key on a CEdit control in a modeless dialog. To prevent the RETURN key from triggering the default button I've made the CEdit control multiline and made it "Want Return".
On PreTranslateMessage I SetFocus() on the parent window. This also triggers the CEdit KillFocus() which processes the edited text.
However, this produces a Windows error beep. Perhaps this is because the edit control is out of focus before the keydown message reaches translation. How can I avoid this?
Many thanks,
Simon
|
|
|
|
|
it might sound like a clunk but the easiest way i ever found of doing what u are trying to do is to have another button on the dialog that is hidden and set that to the default button ... of course its handler does nothing
"there is no spoon" biz stuff about me
|
|
|
|
|
Is it possible to port C++ applications using MFC to machines that do not have C++ installed by transporting specific dll's.
|
|
|
|
|
TallAndyB wrote:
Is it possible to port C++ applications using MFC to machines that do not have C++ installed by transporting specific dll's.
Have a read of for VS.NET[^]
or
here for VC6[^]
Michael
CP Blog [^]
|
|
|
|
|
porting ? or compiling ? or executing ?
on same OS ? different OS ?
I would say no at first, but I'm mut sure what you want to do.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Did you really mean port? I think from your question you ment something completely different.
Port means take your application running on Windows (or any other computer platform), and make it run on something else like the Mac. (UNIX, VMS, mainframe, cell phone). If this is what you ment, not easially, you will need a C++ compiler that targets that computer (it doesn't have to run on that computer, just know how to compile for that computer), and a library that runs on that platform. Attempts have been made to port MFC to other systems, you can google for them, but most have had little success. I'm told that it is easy to port MFC to wxWidgets, but your milage will varry.
If you ment you want to run your MFC app on a different windows machine, then of course you can do this. Start reading up on installers, (like installshield) and make one work for you. You can create one from scratch, or use one to help you out. Many people have done this with MFC (not me though) so it should be easy to get help once you ask the right question.
|
|
|
|
|
OK, If I have read correctly to be able to take a single executable file from the development environment and us it on another Windows based machine I need to statically link with the MFC dlls. I appreciate that this will make it a more cumbersome .exe but it keeps my customer happy. As a final check I will not need any additional dlls to permit database access since I accomplich that using the MFC CRecordset classes.
Thanks for the pointers as to where to look and correcting my loose terminology.
AndyB
|
|
|
|
|
Hi,
i am using crystal reports 9.2.xxx that comes with visual studio 2003,
we are developing an application with a maximum of 20 concurrent users
i was wondering the following:
(1)what are the licensing and features limitations of this version of crystal reports?
(2)are we free to distribute to as many users as we like royalty free?
Thanks In Advance
|
|
|
|
|
How can i diable / enable any tabpage in a Tab control?
any help?
Tariq
|
|
|
|
|
Hi everyone,
I have a byte array of 1000 bytes and it is supposed to have a static content. What I want to do is put a whole string of hex values into it all at once rather than do something like:
byte[0] = 0x95;
byte[1] = 0x78... and so on..
Is it possible to initialize it at once with all the content?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
You can set the values when you declare byte
char byte[1000] = {0x95, 0x78, ...};
NOTE, ... means and so forth for all 1000 bytes.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
char byte[1000] = {0x95, 0x78, ...};
NOTE, ... means and so forth for all 1000 bytes.
That sounds like real fun!
better him then me
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Pankaj
Without struggle, there is no progress
|
|
|
|
|
V. wrote:
That sounds like real fun!
Um quite!, not the most productive thing to do either
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|