|
Do a search for "single instance" and you will get a lot of articles explaining how to.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
I'm doing a cd burning app using IJolietDiscMaster. For some reason it only works when the filename to be burn to the cdrom does not contain a directory.
// IStorage accepts this file
thisisokay.exe
// IStorage rejects this file
\\Directory\\on\\CD\\thisisokay.exe
Also, IStorage rejects creating multiple layers directory
// IStorage accepts this directory
Thisisokay
// IStorage rejects this directory
\\Directory\\on\\CD\\
What is wrong with the naming convention i'm passing into IJolietDiscMaster's AddData()?
Thank you!
|
|
|
|
|
For some reason I'm having a major brain fart.. I am trying to write a simple loop to read 32 chars at a time from a CString and feed them to a function.. Can someone give me some help.
CString strFart = "some really long string over 500 chars";
int nLen = strFart.GetLength();
while((nLen/32) > 0)
{
// Need to feed a TCHAR function
// 32 chars at a time from strFart;
nLen - 32;
}
Should I be using the CString::mid function?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
RobJones wrote:
Should I be using the CString::mid function?
That would work. Did you try it? What happened?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I can get it to work but it looks really ugly.
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
RobJones wrote:
I can get it to work but it looks really ugly.
Run it through the Hollywood translator engine and see if that improves it's looks. Be warned, while it may be better looking, the behavior might seem a bit queer.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
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
|
|
|
|