freter
asked on
URL Monikers
Has anyone got a clue how to write an URL Moniker?
I am trying to use the Intenet Explorer to display HTML files that I pull out of a OLE2 structured storage file. Microsoft does s.th very similar in their Infoviewer 5 (comes with the MSDN): If you have the MSDN installed an type something like
mk:@ivt:activex/start.htm
IE will display the file start.htm from the knowledgebase file activex.ivt.
I already have found out that "ivt" in the above URL is registered in the registry and seems to be an URL Moniker. And from the MSDN I found out that I need to write an URL Moniker server.
Before I waste my time re-inventing the wheel: has somebody out there already written one?
Best regards,
Freter
I am trying to use the Intenet Explorer to display HTML files that I pull out of a OLE2 structured storage file. Microsoft does s.th very similar in their Infoviewer 5 (comes with the MSDN): If you have the MSDN installed an type something like
mk:@ivt:activex/start.htm
IE will display the file start.htm from the knowledgebase file activex.ivt.
I already have found out that "ivt" in the above URL is registered in the registry and seems to be an URL Moniker. And from the MSDN I found out that I need to write an URL Moniker server.
Before I waste my time re-inventing the wheel: has somebody out there already written one?
Best regards,
Freter
ASKER
Hm...
I have seen that before, but it doesn't help me.
I need a DLL that can be invoke by Intenet Explorer, just like the ivtmon.dll that is referenced by the string "ivt" in the URL depicted in my question.
I have seen that before, but it doesn't help me.
I need a DLL that can be invoke by Intenet Explorer, just like the ivtmon.dll that is referenced by the string "ivt" in the URL depicted in my question.
Sorry, I can't help you with this issue.
Yep, did that one some time ago. It was a pain in the ass to get all the information, because it is only well documented how to *use* monikers, but not how to *write* them.
I built a sample moniker that simply displays HTML files from a file system or an error message if the file was not found. E.g. you set the moniker root to
c:\hello
and type in IE
mk:@slashmoniker:/my/baby. html
it would load c:\hello\my\baby.html
Sure you could dispatch any path to anywhere.
You'll get the moniker code for 300 points, it took me about 5 weeks to figure all the details out.
Slash/d003303
I built a sample moniker that simply displays HTML files from a file system or an error message if the file was not found. E.g. you set the moniker root to
c:\hello
and type in IE
mk:@slashmoniker:/my/baby.
it would load c:\hello\my\baby.html
Sure you could dispatch any path to anywhere.
You'll get the moniker code for 300 points, it took me about 5 weeks to figure all the details out.
Slash/d003303
ASKER
Slash/d003303:
One question before I increase the points for you:
Is your moniker able to provide the embedded images of the html page out to explorer?
Freter
One question before I increase the points for you:
Is your moniker able to provide the embedded images of the html page out to explorer?
Freter
Yo,
all embedded objects (images, plug-in codbases, etc.) that have a relative path are combined to a full qualified path by IE before they are requested. E.g. if <IMG SRC="/images/help.gif"> is part of a page provided by my moniker, IE would create the full referenced path mk:@slashmoniker:/images/h elp.gif.
Because IE builds full referenced URLs compilant to RFC 2068, you can also prefix the moniker root like M$ does. The "mk:@slashmoniker:" identifies the protocol (equi to http:), then comes the "//(server)" part, then a directory/file path (you may omit the server part). So if the page location of the above example would be mk:@slashmoniker://MyDatab ase/about. html, IE would refer the picture path to mk:@slashmoniker://MyDatab ase/images /help.gif.
This gives you flexibility on interpretation of the URL and organization of your database archive. E.g. you could also provide mk:@slashmoniker:MyServer/ /MyDatabas e/about.ht ml as a page location, the image would be in mk:@slashmoniker:MyServer/ /MyDatabas e/images/h elp.gif. Or mk:@slashmoniker:MyDomain: MyServer// MyDatabase /about.htm l, etc.
You can do anything you like and easily run a website fromout a database.
Hope this answers your question.
Slash/d003303
all embedded objects (images, plug-in codbases, etc.) that have a relative path are combined to a full qualified path by IE before they are requested. E.g. if <IMG SRC="/images/help.gif"> is part of a page provided by my moniker, IE would create the full referenced path mk:@slashmoniker:/images/h
Because IE builds full referenced URLs compilant to RFC 2068, you can also prefix the moniker root like M$ does. The "mk:@slashmoniker:" identifies the protocol (equi to http:), then comes the "//(server)" part, then a directory/file path (you may omit the server part). So if the page location of the above example would be mk:@slashmoniker://MyDatab
This gives you flexibility on interpretation of the URL and organization of your database archive. E.g. you could also provide mk:@slashmoniker:MyServer/
You can do anything you like and easily run a website fromout a database.
Hope this answers your question.
Slash/d003303
ASKER
Slash:
Ok. I'll increase the points.
Freter
Ok. I'll increase the points.
Freter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
An example to register a moniker called by mk:@HelloWorld
// BOC //
REGEDIT4
[HKEY_CLASSES_ROOT\HelloWo rld]
@="Hello World Moniker"
[HKEY_CLASSES_ROOT\HelloWo rld\CLSID]
@="{556F12A1-DE94-11D1-B4E A-0000E82D 8A65}"
[HKEY_CLASSES_ROOT\HelloWo rld\CurVer ]
@="HelloWorld.1"
[HKEY_CLASSES_ROOT\HelloWo rld.1]
@="Hello World Moniker V1"
[HKEY_CLASSES_ROOT\HelloWo rld.1\CLSI D]
@="{556F12A1-DE94-11D1-B4E A-0000E82D 8A65}"
[HKEY_CLASSES_ROOT\CLSID\{ 556F12A1-D E94-11D1-B 4EA-0000E8 2D8A65}]
@="Hello World Moniker V1"
[HKEY_CLASSES_ROOT\CLSID\{ 556F12A1-D E94-11D1-B 4EA-0000E8 2D8A65}\In procServer 32]
"ThreadingModel"="Apartmen t"
@="D:\\Program Files\\MyMoniker.dll"
[HKEY_CLASSES_ROOT\CLSID\{ 556F12A1-D E94-11D1-B 4EA-0000E8 2D8A65}\Pr ogID]
@="HelloWorld.1"
[HKEY_CLASSES_ROOT\CLSID\{ 556F12A1-D E94-11D1-B 4EA-0000E8 2D8A65}\Ve rsion]
@="1"
[HKEY_CLASSES_ROOT\CLSID\{ 556F12A1-D E94-11D1-B 4EA-0000E8 2D8A65}\Ve rsionIndep endentProg ID]
@="HelloWorld"
// EOC //
Slash/d003303
// BOC //
REGEDIT4
[HKEY_CLASSES_ROOT\HelloWo
@="Hello World Moniker"
[HKEY_CLASSES_ROOT\HelloWo
@="{556F12A1-DE94-11D1-B4E
[HKEY_CLASSES_ROOT\HelloWo
@="HelloWorld.1"
[HKEY_CLASSES_ROOT\HelloWo
@="Hello World Moniker V1"
[HKEY_CLASSES_ROOT\HelloWo
@="{556F12A1-DE94-11D1-B4E
[HKEY_CLASSES_ROOT\CLSID\{
@="Hello World Moniker V1"
[HKEY_CLASSES_ROOT\CLSID\{
"ThreadingModel"="Apartmen
@="D:\\Program Files\\MyMoniker.dll"
[HKEY_CLASSES_ROOT\CLSID\{
@="HelloWorld.1"
[HKEY_CLASSES_ROOT\CLSID\{
@="1"
[HKEY_CLASSES_ROOT\CLSID\{
@="HelloWorld"
// EOC //
Slash/d003303
ASKER
Thanks a lot, Slash!
This is exactly what I have been looking for. It works perfectly for me.
I had only little time this morning to look through all of the code, so maybe I will have some questions regarding the source the next few days.
This is exactly what I have been looking for. It works perfectly for me.
I had only little time this morning to look through all of the code, so maybe I will have some questions regarding the source the next few days.
Ok, no prob.
ASKER
Hi Slash, still listening on this thread?
I've got some probs with the Moniker. When I use it with IE 4.0, everything is just fine, but when running in IE 3 (no matter which build #), it just reports an access violation in mshtml.dll after loading the 4th unique file.
I woul be *very* glad if you could spend a minute or two helping me with this bug!
Freter
I've got some probs with the Moniker. When I use it with IE 4.0, everything is just fine, but when running in IE 3 (no matter which build #), it just reports an access violation in mshtml.dll after loading the 4th unique file.
I woul be *very* glad if you could spend a minute or two helping me with this bug!
Freter
Yo,
still listening. I just tried over and over, no problems.
So, do you still run the moniker in file-access mode or have you already bound it into the OLE structured storage ? If you are still working in a file system, could you send me an archive with these files ?
Also, take a look at the debug file and see where the moniker crashes. This is a very helpful information.
Slash/d003303
still listening. I just tried over and over, no problems.
So, do you still run the moniker in file-access mode or have you already bound it into the OLE structured storage ? If you are still working in a file system, could you send me an archive with these files ?
Also, take a look at the debug file and see where the moniker crashes. This is a very helpful information.
Slash/d003303
ASKER
Hm.
I used the code you provided here. Then I put five different really plain HTML files in the root and called them via the moniker. The important thing is: the fifth unique file will cause a crash. If you try to load files that are not unique (like call only two files alternatingly), no crash will occur.
This problem arises as well with the code that reads from a file system as well as with my code that binds to OLE Structured Storage. And: it only occurs with IE3x, *not* with IE4x!
I don't have the code here today, but I can send it to you tomorrow, together with the debug.txt.
Later
Freter
I used the code you provided here. Then I put five different really plain HTML files in the root and called them via the moniker. The important thing is: the fifth unique file will cause a crash. If you try to load files that are not unique (like call only two files alternatingly), no crash will occur.
This problem arises as well with the code that reads from a file system as well as with my code that binds to OLE Structured Storage. And: it only occurs with IE3x, *not* with IE4x!
I don't have the code here today, but I can send it to you tomorrow, together with the debug.txt.
Later
Freter
Ok, awaiting your mail :)
d003303,
Do you have a similar example that takes advantage of the IBindStatusCallback interface?
Do you have a similar example that takes advantage of the IBindStatusCallback interface?
cdcoppola,
sorry, haven't done that yet.
sorry, haven't done that yet.
http://www.calm.hw.ac.uk/davidf/papers/htmldlg.htm