|
I was wondering if anyone knows how to Read or communicate to/from a java applet. I'm an avid pogo player for some reason once i started i cant stop hehe. But i want to extract my token score, or even display the java game window in a win app. I am totally lost as to where to start, I can't find any tutorials on communication to java applets, or even how to display them in a certain language,
Is there any help someone can give me, and point me in the right direction.
It would be greatly appreciated,
Thank you.
|
|
|
|
|
Java applets run in their own runtime. There is no way to communicate directly with the applet unless it's written to expose a server, either through COM or TCP/IP. Getting the results out of the Java window, like your score, would involve OCRing the Java window! Java renders its windows without using any Win32 controls, so trying to use stuff like WM_GETTEXT on a window handle is useless.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
That is interesting and a good read on ocr
Is there an easy way to load the applet on a vb form?
|
|
|
|
|
Don't know - never tried. Never had a reason to.
I don't think there's a COM component you can put on your form to show a Java window.
You might want to checkout a Java-dedicated board for an answer to this one, like Sun's Support Forums[^].
The only thing I can think of would be to put a WebBrowser control on your form and have it navigate to the source of your Java code, be it a website or a file path.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Dear Sir,
I am aware of vb, I have just started my vb.net session. In vb.net how can i write a code for saving data in to a database like sql 2000 server, and how to show the saved data into a grid( eg. Like an employee details)
vinay
|
|
|
|
|
Are you familar with SQL? If not, you should learn about that.
+look at the insert statement of sql to get the data in the database
+look at the select statement of sql to get the date out of the database
|
|
|
|
|
Dear nlarson11,
Thank you for your reply.
I know sql, i am using sql2000 server with vb. I want to know how to use store procedures in vb.net, and the connection syntax to connect database ,passing parameters into storeprocedures. Also i want to know how to display the data into a grid using vb.net. I am grateful to you if you give me some sample codes
thanks & regards
vinay
|
|
|
|
|
dim ds as dataset = (your method to run the stored procedure)
grd.datasource = ds
grd.datamember = ds.tables(0).tablename
|
|
|
|
|
dear nlarson11,
Thank you for your guidance.
I will try it and revert.
thanks & regards
vinay
|
|
|
|
|
how to backup sqlserver2000 database after sqlclient.sqlconnection made
from vb.net 2005
|
|
|
|
|
MohamedAdam wrote: how to backup sqlserver2000 database after sqlclient.sqlconnection made
Issue a proper TSQL BACKUP[^] command, using the same methods you would for any other SQL statement on your database.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi ,
Iam using SSTAB for my Application in Visual Basic 6.0. Instead of clicking tab for "Selection", I want to select a tab using Mouse over a tabheader.
Please help me...
Thanks & Regards
Kumaran
|
|
|
|
|
kumaran...
i didnt understnd what u r asking... can u make it bit more clear for me? are u asking of selecting a tab just by pausing ur mouse over it?
|
|
|
|
|
Iam asking when we click the tab header only to select the different tabs know. Instead of clicking i want to select the tab when the mouse over of a particular tab headers.
Thanks & Regards
Kumaran
|
|
|
|
|
I wrote two functions to draw something like this.
__ __
_____
__ __
_____
__ __
_____
Have six lines and two kinds.
The Yao fuction draws ____ or __ __ and the DoubleGua one send a string like "010101" to Yao to draw lines.
However, I cannot draw six lines. Only one line show on my form.
Where am I wrong?
Can't this funtion run?
The function is as below:
Public Function DoubleGua(ByVal GuaIndex As String) As Bitmap
Dim Lx As Integer = 7
Dim myBmp As New Bitmap(40, 42)
Dim g As Graphics = Graphics.FromImage(myBmp)
Dim i As Byte
For i = 0 To 5
Dim Lpoint As New Point(Lx * i, 0)
Dim tmpyao As String = GuaIndex.Substring(i, 1)
g.DrawImage(Yao(tmpyao, Color.Black), Lpoint)
Next
Return myBmp
End Function
Public Function Yao(ByVal PorN As String, ByVal _Color As Color) As Bitmap
Dim myBmp As New Bitmap(40, 5)
Dim g As Graphics = Graphics.FromImage(myBmp)
Dim Guabrush As SolidBrush = New SolidBrush(_Color)
Select Case PorN
Case "0"
Dim rects As Rectangle() = {New Rectangle(0, 0, 18, 5), New Rectangle(22, 0, 18, 5)}
g.FillRectangles(Guabrush, rects)
Case "1"
Dim rects As Rectangle() = {New Rectangle(0, 0, 40, 5)}
g.FillRectangles(Guabrush, rects)
End Select
Return myBmp
End Function
|
|
|
|
|
astcws wrote: Dim Lpoint As New Point(Lx * i, 0)
You're offsetting the X coordinate, not the Y. This is drawing each line of your image on the same line, just moved to the right, not down. It should be:
Dim Lpoint As New Point(0, Lx * i)
Also, you MUST Dispose() your Graphics objects after you're done using them. You'll eventually get OutOfMemory exceptions if you don't, and/or you're system will start doing crazy things. If you create the Graphics object, you have the dispose of it. The same is true for Brush's, Pen's, and just about any other object that has a Dispose method.
Public Function Yao(ByVal PorN As String, ByVal _Color As Color) As Bitmap
Dim myBmp As New Bitmap(40, 5)
Dim g As Graphics = Graphics.FromImage(myBmp)
Dim Guabrush As SolidBrush = New SolidBrush(_Color)
Select Case PorN
Case "0"
Dim rects As Rectangle() = {New Rectangle(0, 0, 18, 5), New Rectangle(22, 0, 18, 5)}
g.FillRectangles(Guabrush, rects)
Case "1"
Dim rects As Rectangle() = {New Rectangle(0, 0, 40, 5)}
g.FillRectangles(Guabrush, rects)
End Select
g.Dispose()
Return myBmp
End Function
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Yeah, what a stupid mistake?
As the method "disposed"...I really don't know it before...
Thanks very much.
|
|
|
|
|
Hello,
I am using a for loop to loop through the rows in a datagridview. I am using the index to control the loop. However, the loop always loops an extra time. For example, if i have 10 rows, it will loop 11 times. Is the index the wrong value to use in this case?
For Each dr As DataGridViewRow In Me.dgvPartByCategory.Rows<br />
componentID = Me.dgvPartByCategory.Rows(dr.Index).Cells("PartID").Value<br />
<br />
Next dr
Many thanks,
Steve
|
|
|
|
|
I hope this one will help u........
For Each MainGRD As DataGridItem In Me.dgrdmain.Items
'Use ur code here
Next
Regards,
Magi
|
|
|
|
|
Hi to everybody, The am Italian and The don'ts write very well in English. The have this problem that The don'ts succeed really to resolve: I owe to effect to login on to site and subsequently to donwload HTTP to two pages web that contains burdens information. The don'ts succeed in understanding whether to make the login and to preserve the "LOGON", that is in practice the login doesn't succeed me. The page of the site is : http://www.tre.it:80/selfcare/areaclienti133/4552_infoCosti_ITA_LOGGED.xsl. Thanks thousand and I pray you helped me
seven
|
|
|
|
|
i have appication in that
when i click on "photo" btn it will connect to web cam & after capturing photo by cam i again will go on application.
At that time captured photo will display in picture box
what i do for that
|
|
|
|
|
Google for "vb.net webcam wia"[^] and you'll find lots of resources on how to do this.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi, everyone,
I'm writing a program to discover wireless network
using Windows Native Wifi API & VB.net.
I have to declare the windows API in my VB.net program.
The original windows declaration is as below.
The problem is in "struct _WLAN_AVAILABLE_NETWORK_LIST",
it declared "WLAN_AVAILABLE_NETWORK Network[1];".
I think which means a Network[] array of struct WLAN_AVAILABLE_NETWORK.
But how about the size of the Network[] array?
Is it "1" or more? what does "1" mean?
If I give it the size of 1, then I can get the first network back,
but if I give it more than 1, for example, 10,
then I got an error of "AccessViolationException".
The full message is "Service cannot be started. System.AccessViolationException:
Attempted to read or write protected memory.
This is often an indication that other memory is corrupt."
Actually, the size of the Network[] array is decided by
dwNumberOfItems at run time, which means the size of the
Network[] array is varied-length not fixed, and in most situations
, the size should be more than 1.
I've searched the solution on the internet, and found some similar situations.
They said we should use IntPtr to get the address of the structure array and
then use Marshal class(Marshal.copy(), Marshal.PtrToStructure()....) to get the array,
instead of declared it as a structure array, but they didn't post a sample Marshalling code.
I've tried to code, but still got "AccessViolationException" at Marshalling.
Anyone knows how to solve the problem?
Could you write a sample code for me in VB.net or C# without unsafe code?
Thanks so much. I appreciate your help.
Windows Native Wifi declarations:
'-----function-----
DWORD WINAPI WlanGetAvailableNetworkList(
HANDLE hClientHandle,
const GUID* pInterfaceGuid,
DWORD dwFlags,
PVOID pReserved,
PWLAN_AVAILABLE_NETWORK_LIST* ppAvailableNetworkList
);
'-----structure-----
typedef struct _WLAN_AVAILABLE_NETWORK_LIST {
DWORD dwNumberOfItems; '===>the actual size of array
DWORD dwIndex;
WLAN_AVAILABLE_NETWORK Network[1]; '===>how to declare the array? should I give it fixed size of 1 or change it to an IntPtr
} WLAN_AVAILABLE_NETWORK_LIST, *PWLAN_AVAILABLE_NETWORK_LIST;
typedef struct _WLAN_AVAILABLE_NETWORK {
WCHAR strProfileName[256];
DOT11_SSID dot11Ssid;
DOT11_BSS_TYPE dot11BssType;
ULONG uNumberOfBssids;
BOOL bNetworkConnectable;
WLAN_REASON_CODE wlanNotConnectableReason;
ULONG uNumberOfPhyTypes;
DOT11_PHY_TYPE dot11PhyTypes[8];
BOOL bMorePhyTypes;
WLAN_SIGNAL_QUALITY wlanSignalQuality;
BOOL bSecurityEnabled;
DOT11_AUTH_ALGORITHM dot11DefaultAuthAlgorithm;
DOT11_CIPHER_ALGORITHM dot11DefaultCipherAlgorithm;
DWORD dwFlags;
DWORD dwReserved;
} WLAN_AVAILABLE_NETWORK, *PWLAN_AVAILABLE_NETWORK;
typedef struct _DOT11_SSID {
ULONG uSSIDLength;
UCHAR ucSSID[32];
} DOT11_SSID, *PDOT11_SSID;
'-----Enumeration-----
typedef enum _DOT11_BSS_TYPE
{
dot11_BSS_type_infrastructure,
dot11_BSS_type_independent,
dot11_BSS_type_any
}DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;
typedef DWORD WLAN_REASON_CODE, *PWLAN_REASON_CODE;
typedef enum _DOT11_PHY_TYPE
{
dot11_phy_type_unknown,
dot11_phy_type_any,
dot11_phy_type_fhss,
dot11_phy_type_dsss,
dot11_phy_type_irbaseband,
dot11_phy_type_ofdm,
dot11_phy_type_hrdsss,
dot11_phy_type_erp,
dot11_phy_type_IHV_start,
dot11_phy_type_IHV_end
}DOT11_PHY_TYPE, *PDOT11_PHY_TYPE;
typedef enum _DOT11_AUTH_ALGORITHM
{
DOT11_AUTH_ALGO_80211_OPEN,
DOT11_AUTH_ALGO_80211_SHARED_KEY,
DOT11_AUTH_ALGO_WPA,
DOT11_AUTH_ALGO_WPA_PSK,
DOT11_AUTH_ALGO_WPA_NONE,
DOT11_AUTH_ALGO_RSNA,
DOT11_AUTH_ALGO_RSNA_PSK,
DOT11_AUTH_ALGO_IHV_START,
DOT11_AUTH_ALGO_IHV_END
}DOT11_AUTH_ALGORITHM, *PDOT11_AUTH_ALGORITHM;
typedef enum _DOT11_CIPHER_ALGORITHM
{
DOT11_CIPHER_ALGO_NONE,
DOT11_CIPHER_ALGO_WEP40,
DOT11_CIPHER_ALGO_TKIP,
DOT11_CIPHER_ALGO_CCMP,
DOT11_CIPHER_ALGO_WEP104,
DOT11_CIPHER_ALGO_WPA_USE_GROUP,
DOT11_CIPHER_ALGO_RSN_USE_GROUP,
DOT11_CIPHER_ALGO_WEP,
DOT11_CIPHER_ALGO_IHV_START,
DOT11_CIPHER_ALGO_IHV_END
}DOT11_CIPHER_ALGORITHM, *PDOT11_CIPHER_ALGORITHM;
|
|
|
|
|
Hi
I have question about using crystalreport in web browser. I use vb2005 to create crystalreport in default form and then use crystalreportviewver that can show the report in project but when I call from remote(intranet) it always ask " The report you requested requires further information."
and have textbox to fill Server name:,
Database name: ,
User name: ,
Password
[] Use Integrated Security
then have button Logon
but even I fill all data require it still can't open the report.
What I shall do next? thank you for your advice...
Kitty
|
|
|
|
|
try this code:
crpt = New CrystalReport1
For Each myTable In crpt.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo.Password = "xxxx"'databse password
myLogin.ConnectionInfo.UserID = "sa"'Database username
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.ReportSource = crpt
Magi
|
|
|
|
|