How to use ItemBackColor and ItemFont properties in Visual Basic.NET 
A user asked us how to upgrade a Visual Basic 6.0 project of CheckListBox ActiveX control with ItemBackColor and ItemFont properties.

VB.NET doesn't treat ItemForeCOlor and ItemBackColor as common properties, you need use setItemForeColor or setItemBackColor method to change the fore color or back color of an item.

VB.NET program uses a complete new Font object, so you need change your code as followings.

' load in program names
lstProgram.AddItem(" " & ProListName)

lstProgram.set_ItemBackColor(lstProgram.NewIndex, &HC0FFFF)
lstProgram.set_ItemForeColor(lstProgram.NewIndex, &HFFFF00)

Dim fontFamily As New FontFamily("Arial")
Dim oldFont As Font = _
Dim fnt As New Font(fontFamily, oldFont.Size, _
oldFont.Style Or FontStyle.Bold)
lstProgram.set_ItemFont(lstProgram.NewIndex, fnt)

Please refer to following links for more details:
1) How to: Construct Font Families and Fonts
2) Font Constructor

[ 7 comments ] ( 901 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 600 )
Vbio and Foxpro 
I received a mail from Alberto O. Compagnucci. He told me his experience on VBIO and FoxPro. I want to share his idea with all our users. His mail is as follows:

Dear Mr. Hai Li. I must thank you for vbio16.dll and vbio32.dll development, specially vbio16.dll because it is exactly what I was searching since a cop of months. I use Foxpro 2.6 Windows and I guess it is the only one Foxpro Windows (not Visual) 16 bits mode version and it's running in my PC under Windows 98. It runs under Windows 3.1 and Windows 95 too. Here is an example of how to use vbio16.dll with Foxpro 2.6 Windows. If you want, you can add it to others examples published in your Web page.

Foxpro 2.6 Windows uses foxtools.fll special Foxpro library. It contains many functions but specially provides a special way to use external libraries. It is by using RegFn and CallFn functions. RegFn is to declare a external library function and CallFn executes it.

Program example.

SET LIBRARY TO SYS(2004)+"foxtools.fll" ADDITIVE

**sys(2004) is a Foxpro System Function that provides the complete path to Foxpro directory.
**ADDITIVE avoid others libraries to be disabled.

inpuerto=RegFn("inport", "I", "I", "vbio16.dll")

**This will return an integer to identify this declaration and wil be stored on the user memory variable "inpuerto".
**"inport" is a vbio16.dll function to read a port.
**First "I" is the parameter will be passed to the function, in this case it is port address as integer. Port address can be obtained from Windows 98 Pannel Control System Information or using DOS function DEBUG running Windows 98 in DOS mode. Some functions requires more than one parameter and the number of parameters required will be indicated with the same number of I. It is "II" or "III" and so on.
**Second "I" specifies type of value will return RegFn. In this case it will be an integer. Foxpro will return zero for the first function declared, one for the second and so on; all of them stored at the desired user memory variable.
**"vbio16.dll" is the library where Foxpro will search for the specified function.
**You can declare all functions you want and Foxpro will return a handle integer for each one.
**"Vbio16 function "inportw" can be declared in the same way.

wpuerto=RegFn("outport", "II","I","vbio16.dll")

**Same considerations listed for inpuerto but, note that in this case parameters to pass are two integers ("II"). First is port address, second is the byte to be written as integer.
**"outportw" can be declared in the same way.

readpuerto=CallFn(inpuerto, port address)

**This will read a byte form the specified port and will be stored at "readpuerto" user memory variable.

writepuerto=CallFn(wpuerto, port address, byte to be written as integer)

**This will return the written byte as integer.


**This releases all memory variables.

RELEASE LIBRARY SYS(2004)+"foxtools.fll"

**This releases "foxtools.fll" from memory.

Reading about paralell port addresses is recommended.
For further information about foxtools.fll using refer to an installed Foxpro 2.6; path C:\Fpw26\Goodies \Foxtools\foxtools.wri

Congratulations Hai for your job. Special regards.

Alberto O. Compagnucci

[ 1 comment ] ( 372 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3.1 / 384 )
64-bit ActiveX 
Microsoft officially released Windows XP and Windows Server 2003 x64 edition. IE team introduced 64-bit browser in Windows x64 and recalled all vendors to write 64-bit ActiveX.

We are trying to migrate our ActiveX controls to x64 platform(AMD64 and EM64T). Microsoft chose LLP64 data model, so that 32-bit ActiveX and 64-bit ActiveX can be compiled from same source code. Both 64-bit and 32-bit ActiveX can share same CLSID, because WOW64 presents 32-bit applications with an alternate view of the registry. Please notes Regsvr32.exe file in the System32 folder is a 64-bit version. When you run Regsvr32 to register a DLL, you are using the 64-bit version by default. If you want to register 32-bit version, please run Regsvr32.exe from the %SystemRoot%\Syswow64 folder.

[ add comment ] ( 1 view )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 316 )
Call for ADA95 samples 
One user suggested we should provide some ADA95 samples. But we don't have any experience of ADA. If you are using ADA95 with our products and want to share your works with others, please help us to provide some basic ADA95 samples.

Thanks in advance.

[ 1 comment ] ( 7 views )   |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 302 )