Code Steps
27Feb/120

How to update the Target value of Windows Shortcuts?

Some times it is required to edit the Windows Shortcuts to update the shortcut to point to new location/program. But Windows will not allow to edit the disabled shortcuts (it is not possible to update the Target value through Properties window manually). We can write simple VBS (Visual Basic Scripting) to update the shortcuts to point to the new location/program.

Following steps explain how to update a Windows Shortcut through VB Script:

Step (1) Write the following VB script to update the Windows Shortcut. Save the script into .VBS file. Ex: test.vbs

Set sh = CreateObject("WScript.Shell")
Set shortcut = sh.CreateShortcut("<<SHORTCUT NAME>>.lnk")
shortcut.TargetPath = "<<FULL PATH OF THE LOCATION (OR) PROGRAM NAME>>"
shortcut.Save

Note: Where <<SHORTCUT NAME>> is the name of the shortcut. <<FULL PATH OF THE LOCATION (OR) PROGRAM NAME>> is the complete path of the location/program you want to give to the Windows shortcut.

Step (2) Once you are done with VBS changes, double click on .VBS file to execute (or) open Command prompt and type your .VBS file prefixed with @ symbol at command prompt. Ex: @test.vbs

Step (3) You can notice that the Windows Shortcut is updated with the new Traget value once you run the .VBS file.

This is the way you can update the Windows Shortcuts using .VBS script. This will work on disabled shortcuts also.

by µToolbox

23Feb/120

Pointers to functions in C/C++/VC++!

Pointers play very major role in C/C++/VC++. Writing a code with pointers is more error prone than the code without pointers. Understaning pointers is bit difficult.

The simple thing about pointer is, a pointer is a variable which holds an address, like variables holds a value. Means that pointers will not store any values rather than they store the addresses where the value exist.

It is also possible to store addres of a function in the pointers. The following steps explains how to declare and use pointers to functions in C/C++ (or) VC++.

First, Declare a pointer variable which will hold an address of a function. Keep in mind that, the pointer to function variable should have the same number and type of arguments as the function you are going to store the address of it. And the return type also should match.

void (*pfn)();

Second, Assign the function address to the pointer variable.

pfn = SayHello();

Where SayHello is the function with NO arguments and return type is void.

Third, Invoke the function using pointer variable.

pfn();

The following is the sample code:


void SayHello();
void PrintMessage(char* message);

void main()
{
 void (*pfn1)();
 void (*pfn2)(char* message);
 

 pfn1 = SayHello;
 pfn2 = PrintMessage;
 

 pfn1();
 pfn2("\nWorld!");
}

void SayHello()
{
 printf("Hello!");
}

void PrintMessage(char* message)
{
 printf("%s", message);
}

by µToolbox

16Feb/12Off

How to align <div> tags side by side?

An HTML <div>Tag is used to define a section in an HTML document. This tag is more often used to create weblayouts. Some times it is required to place two <div> tags side by side. Below are the steps to achieve this:

First, Write the HTML code fro two <div> tags.

Second, Use the HTML attribute float with proper values to align these two <div> tags side by side.

Third, Refresh the webpage, to get your changes affected.

Following is the HTML code for this:

DIV Tag 1 Code:

<div style="float: left;">DIV Tag 1</div>

DIV Tag 2 Code:

<div style="float: right;">DIV Tag 2</div>

 

 

 

By A2Z FAQS

13Feb/120

How to use uToolbox File Encoder Tool?

µToolbox File Encoder tool is very useful tool which allows to encode / decode the content of the files. Once the file is encoded, it is not possible to read / execute the file until the file is decoded back.

The following steps cover the usage of powerful File Encoder Tool.

Encoding the file

Step (1) Click on File->Encode menu item.

Step (2) Click on the icon next to “File to encode” edit box and select the file to encode from the File Open dialog.

Step (3) Observe that File Encoder Application will display the selected file size on top of “File to encode” edit box. Make sure you selected the application of size > or = 1MB. If the file size is < 1MB, File Enocoder Application will not encode the files.

Step (4) Now select the folder where you want to copy the encoded file by clicking the icon next to “Encode the file into the folder” edit box.

Step (5) Click on Encode button to start encoding the application.

Step (6) Once the encoding is done, observer the file is encoded into the file extension ".~fe" in the selected destination folder. 

Decoding the file

Step (1) Click on File->Decode menu item to decode the encoded file. Keep in mind that File Encoder Application will decode only the files which are encoded through this application.

Step (2) Click on the icon next to “File to decode” edit box and select the "~.fe" file to decode from the File Open dialog.

Step (3) Select the destination folder where you want to put the decoded file by clicking the folder icon next to “Decode the file into the folder” edit box.

Step (4) Click on Decode button to start decoding the application.

Step (5) Once the decoding is done, observe the file is decoded into the selected destination folder. 

Click on Close button to close the File Encoder Application.

 

by µToolbox

31Jan/120

How to fix the error “Strict Standards: Accessing static property JCache::$_handler as non static” in cache.php on line 422 in Joomla 1.7.3?

"Strict Standards: Accessing static property JCache::$_handler as non static" error will get when you access the Site ater insatlling  Joomla 1.7.3. Just you can open the mentioned file and go to the line where you are getting the error, and modify the code.

The following code steps will help to fix this error in cache.php on line 422 in Joomla 1.7.3 installation.

Step (1) Open the cache.php file in the code editor and go to the line 422.  cache.php file is located in the follwing path.

libraries/joomla/cache/cache.php

Step (2) You will see the following lines of code in cache.php file on line 422.

/**
  * Get the cache storage handler
  *
  * @return  JCacheStorage   A JCacheStorage object
  *
  * @since   11.1
  */
 public function &_getStorage()
 {
  if (!isset($this->_handler)) {
   $this->_handler = JCacheStorage::getInstance($this->_options['storage'], $this->_options);
  }
  return $this->_handler;
 }

Step (3) Replace the above lines of code with the following.

/**
  * Get the cache storage handler
  *
  * @return  JCacheStorage   A JCacheStorage object
  *
  * @since   11.1
  */
 public function &_getStorage()
 {
  if (!isset(JCache::$_handler)) {
   JCache::$_handler = JCacheStorage::getInstance($this->_options['storage'], $this->_options);
  }
  return JCache::$_handler;
 }

Step (4) Once you made the changes; Save the changes and Refresh your webpage. Now you will not see the error.

by µToolbox