<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-21179294</id><updated>2012-01-22T09:13:05.595-08:00</updated><title type='text'>PK Tech Home</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-21179294.post-5399858171094759127</id><published>2008-04-01T01:43:00.001-07:00</published><updated>2008-04-01T11:32:41.856-07:00</updated><title type='text'>Android, sample3 , Create,open close SQLite DB</title><content type='html'>Source from:&lt;a href="http://code.google.com/android/intro/tutorial-ex1.html"&gt;http://code.google.com/android/intro/tutorial-ex1.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* Copyright (C) 2008 Google Inc.&lt;br /&gt;*&lt;br /&gt;* Licensed under the Apache License, Version 2.0 (the "License");&lt;br /&gt;* you may not use this file except in compliance with the License.&lt;br /&gt;* You may obtain a copy of the License at&lt;br /&gt;*&lt;br /&gt;* http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;*&lt;br /&gt;* Unless required by applicable law or agreed to in writing, software&lt;br /&gt;* distributed under the License is distributed on an "AS IS" BASIS,&lt;br /&gt;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;* See the License for the specific language governing permissions and&lt;br /&gt;* limitations under the License.&lt;br /&gt;*/&lt;br /&gt;package com.google.android.demo.notepad1;&lt;br /&gt;import android.app.ListActivity;&lt;br /&gt;import android.database.Cursor;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import android.view.Menu;&lt;br /&gt;import android.view.Menu.Item;&lt;br /&gt;import android.widget.SimpleCursorAdapter;&lt;br /&gt;public class Notepadv1 extends ListActivity {&lt;br /&gt;private int mNoteNumber = 1;&lt;br /&gt;private NotesDbAdapter mDbHelper;&lt;br /&gt;/** Called when the activity is first created. */&lt;br /&gt;@Override&lt;br /&gt;public void onCreate(Bundle icicle) {&lt;br /&gt;//super.onCreate(icicle);&lt;br /&gt;super.onCreate(icicle);&lt;br /&gt;setContentView(R.layout.notepad_list);&lt;br /&gt;mDbHelper = new NotesDbAdapter(this);&lt;br /&gt;mDbHelper.open();&lt;br /&gt;fillData();&lt;br /&gt;}&lt;br /&gt;public static final int INSERT_ID = Menu.FIRST; //Note: In strings.xml resource (under res/values), add a new string for menu_insert with text "Add Item" &lt;string name="menu_insert"&gt;Add Item&lt;/string&gt;, then save the file&lt;br /&gt;@Override&lt;br /&gt;public boolean onCreateOptionsMenu(Menu menu) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;// return super.onCreateOptionsMenu(menu);&lt;br /&gt;boolean result = super.onCreateOptionsMenu(menu);&lt;br /&gt;menu.add(0, INSERT_ID, R.string.menu_insert);&lt;br /&gt;return result;&lt;br /&gt;}&lt;br /&gt;@Override&lt;br /&gt;public boolean onOptionsItemSelected(Item item) {&lt;br /&gt;// TODO Auto-generated method stub&lt;br /&gt;//return super.onOptionsItemSelected(item);&lt;br /&gt;switch (item.getId()) {&lt;br /&gt;case INSERT_ID:&lt;br /&gt;createNote();&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;return super.onOptionsItemSelected(item);&lt;br /&gt;}&lt;br /&gt;private void createNote() {&lt;br /&gt;String noteName = "Note " + mNoteNumber++;&lt;br /&gt;mDbHelper.createNote(noteName, "");&lt;br /&gt;fillData();&lt;br /&gt;}&lt;br /&gt;private void fillData() {&lt;br /&gt;// Get all of the notes from the database and create the item list&lt;br /&gt;Cursor c = mDbHelper.fetchAllNotes();&lt;br /&gt;startManagingCursor(c);&lt;br /&gt;String[] from = new String[] { NotesDbAdapter.KEY_TITLE };&lt;br /&gt;int[] to = new int[] { R.id.text1 };&lt;br /&gt;// Now create an array adapter and set it to display using our row&lt;br /&gt;SimpleCursorAdapter notes =&lt;br /&gt;new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);&lt;br /&gt;setListAdapter(notes);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* Copyright (C) 2008 Google Inc.&lt;br /&gt;*&lt;br /&gt;* Licensed under the Apache License, Version 2.0 (the "License");&lt;br /&gt;* you may not use this file except in compliance with the License.&lt;br /&gt;* You may obtain a copy of the License at&lt;br /&gt;*&lt;br /&gt;* http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;*&lt;br /&gt;* Unless required by applicable law or agreed to in writing, software&lt;br /&gt;* distributed under the License is distributed on an "AS IS" BASIS,&lt;br /&gt;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;* See the License for the specific language governing permissions and&lt;br /&gt;* limitations under the License.&lt;br /&gt;*/ package com.google.android.demo.notepad1;&lt;br /&gt;&lt;br /&gt;import android.content.ContentValues;&lt;br /&gt;import android.content.Context;&lt;br /&gt;import android.database.Cursor;&lt;br /&gt;import android.database.SQLException;&lt;br /&gt;import android.database.sqlite.SQLiteDatabase;&lt;br /&gt;&lt;br /&gt;import java.io.FileNotFoundException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Simple notes database access helper class. Defines the basic CRUD operations&lt;br /&gt;* for the notepad example, and gives the ability to list all notes as well as&lt;br /&gt;* retrieve or modify a specific note.&lt;br /&gt;*&lt;br /&gt;* This has been improved from the first version of this tutorial through the addition&lt;br /&gt;* of better error handling and also using returning a Cursor instead of using&lt;br /&gt;* a collection of inner classes (which is less scalable and not recommended).&lt;br /&gt;*/&lt;br /&gt;public class NotesDbAdapter {&lt;br /&gt;&lt;br /&gt;public static final String KEY_TITLE="title";&lt;br /&gt;public static final String KEY_BODY="body";&lt;br /&gt;public static final String KEY_ROWID="_id";&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Database creation sql statement&lt;br /&gt;*/&lt;br /&gt;private static final String DATABASE_CREATE =&lt;br /&gt;"create table notes (_id integer primary key autoincrement, "&lt;br /&gt;+ "title text not null, body text not null);";&lt;br /&gt;&lt;br /&gt;private static final String DATABASE_NAME = "data";&lt;br /&gt;private static final String DATABASE_TABLE = "notes";&lt;br /&gt;private static final int DATABASE_VERSION = 2;&lt;br /&gt;&lt;br /&gt;private SQLiteDatabase mDb;&lt;br /&gt;private final Context mCtx;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Constructor - takes the context to allow the database to be opened/created&lt;br /&gt;* @param ctx the Context within which to work&lt;br /&gt;*/&lt;br /&gt;public NotesDbAdapter(Context ctx) {&lt;br /&gt;this.mCtx = ctx;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Open the notes database. If it cannot be opened, try to create a new instance of&lt;br /&gt;* the database. If it cannot be created, throw an exception to signal the failure&lt;br /&gt;* @return this (self reference, allowing this to be chained in an initialization call)&lt;br /&gt;* @throws SQLException if the database could be neither opened or created&lt;br /&gt;*/&lt;br /&gt;public NotesDbAdapter open() throws SQLException {&lt;br /&gt;try {&lt;br /&gt;mDb = mCtx.openDatabase(DATABASE_NAME, null);&lt;br /&gt;} catch (FileNotFoundException e) {&lt;br /&gt;try {&lt;br /&gt;mDb =&lt;br /&gt;mCtx.createDatabase(DATABASE_NAME, DATABASE_VERSION, 0,&lt;br /&gt;null);&lt;br /&gt;mDb.execSQL(DATABASE_CREATE);&lt;br /&gt;} catch (FileNotFoundException e1) {&lt;br /&gt;throw new SQLException("Could not create database");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;return this;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void close() {&lt;br /&gt;mDb.close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Create a new note using the title and body provided. If the note is successfully created&lt;br /&gt;* return the new rowId for that note, otherwise return a -1 to indicate failure.&lt;br /&gt;* @param title the title of the note&lt;br /&gt;* @param body the body of the note&lt;br /&gt;* @return rowId or -1 if failed&lt;br /&gt;*/&lt;br /&gt;public long createNote(String title, String body) {&lt;br /&gt;ContentValues initialValues = new ContentValues();&lt;br /&gt;initialValues.put(KEY_TITLE, title);&lt;br /&gt;initialValues.put(KEY_BODY, body);&lt;br /&gt;return mDb.insert(DATABASE_TABLE, null, initialValues);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Delete the note with the given rowId&lt;br /&gt;* @param rowId id of note to delete&lt;br /&gt;* @return true if deleted, false otherwise&lt;br /&gt;*/&lt;br /&gt;public boolean deleteNote(long rowId) {&lt;br /&gt;return mDb.delete(DATABASE_TABLE, KEY_ROWID + "=" + rowId, null) &gt; 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Return a Cursor over the list of all notes in the database&lt;br /&gt;* @return Cursor over all notes&lt;br /&gt;*/&lt;br /&gt;public Cursor fetchAllNotes() {&lt;br /&gt;return mDb.query(DATABASE_TABLE, new String[] {&lt;br /&gt;KEY_ROWID, KEY_TITLE, KEY_BODY}, null, null, null, null, null);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Return a Cursor positioned at the note that matches the given rowId&lt;br /&gt;* @param rowId id of note to retrieve&lt;br /&gt;* @return Cursor positioned to matching note, if found&lt;br /&gt;* @throws SQLException if note could not be found/retrieved&lt;br /&gt;*/&lt;br /&gt;public Cursor fetchNote(long rowId) throws SQLException {&lt;br /&gt;Cursor result = mDb.query(true, DATABASE_TABLE, new String[] {&lt;br /&gt;KEY_ROWID, KEY_TITLE, KEY_BODY}, KEY_ROWID + "=" + rowId, null, null,&lt;br /&gt;null, null);&lt;br /&gt;if ((result.count() == 0) !result.first()) {&lt;br /&gt;throw new SQLException("No note matching ID: " + rowId);&lt;br /&gt;}&lt;br /&gt;return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Update the note using the details provided. The note to be updated is specified using&lt;br /&gt;* the rowId, and it is altered to use the title and body values passed in&lt;br /&gt;* @param rowId id of note to update&lt;br /&gt;* @param title value to set note title to&lt;br /&gt;* @param body value to set note body to&lt;br /&gt;* @return true if the note was successfully updated, false otherwise&lt;br /&gt;*/&lt;br /&gt;public boolean updateNote(long rowId, String title, String body) {&lt;br /&gt;ContentValues args = new ContentValues();&lt;br /&gt;args.put(KEY_TITLE, title);&lt;br /&gt;args.put(KEY_BODY, body);&lt;br /&gt;return mDb.update(DATABASE_TABLE, args, KEY_ROWID + "=" + rowId, null) &gt; 0;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;textview id="@+id/text1" android="http://schemas.android.com/apk/res/android" layout_width="wrap_content" layout_height="wrap_content"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;linearlayout android="http://schemas.android.com/apk/res/android" layout_width="wrap_content" layout_height="wrap_content"&gt;&lt;br /&gt;&lt;listview id="@id/android:list" layout_width="wrap_content" layout_height="wrap_content"&gt;&lt;br /&gt;&lt;textview id="@id/android:empty" layout_width="wrap_content" layout_height="wrap_content" text="@string/no_notes"&gt;&lt;br /&gt;&lt;/linearlayout&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;resources&gt;&lt;br /&gt;&lt;string name="app_name"&gt;Notepad v1&lt;/string&gt;&lt;br /&gt;&lt;string name="no_notes"&gt;No Notes Yet&lt;/string&gt;&lt;br /&gt;&lt;string name="menu_insert"&gt;Add Item&lt;/string&gt;&lt;br /&gt;&lt;/resources&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-5399858171094759127?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/5399858171094759127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=5399858171094759127' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/5399858171094759127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/5399858171094759127'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2008/04/android-sample3-create-item-and-menu.html' title='Android, sample3 , Create,open close SQLite DB'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-4931845901221572176</id><published>2008-04-01T01:35:00.001-07:00</published><updated>2008-04-01T01:38:17.237-07:00</updated><title type='text'>Android, sample2 ,Display String!</title><content type='html'>package com.android.hello;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;public class HelloAndroid extends Activity {&lt;br /&gt;/** Called when the activity is first created. */&lt;br /&gt;@Override&lt;br /&gt;public void onCreate(Bundle icicle) {&lt;br /&gt;super.onCreate(icicle);&lt;br /&gt;setContentView(R.layout.main);&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-4931845901221572176?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/4931845901221572176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=4931845901221572176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/4931845901221572176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/4931845901221572176'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2008/04/android-sample2-display-string.html' title='Android, sample2 ,Display String!'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-2692311746402587315</id><published>2008-04-01T01:33:00.000-07:00</published><updated>2008-04-01T01:34:17.236-07:00</updated><title type='text'>Android, sample1 ,Hello, Android!</title><content type='html'>package com.android.hello;&lt;br /&gt;import android.app.Activity;&lt;br /&gt;import android.os.Bundle;&lt;br /&gt;import android.widget.TextView;&lt;br /&gt;public class HelloAndroid extends Activity {&lt;br /&gt;/** Called when the activity is first created. */&lt;br /&gt;@Override&lt;br /&gt;public void onCreate(Bundle icicle) {&lt;br /&gt;super.onCreate(icicle);&lt;br /&gt;TextView tv = new TextView(this);&lt;br /&gt;tv.setText("Hello, Android");&lt;br /&gt;setContentView(tv);&lt;br /&gt;}&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-2692311746402587315?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/2692311746402587315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=2692311746402587315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/2692311746402587315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/2692311746402587315'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2008/04/android-sample1-hello-android.html' title='Android, sample1 ,Hello, Android!'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-1476696854789875419</id><published>2007-10-21T09:33:00.000-07:00</published><updated>2007-10-21T09:44:42.738-07:00</updated><title type='text'>Java, Beginning</title><content type='html'>=Tools Download =&lt;br /&gt;==Java JDK 6.0 SE ==&lt;br /&gt;Standard Edition and JRE &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;http://java.sun.com/javase/downloads/index.jsp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-1476696854789875419?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/1476696854789875419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=1476696854789875419' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/1476696854789875419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/1476696854789875419'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2007/10/java-beginning.html' title='Java, Beginning'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-4030952180174521872</id><published>2007-10-19T18:34:00.000-07:00</published><updated>2007-10-19T18:38:38.107-07:00</updated><title type='text'>VLC, Vlc cannot insert to IE browser by Javscript innerHTML function</title><content type='html'>Question: VLC, Vlc cannot insert to IE browser by Javscript innerHTML function in the run-time.&lt;br /&gt;(Solution) Used below web site test HTML code, It can working with latest version 0.8.6c,&lt;br /&gt;(6) &lt;a href="http://forum.videolan.org/viewtopic.php?t=28383"&gt;http://forum.videolan.org/viewtopic.php?t=28383&lt;/a&gt;&lt;br /&gt;Windows Registry Editor Version 5.00&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#999999;"&gt;&lt;strong&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}]&lt;br /&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}\1.0]@="VideoLAN VLC ActiveX Plugin"&lt;br /&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}\1.0\0]&lt;br /&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}\1.0\0\win32]@="C:\\$PATH\\VideoLAN\\VLC\\axvlc.dll"&lt;br /&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}\1.0\FLAGS]@="0"&lt;br /&gt;[HKEY_CLASSES_ROOT\TypeLib\{DF2BBE39-40A8-433B-A279-073F48DA94B6}\1.0\HELPDIR]@="C:\\$PATH\\VideoLAN\\VLC"&lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-4030952180174521872?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/4030952180174521872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=4030952180174521872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/4030952180174521872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/4030952180174521872'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2007/10/vlc-vlc-cannot-insert-to-ie-browser-by.html' title='VLC, Vlc cannot insert to IE browser by Javscript innerHTML function'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-115471979429349481</id><published>2006-08-04T12:08:00.000-07:00</published><updated>2006-08-09T16:32:37.850-07:00</updated><title type='text'>ATSC-EPG- Learning Day1</title><content type='html'>First, we need to get the Demux file,&lt;br /&gt;&lt;span style="font-size:78%;color:#999999;"&gt;IMpeg2Demultiplexer *pDemux = NULL;&lt;br /&gt;hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph,IID_IMpeg2Demultiplexer, (void**)&amp;pDemux);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;**, Create a IMPEG2pPIDMAP&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#999999;"&gt;// Map the PID.&lt;br /&gt;IMPEG2PIDMap *pPidMap = NULL;&lt;br /&gt;hr = pPin-&gt;QueryInterface(IID_IMPEG2PIDMap, (void**)&amp;pPidMap);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;ULONG Pid[] = { 0x00 }; // Map any desired PIDs.&lt;br /&gt;ULONG cPid = 1;&lt;br /&gt;hr = pPidMap-&gt;MapPID(cPid, Pid, MEDIA_MPEG2_PSI);&lt;br /&gt;pPidMap-&gt;Release();&lt;br /&gt;}&lt;br /&gt;pPin-&gt;Release();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;**.. Or, you can search the IMpeg2Data&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#999999;"&gt;const IID IID_IMpeg2Data = {0x9B396D40, 0xF380, 0x4e3c, 0xA5, 0x14, 0x1A,0x82, 0xBF, 0x6E, 0xBF, 0xE6}; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#999999;"&gt;IMpeg2Data *pMPEG = NULL;&lt;br /&gt;hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph, IID_IMpeg2Data, (void**)&amp;pMPEG);&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#999999;"&gt;&lt;/span&gt;&lt;br /&gt;**. Create a new pDemux and PIDMap&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#999999;"&gt;//-------------&lt;br /&gt;// Query the demux filter for IMpeg2Demultiplexer.&lt;br /&gt;IMpeg2Demultiplexer *pDemux = NULL;&lt;br /&gt;hr = pieHIPDVRGraph-&gt;QueryInterface(IID_IMpeg2Demultiplexer, (void**)&amp;pDemux);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;// Define the media type.&lt;br /&gt;AM_MEDIA_TYPE mt;&lt;br /&gt;ZeroMemory(&amp;mt, sizeof(AM_MEDIA_TYPE));&lt;br /&gt;mt.majortype = KSDATAFORMAT_TYPE_MPEG2_SECTIONS;&lt;br /&gt;mt.subtype = MEDIASUBTYPE_None;&lt;br /&gt;&lt;br /&gt;// Create a new output pin.&lt;br /&gt;IPin *pPin;&lt;br /&gt;hr = pDemux-&gt;CreateOutputPin(&amp;mt, L"PSI Pin", &amp;amp;amp;amp;amp;amp;amp;pPin);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;// Map the PID.&lt;br /&gt;IMPEG2PIDMap *pPidMap = NULL;&lt;br /&gt;hr = pPin-&gt;QueryInterface(IID_IMPEG2PIDMap, (void**)&amp;pPidMap);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;ULONG Pid[] = { 0x00 }; // Map any desired PIDs.&lt;br /&gt;ULONG cPid = 1;&lt;br /&gt;hr = pPidMap-&gt;MapPID(cPid, Pid, MEDIA_MPEG2_PSI);&lt;br /&gt;pPidMap-&gt;Release();&lt;br /&gt;}&lt;br /&gt;pPin-&gt;Release();&lt;br /&gt;}&lt;br /&gt;pDemux-&gt;Release();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//-------------&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;* Get PSIP data function is below, for get the MGT data. (Working)&lt;br /&gt;(5+)&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/gettingmpeg2psitables.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/gettingmpeg2psitables.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;color:#999999;"&gt;hr = pieHIPDVRGraph-&gt;QueryInterface (&amp;this-&gt;pieHIPDVRControl);&lt;br /&gt;hr = this-&gt;pieHIPDVRControl-&gt;Run();&lt;br /&gt;&lt;br /&gt;//Start EPG --------------------&lt;br /&gt;// (5+) http://forums.dvbowners.com/lofiversion/index.php/t1117.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;const IID IID_IMpeg2Data = {0x9B396D40, 0xF380, 0x4e3c, 0xA5, 0x14, 0x1A,0x82, 0xBF, 0x6E, 0xBF, 0xE6};&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;IIPDVDec *pDvDec=NULL;&lt;br /&gt;IMpeg2Demultiplexer *pDemux = NULL;&lt;br /&gt;hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph, IID_IMpeg2Demultiplexer, (void**)&amp;pDemux);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;// IMpeg2Data *pMPEG = NULL;&lt;br /&gt;// Initialize pMPEG by searching the graph for a filter that exposes the&lt;br /&gt;// IMpeg2Data interface (not shown). Run the graph to get MPEG-2 data.&lt;br /&gt;// CLSID_MPEG-2 Sections and Tables&lt;br /&gt;&lt;br /&gt;hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph, IID_IMpeg2Data, (void**)&amp;(this-&gt;g_pMPEG)); //pMPEG);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;GetEPG(this-&gt;g_pMPEG);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;pDemux-&gt;Release();&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;// Some other error occurred.&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;#ifdef _DEBUG&lt;br /&gt;m_FunCPoGraphBuilderSupport1.POSaveGraphFile(pieHIPDVRGraph,L"C:\\3.grf");&lt;br /&gt;#endif&lt;br /&gt;//End EPG ------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//---------------------------------------------------------------------&lt;br /&gt;//---------------------------------------------------------------------&lt;br /&gt;//---------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HRESULT CieHIPDVRGraphBuilder::GetEPG(IMpeg2Data *i_pMPEG)&lt;br /&gt;{ HRESULT hr = S_OK;&lt;br /&gt;ISectionList *pSectionList = NULL;&lt;br /&gt;/*&lt;br /&gt;pid=0, tid=0; ok, It is for call Program Association Table&lt;br /&gt;pid=0x1ffb tid=c7; ok, MGT&lt;br /&gt;pid = 7424; tid = 0xcb;&lt;br /&gt;*/&lt;br /&gt;static PID pid = 0x1ffb; //0xc7; //0x00;//0x00;&lt;br /&gt;TID tid = 0x1ffb; //0xcb; //0x00;&lt;br /&gt;DWORD dwTimeout = 500; // msec&lt;br /&gt;// pid=7424;&lt;br /&gt;// PID pid2 =pid;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;hr = i_pMPEG-&gt;GetSection(pid, tid, NULL, dwTimeout, &amp;pSectionList);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;// Use pSectionList to access the data&lt;br /&gt;// 060804 1608 start get the data&lt;br /&gt;WORD cSections;&lt;br /&gt;hr = pSectionList-&gt;GetNumberOfSections(&amp;cSections);&lt;br /&gt;for (WORD i = 0; i &lt; hr =" pSectionList-"&gt;GetSectionData(i, &amp;cbSize, &amp;amp;pSection);&lt;br /&gt;if (SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;m_FunCPoGraphBuilderSupport1.PrintMpeg2Section(pSection, cbSize);&lt;br /&gt;// Examine the data contained in pSection.&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// 060804 1608 end get the data&lt;br /&gt;&lt;br /&gt;pSectionList-&gt;Release();&lt;br /&gt;}&lt;br /&gt;}catch (CException *e)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;//------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------&lt;br /&gt;1)  Copy below code&lt;br /&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/gettingmpeg2psitables.asp&lt;br /&gt;2) Used below code to get the MPEG-2 Table and section Filter interface,&lt;br /&gt; const IID IID_IMpeg2Data = {0x9B396D40, 0xF380, 0x4e3c, 0xA5, 0x14, 0x1A,0x82, 0xBF, 0x6E, 0xBF, 0xE6}; &lt;br /&gt;   if (SUCCEEDED(hr))&lt;br /&gt;   {&lt;br /&gt;    IIPDVDec *pDvDec=NULL;&lt;br /&gt;    IMpeg2Demultiplexer *pDemux = NULL;&lt;br /&gt;    hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph, IID_IMpeg2Demultiplexer, (void**)&amp;pDemux);&lt;br /&gt;    if (SUCCEEDED(hr))&lt;br /&gt;    {&lt;br /&gt;     // IMpeg2Data *pMPEG = NULL; &lt;br /&gt;     hr = m_FunCPoGraphBuilderSupport1.FindFilterInterface(pieHIPDVRGraph, IID_IMpeg2Data, (void**)&amp;(this-&gt;g_pMPEG));   //pMPEG);&lt;br /&gt;     if (SUCCEEDED(hr))&lt;br /&gt;     {&lt;br /&gt;      this-&gt;GetEPG(this-&gt;g_pMPEG);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     pDemux-&gt;Release();&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;3) Set up Table ID and Package Identifier. &lt;br /&gt; pid=0,      tid=0; ok, It is for call Program Association Table&lt;br /&gt; pid=0x1ffb  tid=c7; ok,  MGT &lt;br /&gt; pid = 7424; tid = 0xcb; //EIT&lt;br /&gt; &lt;br /&gt;4)MGT Data struct and EIT Data Struct&lt;br /&gt; see http://www.atsc.org/standards/a_65c_with_amend_1.pdf&lt;br /&gt;http://www.atsc.org/standards/a_69.pdf&lt;br /&gt;http://www.atsc.org/standards/a_65c_with_amend_1.pdf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Refrence:&lt;br /&gt;(Software Filter )http://www.coolstf.com/tsreader/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Refrence&lt;/strong&gt;&lt;br /&gt;*.Select decoder &lt;a href="http://www.delphibbs.com/keylife/iblog_show.asp?xid=23054"&gt;http://www.delphibbs.com/keylife/iblog_show.asp?xid=23054&lt;/a&gt;&lt;br /&gt;*. Get PSI &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/usingthedemuxwithpsistreams.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/usingthedemuxwithpsistreams.asp&lt;/a&gt;&lt;br /&gt;*. &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=46331&amp;SiteID=1"&gt;http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=46331&amp;amp;SiteID=1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-115471979429349481?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/115471979429349481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=115471979429349481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/115471979429349481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/115471979429349481'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/08/atsc-epg-learning-day1.html' title='ATSC-EPG- Learning Day1'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114470172502996771</id><published>2006-04-10T13:25:00.003-07:00</published><updated>2006-04-10T17:34:13.326-07:00</updated><title type='text'>C#-DB-Create a Access DB</title><content type='html'>&lt;strong&gt;Below code is a way to create a Access DB by Database.&lt;/strong&gt;&lt;br /&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;Q307283&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void btnCreateDataBase_Click(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;SqlDataReader reader = null; &lt;br /&gt;SqlConnection myConn = new SqlConnection("Server=serverName;uid=sa;pwd=;database=");&lt;br /&gt;&lt;br /&gt;SqlCommand myCommand = new SqlCommand("CREATE DATABASE test ON PRIMARY"&lt;br /&gt;+"(Name=test_data,filename = 'C:\\myDatabase\\test_data.mdf',size=3,"&lt;br /&gt;+"maxsize=5,filegrowth=10%)log on"&lt;br /&gt;+"(name=test_log,filename='C:\\myDatabase\\test_log.ldf',size=3,"&lt;br /&gt;+"maxsize=20,filegrowth=1)",myConn);&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;myConn.Open();&lt;br /&gt;reader = myCommand.ExecuteReader();&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;Console.Write(e.ToString());&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if (reader != null)&lt;br /&gt;reader.Close();&lt;br /&gt;if (myConn.State == ConnectionState.Open)&lt;br /&gt;myConn.Close();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;http://www.codeproject.com/dotnet/ExportToExcel.asp?df=100&amp;forumid=146533&amp;exp=0&amp;select=1357703&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Data.OleDb;&lt;br /&gt;&lt;br /&gt;private static OleDbConnection GetConnection(string filePath ) &lt;br /&gt;{&lt;br /&gt;return new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties=\"Excel 8.0;HDR=YES;\"");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static void exportToExcel(DataTable dt, string fileName)&lt;br /&gt;{&lt;br /&gt;#region initialization&lt;br /&gt;//if the file already exists then delete it&lt;br /&gt;System.IO.FileInfo fi = new System.IO.FileInfo(fileName);&lt;br /&gt;if (fi.Exists)&lt;br /&gt;{&lt;br /&gt;fi.Delete();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//set the table name if its not there&lt;br /&gt;if (dt.TableName == string.Empty)&lt;br /&gt;{&lt;br /&gt;dt.TableName = "Sheet1";&lt;br /&gt;}&lt;br /&gt;else//remove $ from table name if it is there&lt;br /&gt;{&lt;br /&gt;dt.TableName = dt.TableName.Replace("$",string.Empty);&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;string sql = GetTableCreationSql(dt);&lt;br /&gt;OleDbConnection connection = GetConnection(fileName);&lt;br /&gt;OleDbCommand command = new OleDbCommand();&lt;br /&gt;command.Connection = connection;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;#region Create table&lt;br /&gt;command.CommandText = GetTableCreationSql(dt);&lt;br /&gt;command.Connection.Open();&lt;br /&gt;command.ExecuteNonQuery();&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;#region Insert Into Table&lt;br /&gt;&lt;br /&gt;command.CommandText = GetInsertSql(dt);&lt;br /&gt;&lt;br /&gt;foreach(DataRow row in dt.Rows)&lt;br /&gt;{&lt;br /&gt;SetParametersInCommand(row, command);&lt;br /&gt;command.ExecuteNonQuery();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#endregion&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;command.Connection.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/// &lt;br /&gt;/// form a string which should be the sqlCommand for creating Table in oleDB&lt;br /&gt;/// &lt;br /&gt;/// &lt;br /&gt;/// create table [tableName] ( Column1 type, ..., Columnn Type)&lt;br /&gt;private static string GetTableCreationSql(DataTable dt)&lt;br /&gt;{&lt;br /&gt;StringBuilder sqlBuilder = new StringBuilder();&lt;br /&gt;sqlBuilder.Append("create table [");&lt;br /&gt;sqlBuilder.Append(dt.TableName);&lt;br /&gt;sqlBuilder.Append( "] ( " );&lt;br /&gt;&lt;br /&gt;#region Get Column List&lt;br /&gt;//Create a list of column names and their data types, e.g&lt;br /&gt;//[ColumnName1] nvarchar, [ColumnName2] nvarchar,...[ColumnNamen] nvarchar&lt;br /&gt;foreach(DataColumn col in dt.Columns)&lt;br /&gt;{&lt;br /&gt;if (col.Ordinal== 0)&lt;br /&gt;sqlBuilder.Append( "[" );&lt;br /&gt;else&lt;br /&gt;sqlBuilder.Append( ", [" );&lt;br /&gt;&lt;br /&gt;sqlBuilder.Append(col.ColumnName.Trim());&lt;br /&gt;sqlBuilder.Append("] nvarchar");&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;sqlBuilder.Append(" )"); &lt;br /&gt;&lt;br /&gt;return sqlBuilder.ToString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/// &lt;br /&gt;/// form a insert statement to insert data into oleDB&lt;br /&gt;/// &lt;br /&gt;/// &lt;br /&gt;/// Insert Into tableName ([ColumnName1], [ColumnName2] ,...[ColumnNamen]) values (?,?,..,?) &lt;br /&gt;private static string GetInsertSql(DataTable dt)&lt;br /&gt;{&lt;br /&gt;StringBuilder sqlBuilder = new StringBuilder();&lt;br /&gt;StringBuilder paramMarks = new StringBuilder();&lt;br /&gt;sqlBuilder.Append("Insert Into [");&lt;br /&gt;sqlBuilder.Append(dt.TableName);&lt;br /&gt;sqlBuilder.Append( "] ( " );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#region Get Column List&lt;br /&gt;//Create a list of column names and their place holders&lt;br /&gt;//[ColumnName1] , [ColumnName2] ,...[ColumnNamen] &lt;br /&gt;// ?,?,...?&lt;br /&gt;foreach(DataColumn col in dt.Columns)&lt;br /&gt;{&lt;br /&gt;if (col.Ordinal == 0)&lt;br /&gt;{&lt;br /&gt;sqlBuilder.Append( "[" );&lt;br /&gt;paramMarks.Append( "?" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;sqlBuilder.Append( ", [");&lt;br /&gt;paramMarks.Append(",?");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sqlBuilder.Append(col.ColumnName.Trim());&lt;br /&gt;sqlBuilder.Append( "] " );&lt;br /&gt;}&lt;br /&gt;#endregion&lt;br /&gt;&lt;br /&gt;sqlBuilder.Append(" ) values ("); &lt;br /&gt;sqlBuilder.Append(paramMarks.ToString() );&lt;br /&gt;sqlBuilder.Append( ")" );&lt;br /&gt;&lt;br /&gt;return sqlBuilder.ToString();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private static void SetParametersInCommand(DataRow row, OleDbCommand command)&lt;br /&gt;{&lt;br /&gt;UnicodeEncoding en = new UnicodeEncoding();&lt;br /&gt;string argumentName= string.Empty;&lt;br /&gt;int index = 0;&lt;br /&gt;foreach(DataColumn col in row.Table.Columns)&lt;br /&gt;{&lt;br /&gt;argumentName = "@Args" + index;&lt;br /&gt;command.Parameters.Add( new OleDbParameter(argumentName, OleDbType.VarBinary)).Value = &lt;br /&gt;en.GetBytes(row[ col ].ToString());&lt;br /&gt;index++;&lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Sanjeev Kumar Singh,(sanjeevofbcs@hotmail.com)&lt;br /&gt;MTS,&lt;br /&gt;Persistent System Pvt Ltd&lt;br /&gt;(http://www.persistentsys.com/)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114470172502996771?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114470172502996771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114470172502996771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114470172502996771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114470172502996771'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/04/c-db-create-access-db_114470172502996771.html' title='C#-DB-Create a Access DB'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114375385135379461</id><published>2006-03-30T13:22:00.000-08:00</published><updated>2006-04-10T13:43:14.463-07:00</updated><title type='text'>AJAX-- nice web site</title><content type='html'>www.meebo.com&lt;br /&gt;&lt;br /&gt;Music player&lt;br /&gt;http://www.pandora.com/ &lt;br /&gt;&lt;br /&gt;Deitel AJAX Resource Center&lt;br /&gt;http://www.deitel.com/ajax/AJAX_resourcecenter.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It was very interesting. A lot of Web 2.0 companies where presenting and demoing their technology.&lt;br /&gt;Among them were Sphere, Meebo, Healthline, Wink, Flock, Pandora, Zvents, Loomia, Goowy, RealTravel, TailRank, MeasureMap. Most of them revolve around the blog / bloggers sphere.&lt;br /&gt;&lt;br /&gt;The Web 2.0 business model is scary. None of these companies have a clear plan for revenue. It seems like most of the Web 2.0 companies are think tanks or research-oriented technologies whose only goal is to be purchased by a big Web portal (google, yahoo, etc).&lt;br /&gt;&lt;br /&gt;Sphere, Wink, Flock, Zvents, TailRank are all about blogs and similar user-contributed content.&lt;br /&gt;I couldn't see any method other than advertising to generate revenue. When you only have 3 big players for the advertising market today -- Google, Yahoo, and MSN -- the only exit is a purchase.&lt;br /&gt;The key for these companies seems to be user adoption. The more users they have and the bigger their community is the more likely they will be able to get some value out of it.&lt;br /&gt;&lt;br /&gt;Pandora and Loomia are about podcasting and music, both very interesting and complementary technology.&lt;br /&gt;&lt;br /&gt;Goowy is a MS Exchange killer using Macromedia Flash. It looks good, but with free open source players like Zimbra, Hula, Open Exchange, Kolab, RoundCube they have serious competition.&lt;br /&gt;&lt;br /&gt;Meebo is an interesting technology for a web based instant messaging system, but it's not currently building a community of users, so I am not sure what their plans are.&lt;br /&gt;&lt;br /&gt;RealTravel is a user-contributed travel guide -- very nice, with a clever way to build traffic with high quality user-contributed content. But I see it as a niche market.&lt;br /&gt;&lt;br /&gt;Healthline was probably the best technology I've seen. Especially after listening to Adam Bosworth (Google VP of Engineering) talking about upcoming new types of searches (such as medical searches). It's an intelligent and tool-rich search for health-related information. It reminds me of a company I saw at the Santa Barbara Tech Coast Angel presentation.&lt;br /&gt;&lt;br /&gt;MeasureMap is a web traffic report for Blogs. The user interface is very nice.&lt;br /&gt;&lt;br /&gt;I've learned a lot by looking at these technologies. There are a lot of good ideas and user interface tricks among them, especially in terms of UI, as seen in MeasureMap.&lt;br /&gt;&lt;br /&gt;It comforts me to see that we have a good business model with revenue as well as all the components necessary to be part of this Web 2.0 trend.&lt;br /&gt;&lt;br /&gt;I would like to thank Michael for putting together such an event; it was great to be able to meet amazing entrepreneurs and smart VCs in such a casual atmosphere.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114375385135379461?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114375385135379461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114375385135379461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114375385135379461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114375385135379461'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/03/ajax-nice-web-site.html' title='AJAX-- nice web site'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114075602109144743</id><published>2006-02-23T20:36:00.000-08:00</published><updated>2006-02-23T20:40:21.093-08:00</updated><title type='text'>Digital Integrated Circuits-Week 1 PartI</title><content type='html'>$---mos1----- &lt;br /&gt;******** &lt;br /&gt;.temp=25 &lt;br /&gt;.option dccap=1 scale=1u post &lt;br /&gt;.param vd=3 vg=1.5 vs=0 &lt;br /&gt;$------- &lt;br /&gt;vd1 d 0 vd &lt;br /&gt;vg1 g 0 vg &lt;br /&gt;vss vss 0 vs &lt;br /&gt;mn1 d g vss vss ns w=10 l=0.3 &lt;br /&gt;$----- &lt;br /&gt;.dc vd1 0 3 0.05 sweep vg1 1 3 0.5 &lt;br /&gt;.op &lt;br /&gt;.probe i(mn1) &lt;br /&gt;$======================== &lt;br /&gt;$.model ps pmos &lt;br /&gt;$+ level=1 &lt;br /&gt;$+ acm=3 capop=1 &lt;br /&gt;$$----- &lt;br /&gt;$+ ld=0.05u wd=0.1u hdif=0.4u rsh=8 &lt;br /&gt;$$----- &lt;br /&gt;$+ vt0=-0.7 tox=60 ub=200 &lt;br /&gt;$+ gamma=0.6 lambda=0.05 &lt;br /&gt;$+ js=1m jsw=1n cj=1m cjsw=1n cjgate=0.5n mj=0.5 mjsw=0.3 pb=0.6 php=0.6 &lt;br /&gt;$$========================= &lt;br /&gt;.model ns nmos &lt;br /&gt;+ level=1 &lt;br /&gt;+ acm=3 capop=1 &lt;br /&gt;$+ theta=0.6 vmax=3e5 kappa=0.6 &lt;br /&gt;$----- &lt;br /&gt;+ ld=0.05u wd=0.1u hdif=0.4u rsh=8 &lt;br /&gt;$----- &lt;br /&gt;+ vt0=0.7 tox=60 ub=450 &lt;br /&gt;+ gamma=0.6 &lt;br /&gt;+lambda=0.05 &lt;br /&gt;+ js=1m jsw=1n cj=1m cjsw=1n cjgate=0.5n mj=0.5 mjsw=0.3 pb=0.6 php=0.6 &lt;br /&gt;$------- &lt;br /&gt;.end&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114075602109144743?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114075602109144743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114075602109144743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114075602109144743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114075602109144743'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/digital-integrated-circuits-week-1_23.html' title='Digital Integrated Circuits-Week 1 PartI'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114075570581639935</id><published>2006-02-23T20:13:00.000-08:00</published><updated>2006-02-23T20:35:05.826-08:00</updated><title type='text'>Digital Integrated Circuits-Week 1</title><content type='html'>&lt;strong&gt;MOS.TXT&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#999999;"&gt;$--- mos ---&lt;br /&gt;******&lt;br /&gt;.temp=25&lt;br /&gt;.option dccap=1 scale=1u nopage&lt;br /&gt;.param vd=3 vg=1.5 vs=0&lt;br /&gt;$-------&lt;br /&gt;vd1 d 0 vd&lt;br /&gt;vg1 g 0 vg&lt;br /&gt;vss vss 0 vs&lt;br /&gt;mn1 d g vss vss ns w=10 l=0.3&lt;br /&gt;$-----&lt;br /&gt;.dc vd1 0 3 0.05 sweep vg1 1 3 0.5&lt;br /&gt;.op&lt;br /&gt;.probe i(mn1)&lt;br /&gt;$========================&lt;br /&gt;$.model ps pmos&lt;br /&gt;$+ level=1&lt;br /&gt;$+ acm=3 capop=1&lt;br /&gt;$$-----&lt;br /&gt;$+ ld=0.05u wd=0.1u hdif=0.4u rsh=8&lt;br /&gt;$$-----&lt;br /&gt;$+ vt0=-0.7 tox=60 ub=200&lt;br /&gt;$+ gamma=0.6 lambda=0.05&lt;br /&gt;$+ js=1m jsw=1n cj=1m cjsw=1n cjgate=0.5n mj=0.5 mjsw=0.3 pb=0.6 php=0.6&lt;br /&gt;$$=========================&lt;br /&gt;.model ns nmos&lt;br /&gt;+ level=1&lt;br /&gt;+ acm=3 capop=1&lt;br /&gt;$-----&lt;br /&gt;+ ld=0.05u wd=0.1u hdif=0.4u rsh=8&lt;br /&gt;$-----&lt;br /&gt;+ vt0=0.7 tox=60 ub=450&lt;br /&gt;+ gamma=0.6 lambda=0.05&lt;br /&gt;+ js=1m jsw=1n cj=1m cjsw=1n cjgate=0.5n mj=0.5 mjsw=0.3 pb=0.6 php=0.6&lt;br /&gt;$-------&lt;br /&gt;.end&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114075570581639935?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114075570581639935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114075570581639935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114075570581639935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114075570581639935'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/digital-integrated-circuits-week-1.html' title='Digital Integrated Circuits-Week 1'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114073829948657956</id><published>2006-02-23T14:57:00.001-08:00</published><updated>2006-08-04T14:29:29.236-07:00</updated><title type='text'>IIS-Cassini</title><content type='html'>&lt;strong&gt;I'm coming dear Cassini&lt;/strong&gt;&lt;br /&gt;I hear cassini this program for a while time,&lt;br /&gt;luckly, right now has chance to learn and research the cassini.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Refrence:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;893391"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;893391&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the Cassini Web server?&lt;/strong&gt;&lt;br /&gt;The Cassini Web server is a simple, fully managed Web server that hosts ASP.NET. The Cassini Web server is a combination of the following:&lt;br /&gt;•A simple HTTP listener that was built by using System.Net.Sockets.&lt;br /&gt;•A hosting sample of ASP.NET that was built by using System.Web.Hosting APIs. This lets you host ASP.NET from any managed application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some known functionality limitations of the Cassini Web server?&lt;/strong&gt;&lt;br /&gt;•It can host only one ASP.NET application per port.&lt;br /&gt;•It does not support HTTPS.&lt;br /&gt;•It does not support authentication.&lt;br /&gt;•It responds only to localhost requests.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Where can get the Cassini&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Is the Cassini Web server open-source software?&lt;/strong&gt;&lt;br /&gt;Although the source code for the public version of the Cassini Web server is available for download, the instance of the Cassini Web server that is installed with the Outlook client is not an open-source product.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114073829948657956?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114073829948657956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114073829948657956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114073829948657956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114073829948657956'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/iis-cassini.html' title='IIS-Cassini'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114073830338147609</id><published>2006-02-23T14:57:00.000-08:00</published><updated>2006-02-23T15:45:05.766-08:00</updated><title type='text'>IIS-Cassini</title><content type='html'>&lt;strong&gt;I'm coming dear Cassini&lt;/strong&gt;&lt;br /&gt;I hear cassini this program for a while time,&lt;br /&gt;luckly, right now has chance to learn and research the cassini.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Refrence:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;893391"&gt;http://support.microsoft.com/default.aspx?scid=kb;en-us;893391&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is the Cassini Web server?&lt;/strong&gt;&lt;br /&gt;The Cassini Web server is a simple, fully managed Web server that hosts ASP.NET. The Cassini Web server is a combination of the following:&lt;br /&gt;•A simple HTTP listener that was built by using System.Net.Sockets.&lt;br /&gt;•A hosting sample of ASP.NET that was built by using System.Web.Hosting APIs. This lets you host ASP.NET from any managed application.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What are some known functionality limitations of the Cassini Web server?&lt;/strong&gt;&lt;br /&gt;•It can host only one ASP.NET application per port.&lt;br /&gt;•It does not support HTTPS.&lt;br /&gt;•It does not support authentication.&lt;br /&gt;•It responds only to localhost requests.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Where can get the Cassini&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Is the Cassini Web server open-source software?&lt;/strong&gt;&lt;br /&gt;Although the source code for the public version of the Cassini Web server is available for download, the instance of the Cassini Web server that is installed with the Outlook client is not an open-source product.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114073830338147609?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114073830338147609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114073830338147609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114073830338147609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114073830338147609'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/iis-cassini_23.html' title='IIS-Cassini'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-114056084494036290</id><published>2006-02-21T14:26:00.000-08:00</published><updated>2006-02-21T14:27:24.956-08:00</updated><title type='text'>C#-Thread-Passing Parameters to Threads</title><content type='html'>&lt;p&gt;&lt;strong&gt;Passing Parameters to Threads&lt;br /&gt;&lt;/strong&gt;Often when you start a thread, you want to give it some parameters - usually some data it has to process, a queue to wait on, etc. The ThreadStart delegate doesn't take any parameters, so the information has to be stored somewhere else if you are going to create a new thread yourself. Typically, this means creating a new instance of a class, and using that instance to store the information. Often the class itself can contain the delegate used for starting the thread. For example, we might have a program which needs to fetch the contents of various URLs, and wants to do it in the background. You could write code like this:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#999999;"&gt;public class UrlFetcher&lt;br /&gt;{&lt;br /&gt;string url&lt;br /&gt;public UrlFetcher (string url)&lt;br /&gt;{&lt;br /&gt;this.url = url;&lt;br /&gt;}&lt;br /&gt;public void Fetch()&lt;br /&gt;{&lt;br /&gt;// use url here&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;[... in a different class ...]&lt;br /&gt;&lt;br /&gt;UrlFetcher fetcher = new UrlFetcher (myUrl);&lt;br /&gt;new Thread (new ThreadStart (fetcher.Fetch)).Start();&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-114056084494036290?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/114056084494036290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=114056084494036290' title='100 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114056084494036290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/114056084494036290'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/c-thread-passing-parameters-to-threads.html' title='C#-Thread-Passing Parameters to Threads'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>100</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-113912095247061073</id><published>2006-02-04T19:48:00.000-08:00</published><updated>2006-08-09T16:33:11.573-07:00</updated><title type='text'>JS- XML and JavaScript</title><content type='html'>&lt;strong&gt;XML and JavaScript&lt;/strong&gt;&lt;br /&gt;Introduction:XML is a very important base on which Web Services work. XML can be used in conjunction with a lot of client side and server side languages to put it to good effect. Let us see how we can use XML and client side JavaScript to work. We will see how we can display the contents of a XML file using JavaScript, accessing child elements, manipulating elements etc. Browser Issues:When it comes client side languages browser incompatibilities is a major issue. But here where we want to use XML and JavaScript, XML is the issue. Not all browsers have support for parsing XML documents. I will use IE6 to explain the codes. Browsers that do not support XML, cannot read them. When you view an XML file in such a browser it will just ignore all the tags. S&lt;br /&gt;ample XML file:Let us consider a sample XML file &gt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#999999;"&gt;&lt;?xml version="1.0" ?&gt;&lt;company&gt;&lt;employee id="001" sex="M" age="19"&gt;Premshree Pillai&lt;/employee&gt;&lt;employee id="002" sex="M" age="24"&gt;Kumar Singh&lt;/employee&gt;&lt;employee id="003" sex="F" age="21"&gt;Suhasini Pandita&lt;/employee&gt;&lt;turnover&gt;&lt;year id="2000"&gt;100,000&lt;/year&gt;&lt;year id="2001"&gt;140,000&lt;/year&gt;&lt;year id="2002"&gt;200,000&lt;/year&gt;&lt;/turnover&gt;&lt;/company&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above XML file shows employee data and Turnover of the company (just an e.g).Manipulating XML file data using JavaScript:&lt;br /&gt;&lt;br /&gt;Loading XML file: You can load a XML fie from JavaScript like this &gt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#999999;"&gt;var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");&lt;br /&gt;function loadXML(xmlFile)&lt;br /&gt;{&lt;br /&gt;xmlDoc.async="false";&lt;br /&gt;xmlDoc.onreadystatechange=verify;&lt;br /&gt;xmlDoc.load(xmlFile);&lt;br /&gt;xmlObj=xmlDoc.documentElement;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Actually, just the last two lines of the function are enough to load the XML file. It is very easy then you think, The previous two lines are written to ensure that the JavaScript functions that we may use later to manipulate the XML file data, does not perform any function on an uninitialized object. Thus the function verify()is called.&lt;br /&gt;&lt;br /&gt;function verify()&lt;br /&gt;{&lt;br /&gt;// 0 Object is not initialized&lt;br /&gt;// 1 Loading object is loading data&lt;br /&gt;// 2 Loaded object has loaded data&lt;br /&gt;// 3 Data from object can be worked with&lt;br /&gt;// 4 Object completely initialized&lt;br /&gt;if (xmlDoc.readyState != 4)&lt;br /&gt;{&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now the XML file can be loadedloadXML('xml_file.xml');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;source from:&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.a1javascripts.com/tutorials/xml.html"&gt;http://www.a1javascripts.com/tutorials/xml.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-113912095247061073?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/113912095247061073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=113912095247061073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113912095247061073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113912095247061073'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/02/js-xml-and-javascript.html' title='JS- XML and JavaScript'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-113865843817793764</id><published>2006-01-30T13:59:00.000-08:00</published><updated>2006-01-30T14:07:51.320-08:00</updated><title type='text'>VC-SYS-Get current APP working directory.</title><content type='html'>&lt;strong&gt;How to set the current working directory?&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;if(::SetCurrentDirectory("c:\\test") == FALSE)&lt;br /&gt;// Error -&gt; call 'GetLastError()'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to Get the current working directory?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;char  CurPath[MAX_PATH];　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;DWORD size=MAX_PATH;　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;GetCurrentDirectory(size,CurPath);　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;AfxMessageBox(CurPath);　　　　//　　CString number;　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;int len = LineLength(LineIndex(0));　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;LPTSTR p=number.GetBuffer(len);　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;color:#999999;"&gt;this-&gt;GetLine(0,p,len);　　&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;span style="color:#999999;"&gt;AfxMessageBox(number);　&lt;/span&gt;　&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000000;"&gt;Refrence:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getcurrentdirectory.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getcurrentdirectory.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-113865843817793764?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/113865843817793764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=113865843817793764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113865843817793764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113865843817793764'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/01/vc-sys-get-current-app-working.html' title='VC-SYS-Get current APP working directory.'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-113857889584929119</id><published>2006-01-29T15:41:00.000-08:00</published><updated>2006-01-29T15:54:55.856-08:00</updated><title type='text'>MDI-Get the view rect size.</title><content type='html'>void CEx08bView::OnInitialUpdate()&lt;br /&gt;{&lt;br /&gt;    CView::OnInitialUpdate();&lt;br /&gt;    CRect rectClient; GetClientRect(rectClient);&lt;br /&gt; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-113857889584929119?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/113857889584929119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=113857889584929119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113857889584929119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113857889584929119'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/01/mdi-get-view-rect-size.html' title='MDI-Get the view rect size.'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-113840039741370207</id><published>2006-01-27T14:01:00.000-08:00</published><updated>2006-01-28T15:43:00.586-08:00</updated><title type='text'>DVB and ATSC Q&amp;A</title><content type='html'>Turn space:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-113840039741370207?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/113840039741370207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=113840039741370207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113840039741370207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113840039741370207'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/01/dvb-and-atsc-qa.html' title='DVB and ATSC Q&amp;A'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-21179294.post-113839300474002296</id><published>2006-01-27T12:11:00.000-08:00</published><updated>2006-01-30T16:59:29.450-08:00</updated><title type='text'>TV-Get the SignalQuality from ASTC and DVBT -Day1 -Done</title><content type='html'>&lt;span style="color:#000066;"&gt;Target:&lt;/span&gt; &lt;strong&gt;Get the SignalQuality from ASTC and DVBT -Done&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. It has problem to get the Singal in kworld card. but Prolink is working.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000066;"&gt;Origial code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#999999;"&gt;&lt;span style="color:#666666;"&gt;HRESULT spb_IEHIPbdaTV::GetSignalStatistics(long &amp;iLOCKED, long &amp;amp;iSTRENGTH, long &amp;iQUALITY, long &amp;amp;iSIGNAL,long &amp;iFrequency )&lt;br /&gt;{&lt;br /&gt;HRESULT hr = S_OK;&lt;br /&gt;BOOLEAN locked;&lt;br /&gt;long strength;&lt;br /&gt;long quality;&lt;br /&gt;BOOLEAN present;&lt;br /&gt;&lt;br /&gt;CComPtr &lt;ibda_topology&gt;bdaNetTop;&lt;br /&gt;/*&lt;br /&gt;The IBDA_Topology interface is implemented on BDA device filters.&lt;br /&gt;A single filter may represent multiple hardware devices (called control nodes)&lt;br /&gt;which may be connected in various ways within the filter itself.&lt;br /&gt;These connections generally represent hardware paths on the card.&lt;br /&gt;This interface provides methods that enable a Network Provider to&lt;br /&gt;configure or discover the types of nodes within the filter, and how these nodes are connected.&lt;br /&gt;The methods correspond closely to the Ring 0 property sets which are documented in the Windows DDK.&lt;br /&gt;*/&lt;br /&gt;hr = this-&gt;GpTUNERDEVICE.QueryInterface(&amp;bdaNetTop);&lt;br /&gt;if(SUCCEEDED(hr))&lt;br /&gt;{&lt;br /&gt;CComPtr &lt;iunknown&gt;unknown;&lt;br /&gt;// Retrieves an IUnknown interface pointer for a specified control node.&lt;br /&gt;hr = bdaNetTop-&gt;GetControlNode(0, 1, BDA_TWINHAN_DEMODULATOR_NODE, &amp;unknown);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : GetControlNode BDA_TWINHAN_DEMODULATOR_NODE",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;CComPtr &lt;ibda_signalstatistics&gt;pSigStats;&lt;br /&gt;hr = unknown.QueryInterface(&amp;pSigStats);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : IBDA_SignalStatistics QI",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;long quality = -2;&lt;br /&gt;hr = pSigStats-&gt;get_SignalQuality(&amp;quality);&lt;br /&gt;iQUALITY = quality;&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;// this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : get_SignalQuality()",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;BOOLEAN locked = FALSE;&lt;br /&gt;//long locked = -2;&lt;br /&gt;hr = pSigStats-&gt;get_SignalLocked(&amp;locked);&lt;br /&gt;iLOCKED = locked;&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;// this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : get_SignalLocked()",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;CComPtr &lt;iunknown&gt;unknown2;&lt;br /&gt;hr = bdaNetTop-&gt;GetControlNode(0, 1, BDA_TWINHAN_TUNER_NODE, &amp;unknown2);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : GetControlNode BDA_TWINHAN_TUNER_NODE",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;CComPtr &lt;ibda_signalstatistics&gt;pSigStats2;&lt;br /&gt;hr = unknown2.QueryInterface(&amp;pSigStats2);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : IBDA_SignalStatistics QI",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;long strength = -1;&lt;br /&gt;hr = pSigStats2-&gt;get_SignalStrength(&amp;strength);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : get_SignalStrength()",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;iSTRENGTH = strength;&lt;br /&gt;}&lt;br /&gt;BOOLEAN present = FALSE;&lt;br /&gt;hr = pSigStats2-&gt;get_SignalPresent(&amp;present);&lt;br /&gt;if (FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : get_SignalPresent()",hr);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;iSIGNAL = present;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - GetSignalStatistics : IBDA_Topology QI",hr);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/////////&lt;br /&gt;// HRESULT hr;&lt;br /&gt;TCHAR BUFFER[128];&lt;br /&gt;// (*numFound) = 0;&lt;br /&gt;ProgramINFO info;&lt;br /&gt;CComPtr&lt;itunerequest&gt; piTuneRequest;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if (this-&gt;GpNETWORKPROVIDER == NULL)&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : GpNETWORKPROVIDER NULL",E_FAIL);&lt;br /&gt;return E_FAIL;&lt;br /&gt;}&lt;br /&gt;CComQIPtr &lt;ituner&gt;LpTUNER(this-&gt;GpNETWORKPROVIDER);&lt;br /&gt;&lt;br /&gt;hr = LpTUNER-&gt;get_TuneRequest(&amp;piTuneRequest);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : LpTUNER-&gt;get_TuneRequest(&amp;piTuneRequest)",E_FAIL);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CComPtr&lt;ilocator&gt; pILocator;&lt;br /&gt;hr = piTuneRequest-&gt;get_Locator(&amp;pILocator);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : piTuneRequest-&gt;get_Locator()",E_FAIL);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;hr = pILocator-&gt;get_CarrierFrequency(&amp;iFrequency);//info.FREQ);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCLocator-&gt;get_CarrierFrequency(&amp;iFrequency)",hr); //info.TSID)",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;hr = pILocator-&gt;get_SignalStrength(&amp;iSIGNAL);//info.FREQ);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCLocator-&gt;get_CarrierFrequency(&amp;iFrequency)",hr); //info.TSID)",hr);&lt;br /&gt;return hr;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#666666;"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;return hr;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Fixed solusion:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;1. In fact, We just want have a auto scan function, and some hardware card doesn't 100% support the DirectShow function.&lt;br /&gt;2. We can used the get the TV Major and Minor to get the right data.&lt;br /&gt;if Major is some number and Minor is some number, we get the frequence is "-1" if ATSC Card get the Signal. otherwise is very big number, like xxx245&lt;br /&gt;3. Don't waster time to check the Lock, Singal,... The vaule is not 100 % can reliable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#666666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#666666;"&gt;HRESULT spb_IEHIPbdaTV::GetATSCChannel(long* lPhysicalChannel, long* lMajorChannel, long* lMinorChannel,long* iLOCKED, long* iSTRENGTH, long* iQUALITY, long* iSIGNAL,long* iFrequency )&lt;br /&gt;{&lt;br /&gt;HRESULT hr = S_OK;&lt;br /&gt;ProgramINFO info;&lt;br /&gt;&lt;br /&gt;if (this-&gt;GpNETWORKPROVIDER == NULL)&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ChangeChannel : GpNETWORKPROVIDER NULL",E_FAIL);&lt;br /&gt;return E_FAIL;&lt;br /&gt;}&lt;br /&gt;CComQIPtr &lt;ituner&gt;LpTUNER(this-&gt;GpNETWORKPROVIDER);&lt;br /&gt;CComPtr&lt;itunerequest&gt; pTuneRequestForGet;&lt;br /&gt;hr = LpTUNER-&gt;get_TuneRequest(&amp;pTuneRequestForGet);&lt;br /&gt;if (FAILED (hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ChangeChannel : Cannot submit tune request",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;//query for an IATSCChannelTuneRequest interface pointer&lt;br /&gt;CComQIPtr &lt;iatscchanneltunerequest&gt;pATSCTuneRequest(pTuneRequestForGet);&lt;br /&gt;// Set the initial major and minor channels&lt;br /&gt;//long lGetReturnMajorChannel;&lt;br /&gt;hr = pATSCTuneRequest-&gt;get_Channel(lMajorChannel); //&amp;lGetReturnMajorChannel);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;hr = pATSCTuneRequest-&gt;get_MinorChannel(lMinorChannel); //&amp;lGetReturnMajorChannel);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CComPtr&lt;ilocator&gt; pILocator;&lt;br /&gt;hr = pATSCTuneRequest-&gt;get_Locator(&amp;pILocator);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : piTuneRequest-&gt;get_Locator()",E_FAIL);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;hr = pILocator-&gt;get_CarrierFrequency(iFrequency);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCLocator-&gt;get_CarrierFrequency(&amp;info.TSID)",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CComQIPtr &lt;iatsclocator&gt;pATSCLocator(pILocator);&lt;br /&gt;if (pATSCLocator!=NULL)&lt;br /&gt;{&lt;br /&gt;hr = pATSCLocator-&gt;get_TSID(&amp;info.TSID);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCLocator-&gt;get_TSID(&amp;info.TSID)",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;// hr = pATSCLocator-&gt;get_Locator(&amp;pILocator);&lt;br /&gt;hr = pATSCLocator-&gt;get_PhysicalChannel(lPhysicalChannel); //&amp;lGetReturnMajorChannel);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;hr = pATSCTuneRequest-&gt;get_Channel(lMajorChannel);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCTuneRequest-&gt;get_Channel(&amp;info.MajorChannel)",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;hr = pATSCTuneRequest-&gt;get_MinorChannel(lMinorChannel);&lt;br /&gt;if(FAILED(hr))&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("Error : Code # %d - ScanForProgramInfo : pATSCTuneRequest-&gt;get_MinorChannel(&amp;info.MinorChannel",hr);&lt;br /&gt;return hr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;return S_OK;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void CDVBT_VIDEOMATE::OnButton3() //Auto Scan Function.&lt;br /&gt;{&lt;br /&gt;HRESULT hr;&lt;br /&gt;TCHAR tmp[256];&lt;br /&gt;CString lcstmp1,lcstmp2,lcstmp3;&lt;br /&gt;if (bdaTV-&gt;GpNETWORKPROVIDER == NULL)&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("*** Plugin File not loaded. Click LOAD PLUGIN. ***");;&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;this-&gt;mTUNINGLIST.ResetContent();&lt;br /&gt;long t_iPhy=1;&lt;br /&gt;long t_iMajor=-1;&lt;br /&gt;long t_iMinor=1;&lt;br /&gt;&lt;br /&gt;// Open a Log file for write the Channels info.&lt;br /&gt;CString TV_CStingCurTime;&lt;br /&gt;static FILE *pLogFile;&lt;br /&gt;static int isNewLog = TRUE;&lt;br /&gt;pLogFile = fopen("C:\\ATSC.log", "w"); //a+");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// This loop is for Scan the ATSC Channels,&lt;br /&gt;//&lt;br /&gt;for (t_iPhy=2; t_iPhy&lt;=158;t_iPhy++) { t_iMajor=-1; for (t_iMinor=-1;t_iMinor&lt;=12;t_iMinor++) { lcstmp1.Format("%d",t_iPhy); lcstmp2.Format("%d",t_iMajor); lcstmp3.Format("%d",t_iMinor); hr = bdaTV-&gt;ChangeATSCChannel(atol(lcstmp1),atol(lcstmp2),atol(lcstmp3)); //change Channel data&lt;br /&gt;if (hr != S_OK)&lt;br /&gt;{&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;long iLOCKED, iSIGNAL;&lt;br /&gt;long iQUALITY, iSTRENGTH,iFrequency;&lt;br /&gt;TCHAR tmp1[128],tmp2[128],tmp3[128],tmp4[128],tmp5[128];&lt;br /&gt;iLOCKED=-2;&lt;br /&gt;iSTRENGTH=-2;&lt;br /&gt;iQUALITY=-2;&lt;br /&gt;iSIGNAL=-2;&lt;br /&gt;iFrequency=-2;&lt;br /&gt;::Sleep(1000); // It is for ATSC Hardware card process time, // if rip if out, the ATSC Card get vaule will be wrong.&lt;br /&gt;hr = bdaTV-&gt;GetATSCChannel(&amp;t_iPhy,&amp;amp;amp;amp;t_iMajor,&amp;t_iMinor,&amp;amp;iLOCKED, &amp;iSTRENGTH, &amp;amp;iQUALITY, &amp;iSIGNAL, &amp;amp;amp;amp;iFrequency );&lt;br /&gt;if (t_iMajor!=-1)&lt;br /&gt;{&lt;br /&gt;lcstmp1.Format("%d",t_iPhy);&lt;br /&gt;lcstmp2.Format("%d",t_iMajor);&lt;br /&gt;lcstmp3.Format("%d",t_iMinor);&lt;br /&gt;hr = bdaTV-&gt;ChangeATSCChannel(atol(lcstmp1),atol(lcstmp2),atol(lcstmp3)); //change Channel data&lt;br /&gt;::Sleep(1000); // It is for ATSC Hardware card process time, // if rip if out, the ATSC Card get vaule will be wrong.&lt;br /&gt;hr = bdaTV-&gt;GetATSCChannel(&amp;t_iPhy,&amp;amp;amp;amp;t_iMajor,&amp;t_iMinor,&amp;amp;iLOCKED, &amp;iSTRENGTH, &amp;amp;iQUALITY, &amp;iSIGNAL, &amp;amp;amp;amp;iFrequency );&lt;br /&gt;}&lt;br /&gt;lcstmp1.Format("%d",t_iPhy);&lt;br /&gt;lcstmp2.Format("%d",t_iMajor);&lt;br /&gt;lcstmp3.Format("%d",t_iMinor);&lt;br /&gt;this-&gt;CONSOLE_TEXT("*** Current Channels: Phy:"+lcstmp1+" ,Major:"+lcstmp2+ ",Minor:"+lcstmp3 );&lt;br /&gt;if&lt;br /&gt;(iFrequency==-1 &amp;&amp;amp; t_iMajor!=-1 )&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT("**** Working... ");&lt;br /&gt;CString msgStr="Current Channels: Phy:"+lcstmp1+" , Major:"+lcstmp2+ ", Minor:"+lcstmp3;&lt;br /&gt;// msgStr=msgStr+" "+tmp1+tmp2+tmp3+tmp4+tmp5;&lt;br /&gt;// Write the Phy, Major, minor data to a File.&lt;br /&gt;if (isNewLog)&lt;br /&gt;{&lt;br /&gt;fprintf(pLogFile, "Beginning of log session\n");&lt;br /&gt;isNewLog = FALSE;&lt;br /&gt;}&lt;br /&gt;fprintf(pLogFile, "%s\n",msgStr.GetBuffer(0));&lt;br /&gt;}else&lt;br /&gt;{&lt;br /&gt;this-&gt;CONSOLE_TEXT(" Not Working... ");&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// Close the Log file.&lt;br /&gt;fclose(pLogFile);&lt;br /&gt;this-&gt;CONSOLE_TEXT("*** Finish Auto Scan.." );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21179294-113839300474002296?l=powenko.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://powenko.blogspot.com/feeds/113839300474002296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=21179294&amp;postID=113839300474002296' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113839300474002296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/21179294/posts/default/113839300474002296'/><link rel='alternate' type='text/html' href='http://powenko.blogspot.com/2006/01/tv-get-signalquality-from-astc-and.html' title='TV-Get the SignalQuality from ASTC and DVBT -Day1 -Done'/><author><name>PK Tech Home</name><uri>http://www.blogger.com/profile/09123582336415653210</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>
