|
You can use either. Most of the time, I use IntPtr myself, but if your going to do any kind of calculation with the return code, for whatever reason - it depends on the call, you can't use IntPtr.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I do agree that you need to code the API Call as neccessary and I only use IntPtr when it's neccessary. However, I would disagree, you can easily get the Interger Value from an IntPtr.
Dim h As IntPtr = IntPtr.Zero
Debug.WriteLine(h.ToInt32)
Dim h2 As New IntPtr(h.ToInt32)
|
|
|
|
|
That's true. I just avoid the conversion code for simplicity. I can be a bit lazy at times...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thank you guys.. now i know what to do with the return... hehehe... thanks again!!!
|
|
|
|
|
I would like to use visual stiduo and ado.net to display the results on the asp.net web form, but i just don't know how to start the program.I have the theorical information but is difficult to do the practical.
s.l Mosoane
|
|
|
|
|
You've asked the most generic question I've seen in months. What do you want to do? SO far, all you've said is "Help!". With what? You've given no specifications of what your app is supposed to do, code your stuck with, no design attempts, ..., nothing that would help us help you.
I guess you can start with Beginning ASP.NET using vb.net[^] here on CP. Then maybe buy the book for the rest.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Try to read the information from www.asp.net[^].
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I’m trying to download and upload data to a Microsoft access database. But cant even get my head round starting to figure it out.
Any help or nudge in the right direction would be excellent and would make me very grateful.
RandyD
|
|
|
|
|
I guess you can start with How to link to an Access Database in a C# Application[^] here on CP. The code is, obviously, in C#, but is easily convertable to VB.NET either by-hand, or using various translators on the 'Net.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How to do I navigate to another list in a DataList. I only want one record perpage. I have been searching
for an answer and I have come up with nothing. If anyone has any ideas please share them with me. I would
so apprecitate it.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Data.Odbc;
using System.Text;
namespace MSPOS
{
///
/// Summary description for Objects.
///
public class Objects : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataList myDataGrid;
protected System.Web.UI.HtmlControls.HtmlForm Form1;
private DataSet ddlDataSet1 = new DataSet();
private DataSet ddlDataSet = new DataSet();
protected Int32 _currentPageNumber = 1;
protected int PageSize = 1;
public void Page_Load ( Object sender, EventArgs e )
{
if ( !Page.IsPostBack )
{
BindData();
}
}
public void BindData()
{
OdbcConnection myConnection = new
OdbcConnection("DSN=POS;UID=system;PWD=system");
myConnection.Open();
// get records from the table
string commandString = @"SELECT CM_REF, CM_DESCRIPTION,
CM_OBJECTNAME, CM_TIMEOUT, CM_TYPE, CM_CONTENT, CM_PREPARED, CM_CONNECTION FROM
TBCOMMANDS";
// Set the datagrid's datasource to the datareader and databind
// Create a OdbcCommand object and assign the connection connect to
the database
// Create a OdbcCommand object and assign the connection connect to
the database
OdbcCommand command = myConnection.CreateCommand( );
command.CommandText = commandString;
command.Connection = myConnection;
// Create the Reader and bind it to the datagrid
OdbcDataReader reader =
command.ExecuteReader(CommandBehavior.CloseConnection);
ddlDataSet.DataSource=reader;
ddlDataSet.DataBind();
reader.Close();
reader=null;
myConnection.Dispose();
}
private void InitializeComponent()
{
this.myDataGrid.SelectedIndexChanged += new
System.EventHandler(this.myDataGrid_SelectedIndexChanged);
}
private void MyDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)
{
}
private void myDataGrid_SelectedIndexChanged(object sender,
System.EventArgs e)
{
}
}
}
Thank You for Your Time,
Matt
|
|
|
|
|
You might want to post your question the ASP.NET Forum. You'll get a better result there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Each time I try to create an ASP.NET Web Application I get the "Web Access Failed" dialog box...IIS is installed and running correctly, however I keep getting the following error message:
The default Web access mode for this project is set to file share, but the project folder at 'http://localhost/WebApplication1' cannot be opened with the path 'c:\Inetpub\wwwroot\WebApplication1'.
Can anybody explain why i keep getting this? IIS is running correctly and so are the rest of my Visual Studio .NET applications...I only get this when I try to create Web Applications...
Thanks
|
|
|
|
|
Run the exe aspnet_regiis with -i switch.
aspnet_regiis will available in the path
C:\Winnt\Microsoft.NET\Framework\[version]\
if you installed your os in the C drive.
|
|
|
|
|
On my datagrid I want to display only one record at a time instead of
four at a time.How do I navigate the grid to make the changes?I only want
one per page.
Thank You for Your Help.
Matt
|
|
|
|
|
You can use paging just set the page size to 1. Then add a pageIndexChanged event to the datagrid to handle the backwards/forward navigation.
|
|
|
|
|
There is one big problem it is a datalist.
|
|
|
|
|
I tried egghead.
Not much help.
I am trying to bind the records from the table to a datalist control in C#
private DataSet BindTBCOMMANDTYPE()
{
OdbcConnection myConnection = new OdbcConnection("DSN=POS;UID=system;PWD=system");
// Populate the ddlDataSet1
myConnection.Open();
const string strSQLDDL = @"SELECT DT_REF, DT_DESCRIPTION FROM TBCOMMANDTYPE ORDER BY DT_REF";
OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
ddlDataSet1.Clear();
myDataAdapter.Fill(ddlDataSet1, "ddlDATATYPE");
DataSet1.DataSource = ddlDataSet1;
DataSet1.DataBind();
myDataAdapter.Dispose();
myDataAdapter = null;
myConnection.Close();
return ddlDataSet1;
}
Just need the correct syntax.
http://www.eggheadcafe.com/forums/ForumPost.asp?ID=14586&INTID=6
Let's share our knowledge together!!!
mcupryk@sun.net.bb
Matt Cupryk
514-685-0449
|
|
|
|
|
You might want to try posting this in the C# Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am experimenting with MSAgent. (Text to speech)
What I am trying to accomplish is to let the program run until the Esc key is pressed.
The code below works fine in the Visual Basic 6.0 IDE.
However, if you minimize the IDE or compile, the program still runs but pressing the Esc key does nothing.
It's like the program has lost focus.
It works fine in the IDE with no interuption.
Can someone help with this?
Here is the code:
Option Explicit
Public MyAgent As Object
_________________________________
Private Sub Form_KeyPress(keyascii As Integer)
'KeyPreview on the Forms properties window is set to True.
'Press the Esc key to exit.
If keyascii = 27 Then
Unload Me
End
End If
End Sub
__________________________________
Public Sub Delay(Seconds As Long)
Dim n As Double
n = Timer + Seconds
Do While Timer < n
DoEvents
Loop
End Sub
__________________________________
Private Sub Form_Load()
Dim Ap As String
'Set Application Path
Ap = App.Path
If Right(Ap, 1) <> "\" Then Ap = Ap + "\"
'Load the character
Agent1.Characters.Load "merlin", Ap + "merlin.acs"
Set MyAgent = Agent1.Characters("merlin")
'something wrong here
Dim keyascii As Integer
Do Until keyascii = 27
If keyascii = 27 Then End
MyAgent.Show
MyAgent.MoveTo 250, 325
Delay 2
MyAgent.MoveTo 400, 325
Delay 2
Loop
End Sub
|
|
|
|
|
If you applications Form loses the focus AT ALL, pressing ESC won't do anything because the keypress went to some other app. It's not so much a problem of minimizing the IDE as it's a question of which window got the focus after you minimized the IDE.
Make sure you click in the Window of your application before you hit ESC. Otherwise, your application will never see the ESC key being pressed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for looking Dave.
My problem is that I have no form to click on because of its transparency.
I need to make sure the form doesn't lose focus, but not sure how.
Any ideas?
|
|
|
|
|
It sounds like what you need to do is hook the keyboard instead of depending on KeyDown. If your form is transparent, it suggests that your still using other applications and giving your app things to say from other app. You're application can keep the focus, but in a multitasking operating system, that makes your app quite a p-i-t-a to use.
Check into Application.AddMessageFilter for the .NET way of hooking the keyboard. You can then see all the keyboard messages generated by the keyboard driver, look for your ESC key SYSTEM WIDE, not just the app with the focus.
I'm out of time for today, so I can't get into specifics right now, but I'll be able to do so next week.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info Dave.
Is there a snippet available for download some place in regards to
Application.AddMessageFilter?
|
|
|
|
|
|
Thanks Dave,
I have found another way also, however, I need a timer event for it to work:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Sub Form_Load()
Dim k As Long
For k = 0 To 255
GetAsyncKeyState k
Next
End Sub
Private Sub Timer1_Timer()
Dim k As Long
For k = 0 To 255
If GetAsyncKeyState(27) Then End
Exit For
Next
End Sub
|
|
|
|