The Linux Page

Register a DLL, OCX and COM objects

If you're like me, you need to register an OCX, DLL, COM object once in a while. Not so often that you will remember what the command is. So...

In order to register a DLL, an OCX and any other COM object, use the MS-Windows tool regsvr32.exe (which usually is in C:\Windows\system32 or some similar folder).

There is also a way to edit the registry, but frankly, just use the tool!

Question: Is there a regsvr64.exe under Win64? 8-)

Register an application so it automatically starts on reboot

Always wondered how they automatically restart an application after a reboot under MS-Windows?

There is a function named RegisterApplicationRestart() that does just that.

There are flags to tell when your application should be started or under which circumstances.

For instance, you can start only if something crashed the OS.

The doc is here: https://msdn.microsoft.com/en-us/library/aa373347.aspx

Using libbfd.a to load your own ".dll" files

Noticing that this is a rather old link, there is my own implementation of the EDLL in case you had not found it yet! 

This Enhanced DLLs page is the first I wrote before starting on the project for real.

This works great with MinGW and does not require to have all symbols defined in a tree like definition. (i.e. these DLLs can link back to the main executable, just like under Linux and many other Unices.)

What the hell is that My Documents stuff about?!

Look at the SHGetSpecialFolderPath()1 function! You can actually use names such as "My Documents" and transform them a valid path as you would expect (i.e. C:\Settings & Stuff\username\My Docs\...).

And yes! If you have no clue about that function, that's not going to be easy to find it...

Note that there has been talks about creating such functions under Linux. There are some but so far I have not seen too many people using

  • 1. The SH stands for Shell. The explorer windows are considered shells under MS-Windows. Nothing to do with a real good Unix shell, of course.

Compile C/C++ files with weird extensions

cl.exe has a special option to be told that the input file is a C (/Tc) or a C++ (/Tp) file. This is necessary if you want to use an extension other than the default .c, .cxx and .cpp. For instance, many people use .cc or .c++ for C++ files. Just add the /Tp command line option and your file will be accepted as a C++ file no matter what the extension is.

Also, in your environment, you can change the editor and Open/Close feature to recognize these files. The Microsoft page available here:

Javascript: setTimeout()

The other day, I wrote a module for Drupal. Up to here, no problem. What I wrote required a small amount of Javascript to make a dropdown menu feature work. That worked just fine under Mozilla and FireFox, and even Safari & Konqueror.

When I tried with Internet Explorer, nope. Not working at all.

The function I was using goes like this:

Javascript under Internet Explorer

Lately, I have been working on a website that has to work on all mordern browsers (in 2007). And I have had problems with Internet Explorer and Safari. Safari is more annoying because there are less hints on the Internet, but the solutions are still quite easy to find (it's not like it's all broken or something.)

Now, I have had many problems with Internet Explorer, but this one is quite interesting. When you need to dynamically create an element, you need to do something like document.createElement('input');. That works great. Once your element is created, you probably need ...

Visual C++ for free!

Download a free copy of your C++ development environment! (Visual C++ v8.0)

Yes! Microsoft is doing the same thing as Linux: they offer their IDE for free with their fully compliant C/C++ compiler (as well as other bits if you are interested, I only want C++ on my end!)

At this time, the link is like this: ... (does not work anymore...)

It may require a bit of digging to get older versions but they should remain available. (but who wants the old stuff anyway?!)

I don't have links anymore and the one I had before doesn't work... it make still be available, but you'll have o

Microsoft compiler version

Somehow, each time I want to know the version of cl1 I just cannot remember the correct name for the macro to use. This is _MSC_VER. This is set to a large number such as 1300. This number represents the compile version. Not the version of the IDE that started later and seems to have been moving slower too. So, at time of writing, the current IDE is version 8.0, but the corresponding compiler is 1400.

Compiler Version IDE Version Year
1100 Visual C++ 5.0 ...
  • 1. In case you did not know, cl is the C/C++ compiler.

Setting the action attribute of a form with Internet Explorer

After about 2 hours of search, I finally got it. All the docs were telling me do this:

	var f = document.getElementById('myform');
	f.action = url;
	f.submit;
				

And it did not work. I was getting an error. So thinking that this 'action' is an attribute I used f.setAttribute('action', url);. And that worked great with Sea Monkey, FireFox, etc. but one day we tried under Internet Explorer. That one was not working somehow. Reading some notes on the net, indeed, setAttribute('action', url)is no good under Internet Explorer. But f.action = url;generates an error?!

After ...

SMS From Me Logo

SMS From Me

To automatically start one on one conversations with your online leads.