|
Yeah, but the user has to have RichEdit 2.0 on the system, so make sure you program a fail safe... most will have it but all it takes is that one who doesn't. But any way here you go.
<br />
<br />
HANDLE m_hRichEdit2 = LoadLibrary(_T("RICHED20.DLL"));<br />
if (m_hRichEdit2 == NULL) <br />
{ <br />
AfxMessageBox("Failed to initialize rich edit 2.0", MB_OK | MB_ICONEXCLAMATION); <br />
return FALSE; <br />
} <br />
<br />
CRichEditCtrl m_ctlEdit;<br />
if (m_hRichEdit2 != NULL)<br />
m_ctlEdit.SendMessage(EM_AUTOURLDETECT, (WPARAM)TRUE, 0); <br />
if (m_hRichEdit2 != NULL)<br />
m_ctlEdit.SendMessage(EM_AUTOURLDETECT, (WPARAM)FALSE, 0);<br />
<br />
<br />
if (m_hRichEdit2 != NULL)<br />
{<br />
::FreeLibrary(m_hRichEdit2);<br />
} <br />
<br />
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
Coool, Thanks for sample
I have just a little question about your code ...
So, By your source code, if i have a URL address, RichEdit box make link for it, automaticly ... right ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Yup! Just like in Outlook or Outlook Express
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
Ok, Thanks aloooot for your helps
With Best Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You bet!
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
Hello again Mr.Matthew,
I'm sorry but i have other little problem ...
I used of your source code for using links in a rich edit box ...
But there is a problem, your code just change the mouse arrow and text case to link ... but when i click on that it doesn't work
I want to when i click on a link in rich edit, my program open IE browser ...
How can i do that ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Just a sec... looking at my code.. I could have forgotten something. Be back in a minute
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
DUH!!! I forgot to tell you to subclass it. There are other ways to do this, but this is the easiest in my opinion.
BOOL CMyRichEdit::PreCreateWindow(CREATESTRUCT& cs)
{
// Make sure Rich Edit 2
cs.lpszClass = "RICHEDIT20A";
return CMyRichEdit::PreCreateWindow(cs);
}
See if that completes it, sorry about that.
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
|
Hello again dear Matthew,
Sorry for delay ...
I add this code, too but it doesn't work
BOOL CMyRichEdit::PreCreateWindow(CREATESTRUCT& cs)
{
// Make sure Rich Edit 2
cs.lpszClass = "RICHEDIT20A";
return CMyRichEdit::PreCreateWindow(cs);
}
What's wrong ?
Can you send your project for me ?
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Unfortunately my project is a product, so I really can't send that to you. That is really all that I did to implement it, don't know how you are doing it exactly.... but if you want to email me your rich edit class I can compare it to mine.... I looked at my code last night after the post... and that is really all I had. But send me some code and I can compare it.
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
Mr.Matthew, I sent a mail for you
Please check it as soon as possible
With Best Regards
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I sent you the fixed project, you never loaded the DLL, which is needed.
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
It doesn't work again
Please check my mail
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
How do I read the mime settings for an extension and then retrieve the icon path and index? Can this be done efficiently?
Also. How do I get the path of the system directory. For example mine is C:\Windows\System32. I want my app to be able to adjust for varying installations.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
For the mime settings I believe you have to read them from the registry.
And the simplest way to obtain a path to the windows dir is GetWindowsDirectory() and GetSystemDirectory() or just use ExpandEnvironmentStrings()
int x=1, y=5;
x^=y^=x^=y;
<a href="http://www.codeproject.com/tips/StupidXORTrick.asp" target="_blank">ClickHereForHelp();</a>
|
|
|
|
|
Andreas Saurwein wrote:
GetSystemDirectory()
Thanks, thats what I needed
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179
"You can't seriously believe that you could get away with suing someone over quoting text from a message posted in a public forum, can you?" - John Simmons
|
|
|
|
|
If you delete a record from a database, do the remaining records arrange themselves so that if #5 was deleted, #6 now becomes the new #5 etc?
Or does some other type of reordering hapen? If so what control do we have over this ordering?
|
|
|
|
|
Depends of the primary key of the table....
I believe that that will happen.
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks. There is no primary key though....I am doing PutAbsolutePosition(index) and deleting them.
If there are none left, and I try to delete one, I am sure it will crash. so how would I test my delete condition? Check recordcount before each delete?
Important question: ReQuery(-1)
Do I have to requery? I feel that I should so that the deleted record vanishes (thats what I read anyways). Whats your opinion?
thanks,
ns
|
|
|
|
|
It depends. If you are using CRecordset and ODBC then they are not arranged. You sould use Move(0) to refresh current row. Also you can test if the row has beem deleted with the IsDeleted method.
Best regards,
Alexandru Savescu
|
|
|
|
|
When I copy a folder with my source and binary files to a different folder, it is necessary to re-build the whole project, even though it was
built successfully at a previous location. Why is that? How can I avoid it when moving projects do a different location on a hard drive?
Thanks,
Michael
|
|
|
|
|
Because Microsoft probably does something like taking the checksum of the path and file, so that if there any changes to the file or location... most likely it will need to be recompiled. Since you are moving all of your files, all files have changed. Cheers!
<><><><><><><><><><><><><><>
Matthew R. Miller
mattrmiller@computersmarts.net
www.computersmarts.net
|
|
|
|
|
No, MSDEV will not recompile, as it simply does a touch (Unix word for last modified date comparison).
And I swallow a small raisin.
|
|
|
|
|
If any of your projects create COM objects, the build process automatically registers them. The registration process places entries in the registry that associate the class and interface ID's with your object, and the location of that object's code on disk. Therefore, when you move the object's code to a different place, Windows can no longer find it. Rebuilding the project re-registers the objects and fixes the problem.
Gary R. Wheeler
|
|
|
|