2009年12月15日星期二

Using 103 (telekom) on maxis cell phone account

Received via forwarded email - source not confirmed.

Just be aware, using cell phone has alot of charges that we may be unaware.
or more expensive than we think...

++++

Stop Calling 103 on Maxis

If you are using Maxis network and please be alert that now the new charges for making 103 (TM Directory) was increased from 30 cents to RM2.00 per call.(extra of RM1.70 almost 700% jump)..

I just found out from my maxis statement dated 21/6/08 today and I rang up the Maxis 123 and been told the new rate was started lately only and since I’m not aware of this new adjustment and they willing to waive it for this month but next month will be charging me based on the new rate (RM2.00 per call to 103).

Shocking right? The best part is everyone knew how ‘good’ service our TM directory can provide?? Most the time I need to call at least 2-3 times to get the number I'm looking for mean that one number I need to pay RM4.00 to RM6.00…OMG.. …equal to one meal already…

So please pass this news to your maxis friends to alert them of the new charges.

2009年11月3日星期二

Save Datawindow to PDF by using "Sybase DataWindow PS"

Powerbuilder allow developer to code in the application for datawindow export/save to PDF file by using "Sybase Datawindow PS", PrimoPDF (Third Party Tool) and ActiveX.

Today, I just to explain how to install the Syabse DataWindow PS for save Datawindow into PDF file.

You can install the Sybase Datawindow PS as printer at Windows XP machine through the command below:-

Change into the Sybase\Shared\PowerBuilder\drivers directory:

rundll32.exe printui.dll, PrintUIEntry /q /if /f .\ADIST5.INF /b "Sybase DataWindow PS" /m "Acrobat Distiller" /r "FILE:"

/q is quite mode. Of you plan to see what does this commandline do. Remove the /q in this command.

However, this command line was not working for Windows Vista machine. So, you can use the command below to install it.

rundll32.exe printui.dll, PrintUIEntry /q /if /f .\ghostpdf.inf /b "Sybase DataWindow PS" /m "Ghostscript PDF" /r "FILE:"

2009年10月3日星期六

Firefox "Just Halt"

After I had upgrade my Firefox to 3.5.2 version, the nightmare was come. The Firefox often just halt and no response at all if I was right-click my mouse to download some of the photo.

I have been using Firefox for more than 3 years have no problem on it and "love" it very much. If the problem still cannot solve. I think I have to "leave" Firefox and looking for new browser.

I have really disappointed with Firefox with leave this problem happen for long time. I know I cannot blaim them, because this is free software. I appreciated but this problem make me to withdraw using Firefox.

Good luck for Firefox..... I have to leave you... bye bye

2009年10月1日星期四

Controlling the Outlook session using OLE

Good sample for using the OLE in PowerBuilder (Outlook)

http://downloads.sybase.com/codexchange/powerbuilder/404/PowerBuilder_-_Controlling_the_Outlook_session_using_OLE.htm

http://www.ozgrid.com/forum/showthread.php?t=22263

http://www.tek-tips.com/faqs.cfm?fid=5733

http://www.pcreview.co.uk/forums/thread-1856561.php

PowerBuilder Datawindow crash

If you are PowerBuilder developer. You may have experience for the datawindow look "halt" after you have open the datawindow. I have face this problem few days ago. Actually, in my 10 years experience in using PowerBuilder from version 6 to 11.5. I have face this problem many time. For my past solution was uninstall and install the PowerBuilder. However, this is not a good idea(Sybase look like does not take action on this issue).

Finally, I found the better solutions.

The solutions was,...
For windows,
1. Start -> Run. Enter regedit

2. Looking for HKEY_CURRENT_USER\Software\Sybase\PowerBuilder\{PB version}\Layout\Default

3. and then Double-click on the Datawindow (on left-hand side). Delete all the contain in Value data.


4. Re-start your PowerBuilder.

The solution was so simple. But I have suffer for this issue for few days. Hope this article can help some of you.

Enjoy your code...

2009年7月23日星期四

PowerBuilder API translate

The tens of thousands of function calls in the Windows environment can be helpful to PowerBuilder users, but documenting them is nearly impossible.

OK. Let talk about how to translate standard Microsoft function calls into PowerBuilder syntax, and to empower developers to use any of the external API calls within their owerBuilder environments.

Step 1: Converting an SDK Call to a PowerBuilder API Call
First you need to get the syntax that wil be converted. This can be obtained from either a Windows API Bible or the MSDN (Microsoft Developers Network).

Step 2: Determining Whether it is a Function or a Subroutine.

Function calls return a value; subroutines do not.

Here is an example of a Microsoft function:
BOOL GetFileVersionInfo( LPTSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData );

Here is an example of a Microsoft subroutine:
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer);

Step 3: Converting the datatypes from Microsoft to PowerBuilder.



Most of the datatypes are listed above, but some may be missing. When in doubt read the datatype description first. If still unsure, it is usually safe to assume a 16 bit datatype is a "uint" and a 32 bit datatype is a "ulong", since they are the most common.

*If the word "Callback appears as a datatype, it cannot be performed by PowerBuilder. Callback routines are functions that are called from within functions.

Step 4: Coding the Global/Local External Function:
This is a Microsoft function:
BOOL GetFileVersionInfo( LPTSTR lptstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData );

The BOOL represents a boolean return code, which is translated to "Boolean" in PB for both 16 and 32 bit. A LPCTSTR means a pointer to a string (see step 3). In PowerBuilder, simply use the word "ref" before declaring the string in either 16- or 32-bit platofrms. DWORD is translated to "uint" for 16 bit and "ulong" for 32 bit. An LPVOID indicates that a structure is being used. In PowerBuilder, create a structure, assign it to an instance variable of that structure and pass it by reference. As a result, the following function declarations can be derived:

PowerBuilder 16 bit:
FUNCTION boolean GetFileVersionInfo(ref string filename, uint f_handle, uint f_length, ref lpdata lpdata2) LIBRARY "ver.dll"

PowerBuilder 32 bit:
FUNCTION boolean GetFileVersionInfoA(ref string filename, ulong f_handle, ulong f_length, ref lpdata lpdata2) LIBRARY "version.dll"

Note: In the "gotchas" section listed below, you'll get a further explanation why an "A" is appended to the 32-bit function. You'll also find a handy technique to help you locate function calls within the DLLs.

Step 5: Creating a Structure
In this particular example a structure is needed so you'll need information on what elements are contained within this structure. The MSDN provides this information since the function being called is a Windows function.

In the MSDN the structure appears like this:
LPDATA = { DWORD dwSignature ; DWORD dwStrucVersion ; DWORD dwFileVersionMS ; DWORD dwFileVersionLS ; DWORD dwProductVersionMS ; DWORD dwProductVersionLS ; DWORD dwFileFlagsMask ; DWORD dwFileFlags ; DWORD dwFileOS ; DWORD dwFileType ; DWORD dwFileSubtype ; DWORD dwFileDateMS ; DWORD dwFileDateLS }

In PB you would go into the structure painter and in this particular case all of these elements would be converted to ULONG. If one of the elements within the structure was a nested structure or callback routine you would not be able to use this function within PB. In that case the only option would be to create a C DLL that makes the function call and call it from PB.

Step 6: Scripting the Function Call.
Now that you have the function declaration you need to pass it the proper arguments. Taking the function " GetFileVersionInfoA" listed in Step 4 the following script would be needed:

First you'll need to declare the datatypes. Keep in mind the variable names do not have to match the function declaration listed in step 4.

boolean lb_rtn // Return code
string ls_filename // 1st argument - filename
ulong lu_hand // 2nd argument - f_handle
ulong lu_len // 3rd argument - f_length
lpdata lpdata2 // Last argument - assigning an instance of a structure.

Next is the hardest part and that is assigning values to the arguments. This part may require use of the MSDN, API Bible or whatever reference is available that covers the function you are calling. In this particular case the information is contained within the MSDN.

The first argument " ls_filename ", should be set to the path and filename of the target file.

ls_filename = "c:\windows\calc.exe" // The calculator would be a good file to test against.

The second argument "lu_hand" according to the MSDN is ignored. This is probably reserved for a future version of Windows to use. To be safe the argument should be set to null.

setnull(lu_hand)

The third argument "lu_len" contains the size of the buffer that the information will be returned into. It is critical that the buffer size not be too small or the information may overflow into another part of memory causing a GPF or Dr. Watson error. In this particular case since the structure contains 13 elements that are all

lu_len = 256

The last argument "lpdata2" is an instance of the structure "lpdata" and it will be populated by the function call.

The final script will appear as follows:

boolean lb_rtn
string ls_filename
ulong lu_hand, lu_len
lpdata lpdata2
ls_filename = "c:\windows\calc.exe" // The calculator would be a good file to test against.
setnull(lu_hand)
lu_len = 256
lb_rtn = GetFileVersionInfoA(ls_filename, lu_hand, lu_len, lpdata2)

// Viewing the output -------------------------------------------------------------
sle_1.text = string(lpdata2.dwSignature)
sle_2.text = string(lpdata2.dwStrucVersion)
sle_3.text = string(lpdata2.dwFileVersionMS)
sle_4.text = string(lpdata2.dwFileVersionLS)
sle_5.text = string(lpdata2.dwProductVersionMS)
sle_6.text = string(lpdata2.dwProductVersionLS)
sle_7.text = string(lpdata2.dwFileFlagsMask)
sle_8.text = string(lpdata2.dwFileFlags)
sle_9.text = string(lpdata2.dwFileOS)
sle_10.text = string(lpdata2.dwFileType)
sle_11.text = string(lpdata2.dwFileSubtype)
sle_12.text = string(lpdata2.dwFileDateMS)
sle_13.text = string(lpdata2.dwFileDateLS)
Messagebox("Return Code", string(lb_rtn))

Gotcha's to look out for:
1. Make sure the DLL you are referencing is the right bit level. This can sometimes be done by looking at the DLL's properties but most likely you'll need a third party product to determine this. Remember, a 16 bit application cannot make a 32 bit API call and visaversa.
2. Some functions are cap sensitive. "Findwindowa" might fail whereas "FindWindowA" works.
3. All handles in PowerBuilder 16 bit are UINT and 32 bit are ULONG. Using the datatypes INT or LONG may work but if the handle points to an area in high memory the latter two datatypes may not be able to support such a large number.
4. Make sure you have the correct function name. Under 32 bit many of the functions had an "A" (Whcih stands for Ascii) appended to the function name to make it unique from it's 16 bit counterpart. This allows developers to place both 16 bit and 32 bit function calls in the same application and then making the correct function call based on what bit platform the program is being run from. The real reason why Microsoft named the functions this way was to differentiate between (A)-Ascii and (W)-Unicode format. The MSDN does not always list the proper names for the functions. For example: GetFileVersionInfo is listed as a 32 bit function but it is in fact GetFileVersionInfoA.
5. Global versus Local External Function declaration. If the function is declared globally it can be called from anywhere in your application. If you declare the function as a Local External Function it can only be called from that window where it's declared. Local Function use less resources then globals but the difference is very minimal.

Error Messages and what they mean:
1. Error: Error opening DLL library for external function at line in the event of object of .

Possible causes:
> DLL is 16 bit and thus incompatible.
> DLL is not in a searchable directory.
> DLL connects to another DLL that cannot be found.
> DLL has the same name as another already loaded into memory.
> DLL is corrupted or in an incompatible format.

2. Error: Error calling external function at line in the event of object of .

This is probably the result of an incorrectly spelt function name. Be sure to verify that the function name matches what is in the DLL exactly, including the case of the letters.

3. Error: Specified argument type differs from required argument type at runtime in DLL function . (Invalid stack pointer on return from function call) at line in event of object of .

This error usually indicates the datatypes do not match what the DLL function is expecting.

4. PB050: Caused an Invalid Page Fault in module PBSHR050.DLL @ 0137:1111163e

This error can occur either immediately upon calling the function or when the application closes. The module and memory address may vary but the reason for this is usually the same. If PB is receiving a string and memory isn't allocated in advance using the SPACE( ) that string will overflow into another memory area. To allocate 12 characters to the string "ls_filename" the following code would be used.

ls_filename = space(13) // You may want to give it an extra space just to be safe.

5. Receiving garbage from the DLL. i.e. Last name populated as: "*#^&Ryan"

This problem is most likely the result of the byte alignment being set incorrectly. PowerBuilder expects the byte alignment to be set to one and if you are using MSVC++ compiler the default setting is four. To set the byte alignment to one you would need to do the following prior to compiling to a dll.

- Select the desired target
- Right mouse click and select Settings
- Select the C/C++ tabpage
- Select Code Generation from the Category dropdown list
- Select desired byte alignment from the Struct Member Alignment dropdown list.

The DOS switch to set the byte alignment to one is: /zp1

A handy trick to find functions quickly:
1. On Win95,Win98 or NT 4.0 click on the START button and select "Find", then "Files or Folders".
2. In the SLE entitled "Named" enter "c:\*.dll". If this is a Windows DLL that you'll be calling enter "c:\windows\*.dll".
3. Click on the "Advanced" tab and in the "Containing Text" SLE enter the exact function name you are looking for. For example: FindWindowA
4. There will usually be a lot of DLL's that contain the function you are looking for but try to use the main Windows DLL's whenever possible since they are already loaded into memory.

Related Faxlines:
47626 - External Functions Calls to the DLLs created using Visual C++
44596 - 16 Bit - Windows API Calls for PowerBuilder 4.0, 5.0 & 6.0


44545 - 32 Bit - Windows API Calls for PowerBuilder 5.0
44648 - Prototyping API Calls for PowerBuilder 4.0, 5.0 and 6.0
44588 - Dynamically Closing a Non-PowerBuilder Application
47703 - GPF's and The PowerBuilder Memory Defragger
47704 - Windows 3.10 and 3.11 Functions - Krnl386.exe, User.exe, Gdi.exe
47707 - 16 Bit - Win95 and NT Functions - Krnl386.exe, User.exe, Gdi.exe
47705 - 32 Bit - Win95 and NT Functions - Kernel32.dll, User32.dll, Gdi32.dll
44474 - External Function Calls
44538 - Passing a 32-bit PowerBuilder structure to a 32-bit C DLL Created in Power++

2009年5月18日星期一

NTLDR missing

Last Wednesday, one of my colleague PC suddenly cannot log-in to Windows and system shown as NTLDR missing. First, I guest this problem caused my hardware. So, I have checked on the cable and hadrdisk. However, hardware does not prompt for any error and failure.

After that, I have check again for the jumper setting on the harddisk. The setting is correct. Finally, I have not choose. So, I have go to update the Bios. But the error still cannot settle.

However, I have manage to settled to settled it by replace the ntldr file. Here is the steps how I have do it.

The PC is run under Windows XP

1. Insert the Windows XP bootable CD into the computer.
2. When prompted to press any key to boot from the CD, press any key.
3. Once in the Windows XP setup menu press the "R" key to repair Windows.
4. Log into Windows installation by pressing the "1" key and pressing enter.
5. Enter administrator password.
6. Copy the below two files to the root directory of the primary hard disk. In the below example we are copying these files from the CD-ROM drive letter, which in this case is "e." This letter may be different on your computer.

copy d:\i386\ntldr c:\
copy d:\i386\ntdetect.com c:\

7. Once both of these files have been successfully copied, remove the CD from the computer and reboot.

2009年4月17日星期五

Write a letter to Standard Chartered

I have made at complaint to Standard Chartered on March 2009. Below is the contain:-


Good day. Sorry have to drop you and email. Caused I have searched all around your website (Malaysia) and cannot get any email address can sent to.

I hope your can look seriously in my case. The story maybe a bit long.

I have brought "AMDuo" fund from your company and I have plan to redeem the fund from your company past 2 months. I have go to your branch, more than 3 times only can "success" to redeem it.

I have go to your branch at Bandar Puteri, Malaysia to redeem the fund. She claim that cannot proceed the process because based on the IC(Malaysia Identity Card) I have provided to her and she cannot find the record. So, she requested me to prove to her with the "Agreement" I have signed before. If not, she can't do anything.(If I have lost the document, can I still can take back my money? Why I just need to present my IC already can do the redeem at others bank in Malaysia, but not for your Standard Chartered Bank?)

So, I have come back to your branch second time with the "Agreement". I still failed to redeem it. This time, the reason given to me was I don't know the person in-charge. So, they need to get the information from the HQ and asking me to wait. But I can't caused I need to back to work. In my mind, what is the system your company have? Your system does not "link"? Now is the "cyber" world already, still doing your business in "traditional" way? I have really can't understand???

The third time i went back to your Branch and I have success to completed the form to redeem my money and your staff told me they will post to me within 2 week. Once again, I disappointed. I have wait almost 4 week with no feedback, no news.. nothing. So, I have call the branch. It take me half of day to get the line(I have call more than 10 times, most of the time are the phone ring until disconnected). What do you feel, if you are in my situation? After that, they are passing my call among of them. You know why? After I have explained to them, they said: "That is not my department to handle, I pass your line to respective department" and then others person said: " Your case not I in-charge". So, pass the line to another person. Hey... I just want to asking the status only. I just want to know when can I get my money only. Again, your system does not "link". I have only can go back to same person only? if the person in-charge was resigned or re-allocated position?

After long-long time explained. Finally, they told me I can go to the Branch to get my cheque on tomorrow(13th March 2009). When I get the cheque which have put inside the envelope. So, I quickly go to bank to bank-in. However, when I take out the cheque from the envelope, I found that, the cheque is not my name. So, I have rushing back to Bandar Puteri Branch again. After that, they give me another cheque which was under my name. How careless your staff doing theire job?

My nightmare was goes. The answer was NO. I have bank-in the cheque on 13th March 2009, Friday. I have check my Bank on Saturday, and the status shown is under "1 day flow". Until today, i check my with my Bank, the cheque was cancel(return). I really surprise, Standard Chartered Bank can simply cancel/return the cheque just like that without notice your customer? Until know, I have not yet receive any feedback from your Branch at Malaysia. If I have not follow up the status, I think until know I still don't know the cheque has been cancel/return.

Why Standard Chartered Bank always dislike give any feedback to customer? Why Standard Chartered Bank like to do thing without customer notice? Does you think that is the right way to give the services to your customer? Does me still can believe Standard Chartered Bank?

I appreciate Standard Chartered Bank can look seriously in this case. I have really disappointed with your company services.


Your reply and actions was very meaningful to me. Thanks.



UNTIL NOW, NO REPLY. NO FEEDBACK. NO RESULT. DO YOU STILL BELIEVE THEM????

2009年4月16日星期四

Jooma with eXplorer

The problem I have face with success install the eXplorer into Joomla with no error return. However, I have problem with assign to user to use this service with _NOT_EXIST error return.

After taking my time to search around the internet by helping with Google. I found the solution. The solution was quite simple. Open the file at components/com_extplorer/configuration.ext.php.

After that, you need to enable the "fronted" as below:-

// ALLOW FRONTEND BROWSING ? Change to
$frontend_enabled = true; // If needed!
//$frontend_enabled = false;

2009年3月24日星期二

警方到第是在做什么??

看看这篇报道: http://www.malaysiakini.com/news/100822

然后在看看这个片段:


你有何感想??

让教育回归教育吧!!

我们的教育部是不是生病了呢? 竟然为了党的利益而禁止在野党出席任何学校的活动.


来自: "当今大马"

难道"他们"真的这么怕在野党吗? 为了打压在野党而"无其不用"? 让人民来决定你们的征途吧. 不要再"搞三搞四"的了. 这样只会让人民更加的讨厌你们吧了. 现在的人民已经更以前不同了. 醒醒吧..

详细内容看这里..

2009年3月23日星期一

民联党报被打压

刚刚在"当今大马"看到了民联党报, 《公正之声》和《哈拉卡》被吊销执照三个月. 《火箭报》不获更新执照. 大家都知道, 在这个国家,每年都必须更新印刷执照才获准办报.

这是不是国阵对民联的另一种打压呢? 我想天知,地知.. 人人心理有数. 就不必多言了. 这个国家的政治人物为了"赢"已经到了不折手段的地步了. 已经没有"政治道德"了. 我们要这样的政府吗? 为了私利可以把人民的一切都赔上!

古人说: "齐国必先齐家, 齐家必先修身". 看看我们的领袖吧!!! 那一个有真真的做到. 我们国家的有些部门不是为了人民而成立的. 是为了特定的政党而设的. 是用来消除敌人的...




来自"当今大马":
党选补选前夕在野党喉舌被禁哈拉卡及公正之声吊销三个月
中文《火箭报》准证未获更新张念群斥纳吉上台前打压言论

2009年3月11日星期三

Windows after login auto log off

As we know, Windows are always easy attack by virus, spyware and etc. It's because of "poor" design/security of Windows or Windows are too famous???

Recently, one of my collage PC have attack by Virus (Forget the Virus name already). Caused after I have scan it by using Avira and system are required to reboot. After reboot, system cannot login any more.




After click on the user and then enter the password. Windows will auto log-off. I have been try so many method but was failed. I try to go to save mode, also failed. I try to remove the harddisk and plug into other PC to do the scanning, also failed. It's too me a lot of time (is wasted my time). I hate the person whose created the virus, they are not hero. They are "rubbish". Just know destroy and make others people in difficulty.

Finally, I have managed to solved it by Insert the original Windows XP CD and reboot the computer. You may need to configure your computer to boot from the CD-ROM drive. When the Windows XP Setup has started, press “R” to “repair the Windows XP installation using Recovery Console”.

Select the Windows installation to repair (generally this is C:\Windows) by typing its number and then pressing ENTER. Type the Administrator password and press ENTER. If does not have password, just leave it and press ENTER.

Go to i386 folder(Windows CD). Enter command below,

EXPAND USERINIT.EX_ C:\WINDOWS\SYSTEM32 [ENTER]

I would like to thanks said thanks for http://moniroth.wordpress.com/2009/03/03/windows-automatically-logoff-after-logon/

2009年2月24日星期二

Crosstab in MySQL

A lot of people asking me how can I do in SQL statement as Crosstab. So, here I publish the solution at here. Hope really can settle some of the person whose face the same problem.

Examples,
select "",
sum( if(so_type = "WV", invoice_amount, null) ) as wv_amount,
count( if(so_type = "WV", invoice_amount, null) ) as wv_count,
sum( if(so_type = "RW", invoice_amount, null) ) as rw_amount,
count( if(so_type = "RW", invoice_amount, null) ) as rw_count,
sum( if(so_type <> "WV" and so_type <> "RW", invoice_amount, null) ) as misc_amount,
count( if(so_type <> "WV" and so_type <> "RW", invoice_amount, null) ) as misc_count
from rbs_so
WHERE
group by ""

For more detail regarding this issue. You can get more information at here http://blog.adaniels.nl/articles/creating-a-cross-tab-in-mysql/

2009年2月1日星期日

电影与种族主义

最近有个什么部长很骄傲的说本地的电影成长迅速和多样化。还沾沾自喜的说:本地人越来越喜欢本地电影了。我想问大家,有谁花钱去戏院看过本地电影呢?老实说,我从来就没有花过一分-亳去电影院看过本地电影(我朋友也-样)。原因无它,本地电影内容不到味,粗制烂造。不是本地没有好电影,就像《最后一个共产》就是-部不错的电影。还过这部电影无法在本地电影院无法上映。只因我们伟大的电俭局而无法上映。

谈了这么多,还没有说到电影和种族主义有何关连。不知道大家知不知道 ,政府为了鼓劢本地的电影发展。实施了扣税方案。那如何来鉴定一部电影是不是本地电影呢?看我们的官员如何定义。他们是以一个特定的语言来决定的。只要你的电影里,有-点点其它语言的全在,就不是本地电影,那你的电影就没能得到回扣税了。


种族主义的侵入是电影界的悲哀呀!那为何没有人反对呢?有如教育界里反对单-语言一般呢?我想,那是因为大多数人认为,教育是大事,而电影是小事吧!


2009年1月23日星期五

新年

在过三天就是大年初一了. 在此恭祝大家新年快乐,新年进步.. 身体安康.