|
What I really meant was that when you create an MFC project (or ATL -- I wouldn't know since I never create this type of project), VS defaults to using a precompiled header. If you create a console application, precompiled headers are not used by default.
I didn't mean to say that PCH's are specific to MFC. I just usually don't mess with that stuff -- I usually want to get my work done quickly .
--Dean
|
|
|
|
|
Dean Goodman wrote:
I didn't mean to say that PCH's are specific to MFC.
Ok, sorry, then I misunderstood you
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Wouldn't it just be easier to create a .LIB containing the functions and link to it, rather than messing with the source code every time you use it? No hassle, just #include the .h file and set your linker libs line to include the .lib file. Also, one point of maintenance across all projects that use it.
|
|
|
|
|
I have a simple MFC Richedit in my dialog based program.
I don't use unicode programming in my MFC, because I don't know how!
I am writing a utf-8 -> ASCII converter. It gets the unicode text from a richedt window and takes away initial "" characters and the rest must be read as simple ASCII characters...
However when in program, the text from the rich edit is read (that iis in unicode, e.g. سال) based on this program:
void CSecondDlg::OnBUTTONtoUTF()
{
CString text_str1;
GetDlgItemText(IDC_RICHEDIT1, text_str1);
It just shows this "?????", while it should show: "سال"
I really don't know how can I just read such simple string!
Please somebody help me.
|
|
|
|
|
Are you using the UNICODE preprocessor directive?
Does the following produce anything different:
void CSecondDlg::OnBUTTONtoUTF()
{
TCHAR text_str1[128];
GetDlgItemText(IDC_RICHEDIT1, text_str1, sizeof(text_str1));
}
I'm not up on UNICODE either so this is just a guess.
|
|
|
|
|
I am sorry but my project setting is not using unicode. However as you know in win2k you can switch back to the different language and when you run the program, fortunately it shows unicode characters in richedit.
I don't use the UNICODE preprocessor directive and I don't know also what is that! Initially my VC project is a simple MFC. Is it too late to change it to a unicode support? and how can I do that?
WIth the code you wrote, still when I debug my program, for the string which is in unicode, "سال", and is equal to "سال", the GetDlgItemText returns "???"
BTW, I have used GetDlgItemTextW(hwnd,IDC_RICHEDIT2, text_str1, sizeof(text_str1)); instead of GetDlgItemText, where I couldn't initialize hwnd. I used WCHAR_t text_str1[128]; or WCHAR text_str1[128]; and program run but none of these method could help until the richedit return the ascii!
Is there any method than GetDlgItemText to grab any character typed in the richedit one by one?
So this question is still open.
|
|
|
|
|
I am looking for a good search class for c++.
Know of any?
I need to search in CString arrays for certain words.
I am developing in ms vs6.0.
Thanks
Later, JoeSox www.humanaiproject.org
"Imagination is more important than knowledge."
-Albert Einstein (INTP)
|
|
|
|
|
|
DavidCrow wrote:
Use CString::Find().
duh sometimes it's right under your nose.
I might have asked the wrong question.
You don't know of any classes that searches text files too?
I have tried searching but nada.
see, I have text files with sentences but I want to the program to grab only valid sentences. I was going to search the sentences for nouns and verbs(also text files)
Thanks
Later, JoeSox www.humanaiproject.org
"Imagination is more important than knowledge."
-Albert Einstein (INTP)
|
|
|
|
|
Somebody please help me get the number of files that we select using CFile Dialog and by using the OFN_ALLOWMULTISELECT attribute into a variable or something. I can get the path but I want to get the no. of files selected. Please help
|
|
|
|
|
Just parse the returned string.
|
|
|
|
|
// Here you go
void CFoo::OnFileOpen()
{
CFileDialog dlgFile(true, _T("*.txt"), NULL,
OFN_HIDEREADONLY | OFN_FILEMUSTEXIST| OFN_ALLOWMULTISELECT,
_T("Text Files: (*.txt)|*.txt"));
CString title;
VERIFY(title.LoadString(AFX_IDS_OPENFILE));
CString fileNames;
dlgFile.m_ofn.lpstrTitle = title;
dlgFile.m_ofn.lpstrFile = fileNames.GetBuffer(_MAX_PATH * 10);
dlgFile.m_ofn.nMaxFile = _MAX_PATH * 10;
if( dlgFile.DoModal() == IDOK )
{
POSITION pos = dlgFile.GetStartPosition();
while (pos)
{
if( !OpenDocumentFile(dlgFile.GetNextPathName(pos)) )
break;
}
}
fileNames.ReleaseBuffer();
}
Trust in the code Luke. Yea right!
|
|
|
|
|
I am trying to access a pop3 exchange server through MFC using the CSockets class. I am able to connect to the server and get a positive response but when I try to give it the username and password it chokes. I am giving it the user name in the form domain\ntAccount\mailbox. Does anyone have any idea why it doesn't like this??
PLEASE HELP!!!
thanxs in advance
cc
|
|
|
|
|
ibiteu2 wrote:
Does anyone have any idea why it doesn't like this??
Yes, it's not the POP3 standard!
Take a look at RFC1939 which defines POP3
http://www.faqs.org/rfcs/rfc1939.html[^]
A hint:
You start with "USER <username>"
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
The pop3 standard is
USER mailbox
got ok from the server
PASS user password
got -ERR from server
I already tried that and it said I had a bad username or password, any other ideas??? Do I need to encode it or something???
|
|
|
|
|
Your username and/or password is incorrect...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanxs but I figured it out,,, I needed to be using the T2A macro on my strings before I sent them.
Thanxs for the help.
|
|
|
|
|
Hi All
Can anyone tell me the best way pragmatically to respond to a dialog box opened in IE. Like a script error, or connect message ( "work offline") etc, etc.
I have an app that opens IE with a certain html file with a ShellExec... but in an effort to try and keep things looking nice.. I would like to automatically kill any message boxes that might come up... Anyone know who to do this.. or to prevent them from coming up in the first place? I'm most concerned with "connection" messages.. the files that are opened are local and I don't want IE trying to connect to the internet or prompting to for that matter. I have been looking into hooking, but I haven't had much luck at this point.
Thanks for any help,
Rick
|
|
|
|
|
Sounds like you might need to look into Browser Helper Objects (BHO).
|
|
|
|
|
Thanks David,
I'll have a look.
Rick
|
|
|
|
|
Hello,
I need to load libraries using the LoadLibrary function in my project. In the debug version of my project this works really fine, but in release mode nothing works. The app always crashes in release mode when calling a function of the DLL.
I already have read the article "How to survive the release version of your project", but it didn't help me.
Do you have any idea what it could be?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Compile the release version with multithreaded DLL support.
Kuphryn
|
|
|
|
|
Is this a DLL of yours or a third party. Are you linking to the release build of the DLL and if it uses MFC is it compiled to use the same build type (single/multithread/DLL/static etc.) as your app.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I already solved the problem myself. It was very interesting. The Microsoft compiler unloads the DLL before I can call any function of it. It doesn't do that in the debug version. I really don't know why MSCV++ does this... I disabled the speed "optimizations" of the compiler and now it works very well!
Anyway thanks for your help
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Your solution doesn't sound right to me and I think you still have a problem. I've never seen VC++ code or Windows unload a DLL for no good reason. Are you using LoadLibrary() to load the DLL or normal linking.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|