Thursday, July 27, 2006

Argument not optional (Error 449)

Problem :
Argument not optional (Error 449) pops up in VB
Applies to: VB6 applications using VC6 Activex controls.

Solution:
The usual reasons for this error is documented in
http://msdn2.microsoft.com/en-us/library/102s19ky.aspx

Another reason this could occur suddenly is when you change the function definition in the ocx.
For eg. you had a function called BOOL MyFunc(String) and you decided to change it to BOOL MyFunc()
But in your VB code when you remove the argument you get the above error and if you don't remove you get an argument mismatch error.

Solution: Make sure that you have changed the follwing three.
1) The header file afx_msg BOOL MyFunc();
2) The cpp file BOOL CMyCtrl::MyFunc()
3) The odl file [id(2)] boolean MyFunc();
and
4) The DISPATCH MAP
DISP_FUNCTION(CMyCtrl, "MyFunc", MyFunc, VT_BOOL, VTS_NONE)

Even if you don't change 4 the intellisense of VB shows the correct form of the function and there won't be any compilation error but it will fail while running.


© Copyright 2006. Bipin C Nair. All rights reserved.

Tuesday, July 18, 2006

Read and Write Indic languages on WinXP

Setup to read Indic (Indian) Languages.
1. Go to control Panel -> Regional and Language Options.
2. In the Languages Tab check "Install files for complex script and right-to-left languages." Say OK.
3. Restart your comp.

Setup to write Indic Languages.
1. Make sure you have down the above steps.
2. Go to http://bhashaindia.com/downloadsV2/Category.aspx?ID=1
3. Download the required IME. (E.g. for Malayalam it is Malayalam Indic IME 1 Version 5.0)
4. Install the IME.
5. Go to control Panel -> Regional and Language Options -> Languages ->Details
6. In the "Text Services and Input Languages" click "Add..."
7. Select your desired language. (e.g. Malayalam(India))
8. Select Keyboard layout as "Malayalam Indic IME 1[V 5.0]
9. Say OK and restart your Comp.
10. Search for a better font if you are not happy with the default font.
(For Malayalam use Thoolika from http://www.supersoftweb.com/Unicode.htm)

Supported indic languages:
Hindi Tamil Kannada Gujarati Marathi Telugu Bengali Malayalam Punjabi Konkani Oriya Sanskrit Nepali


© Copyright 2006. Bipin C Nair. All rights reserved.