Skip to content

Search Results

Keyword: comdoc

Today I thought about my problem of having my old site still 1/2 alive next to my new WordPress site. On the internet there are still a couple of links that directly point to various files that aren’t used anymore. Wouldn’t it be nice if you could just remove all those old files and still come up with the right WordPress page?

I just made this possible by changing my custom 404 urlrewrite page. This is what my page now does:
1. get whatever is after the domain name from the url and open the wordpress index.php with that part behind it.
2. if the result is not a regular page, then get the words from the url and perform a search.

for instance the link http://evict.nl/error will search for the word error because there is no page named error. One of my old pages http://evict.nl/comdoc/default.asp will now search for ‘comdoc’ and still find the comdoc content (below this post).

Here is the complete sourcecode of my error.asp

<%
Response.Buffer = True
Response.Status = "200 OK"
Response.CharSet = "UTF-8"
Session.CodePage = 65001
myurl = QueryPath()
content = ReturnPage(myurl)
notfound = "Sorry, but you are looking for something that isn't here. You can search again by using the form on upper right of the page..."
if instr(content, notfound) > 1 or len(trim(content)) < 1 then
	Response.Write ReturnPage(SearchQueryPath())
else
	Response.Write content
end if
Response.End()

Function QueryPath()
	' The WordPress location
	w = "http://" + Request.ServerVariables("HTTP_HOST") + "/index.php"
	' Take whatever is after the host name
	q = mid(request.QueryString, instr(request.QueryString, Request.ServerVariables("HTTP_HOST")) , 999)
	' Take the part behind the first /
	QueryPath = w + mid(q, instr(q, "/") , 999)
End Function

Function SearchQueryPath()
	' The WordPress location
	w = "http://" + Request.ServerVariables("HTTP_HOST") + "/index.php?submit=Find&s="
	' Take whatever is after the host name
	q = mid(request.QueryString, instr(request.QueryString, Request.ServerVariables("HTTP_HOST")) , 999)
	' Take the part behind the first / and remove all / and \
	c = LCase(replace(replace(mid(q, instr(q, "/") + 1 , 999),"/"," "),"\"," "))
	' Remove the default.asp or .asp or .
	SearchQueryPath = w + replace(replace(replace(c,"default.asp",""),".asp",""),"."," ")
End Function

Function ReturnPage(myPage)
    on error resume next
	br = Request.ServerVariables("HTTP_USER_AGENT")
	set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
	xmlhttp.open "GET", myPage, false
	xmlhttp.setRequestHeader "Content-Type", "text/HTMI"
	xmlhttp.setRequestHeader "CharSet", "UTF-8"
	xmlhttp.setRequestHeader "User-Agent",br 	' Required for the WPtouch iPhone Theme
	xmlhttp.send ""
	if err.number <> 0 then
		Response.Status = "404 Page not found"
		ReturnPage = "404 Page not found"
	else
		ReturnPage = xmlhttp.responseText  'responseBody
	end if
	set xmlhttp = nothing
End Function
%>
Share

ComDoc

Jan 4

If you have a OLE/COM component (dll or ocx) and you want to write documentation for it, then ComDoc is the tool for you.

ComDoc will use the component itself for building the structure of the documentation and can also make use of the descriptions that are part of the component.

For the publication ComDoc uses the DBPublisher object. Because all the publications are based on templates the outcome is 100% customizable.

There is also support for compiling the HTML help using the Microsoft HTML help workshop

You can download a 6.1MB installable file by clicking here and the source code from here.

comdoc 1
Share

In the period 2000 – 2004 I have done a lot of Visual Basic 6 programming which also resulted in a nice collection of reusable code. I did my best to make this code as generic and reusable as possible. Below you can see a short explanation of those portions plus a download link for the source code.

  • Automating Internet Explorer You can open and fully control a Internet Explorer window. Unless you want to know how to hook into IE, i can advice using WatiN instead of this library.
  • Client Server communications This library let you create a client or a server in an easy to use object oriented way. By calling the wininet.dll directly instead of using the winsock control this dll excells in performance and memory usage.
  • ComDoc If you have a OLE/COM component (dll or ocx) and you want to write documentation for it, then ComDoc is the tool for you. ComDoc will use the component itself for building the structure of the documentation and can also make use of the descriptions that are part of the component. For the publication ComDoc uses the DBPublisherobject. Because all the publications are based on templates the outcome is 100% customizable.
  • DBPublisher is a template driven database publication tool. with support for email and ftp.
  • Encryption is a very easy to use ActiveX dll for encrypting and decrypting data. It can be used from almost any programing language. It Has support For RC2, RC4, DES, Triple DES and Triple DES 112.
  • Error handling You can bennefit a lot if you use a generic method for your error handling in your application. Using line numbers in VB is undervalued. You will only get a 10% bigger .exe but it will make your life much easier to debug your application. The demo will also show you how to build an error trace and how to capture GPF errors.
  • Event log is a module with one function that will give you some more functionality than what you can do with the App.LogEvent method in VB6.
  • FTP is a library that (like most commercial components) acts as a ‘wrapper’ around’ the wininet.dll FTP api calls and takes that dll to its functional limits. This object makes it easy to add FTP functionality to your application at a proffesional level.
  • Object browser lets you have a look at the structure of any OLE/COM object. This can be an ActiveX dll, an OCX or an ActiveX EXE. It’s even possible to read out the entire object model of any MS Office application.
  • QuickTip adds a very nice help function to your application. There is even support for getting the help text out of a chm help file.
  • Receiving e-mail using POP3
  • Scraping the web The WebGrabber object is meant to help you to parse table structured data into a database. This is not only usefull for html files with data in a table but it can also be used to parse a csv file into the database
  • Sending e-mail using SMTP
  • Telnet is a library that will let you interact with a host using the Telnet protocol. You can send any command and get the data that is returned by it. It is also possible to react on various events that are triggered.
  • Windows Service is the easiest way to create your own true NT service. Just look at the testService project. This has all the code you need.
Share