|
but how can i explain the problem?
I will Remove it !
|
|
|
|
|
Just post something like what you already have, then if necessary post the relevant piece of code
and tell were it goes wrong, maybe the exception(or what have you) details.
All the best,
Dan
|
|
|
|
|
HELP!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
Shouting isn't going to help, especially as you are using an unsupported product. RedFiveLabs are no longer in business, and you really shouldn't be using C# to write applications for Symbian. You were told this.
|
|
|
|
|
hello every1, I have Copry CP-U858 joystick and I am trying to read data from it using Managed DX or SlimDX (not too good at it). I succeed almost, because I can read x and y values of moving joystick and all the buttons. However I cant read the Throttle level indicator data on the bottom and two more axis. The funny thing is that it finds these six axis but it cant read all these axis.
|
|
|
|
|
Mine is windows form application in C#. Application find some page on internet e.g. IE window. And then send some value to text of the IE page.
I have used below code for the same. But some how SendMessageTimeout function return nothing, without error.
private IHTMLDocument2 documentFromDOM()
{
Process[] processes = Process.GetProcessesByName("iexplore");
if (processes.Length > 0)
{
IntPtr hWnd = processes[0].MainWindowHandle;
int lngMsg = 0;
int lRes;
EnumProc proc = new EnumProc(EnumWindows);
EnumChildWindows(hWnd, proc, ref hWnd);
if (!hWnd.Equals(IntPtr.Zero))
{
lngMsg = RegisterWindowMessage("WM_HTML_GETOBJECT");
if (lngMsg != 0)
{
SendMessageTimeout(hWnd, lngMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, out lRes);
if (!(bool)(lRes == 0))
{
int hr = ObjectFromLresult(lRes, ref IID_IHTMLDocument, 0, ref document);
if ((bool)(document == null))
{
MessageBox.Show("No IHTMLDocument Found!", "Warning");
}
}
}
}
}
return document;
}
Any help is welcome. Or if somebody has an C# example of SendMessageTimeout with IE window to retrieve IE HTML will be greatful.
|
|
|
|
|
You have not shown your DllImport declaration for SendMessageTimeout so it's not possible to tell if you have an error there.
You are not checking the return value of the function, only the lpdwResult parameter value - this may or may not be significant.
A quick observation:
if (!(bool)(lRes == 0)) , there is no need to cast to bool, just if (lRes != 0) will do.
|
|
|
|
|
Thanks for the reply.
Here is DllImport declaration
[DllImport("user32.dll", EntryPoint = "GetClassNameA")]
public static extern int GetClassName(IntPtr hwnd, StringBuilder lpClassName, int nMaxCount);
public delegate int EnumProc(IntPtr hWnd, ref IntPtr lParam);
[DllImport("user32.dll")]
public static extern int EnumChildWindows(IntPtr hWndParent, EnumProc lpEnumFunc, ref IntPtr lParam);
[DllImport("user32.dll", EntryPoint = "RegisterWindowMessageA")]
public static extern int RegisterWindowMessage(string lpString);
[DllImport("user32.dll", EntryPoint = "SendMessageTimeoutA")]
public static extern int SendMessageTimeout(IntPtr hwnd, int msg, int wParam, int lParam, int fuFlags, int uTimeout, out int lpdwResult);
[DllImport("OLEACC.dll")]
public static extern int ObjectFromLresult(int lResult, ref Guid riid, int wParam, ref IHTMLDocument2 ppvObject);
public const int SMTO_ABORTIFHUNG = 0x2;
public Guid IID_IHTMLDocument = new Guid("626FC520-A41E-11CF-A731-00A0C9082637");
As per suggestion, I have checked return value and it(i) is 1 (non zero). Modified statement is as below;
int i = SendMessageTimeout(hWnd, lngMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, out lRes);
if (lRes != 0 && i !=0)
|
|
|
|
|
According to MSDN[^]:
If the function succeeds, the return value is nonzero.
so it is definitely succeeding.
I don't think it will make any difference to your exact problem, but your function declaration is not correct. You shouldn't use int where it should be IntPtr as int is always 32 bits but IntPtr will be 64 bits on a 64 bit system. I would use:
using System;
using System.Runtime.InteropServices;
internal static class NativeMethods
{
public const int SMTO_NORMAL = 0x0000;
public const int SMTO_BLOCK = 0x0001;
public const int SMTO_ABORTIFHUNG = 0x0002;
public const int SMTO_NOTIMEOUTIFNOTHUNG = 0x0008;
public const int SMTO_ERRORONEXIT = 0x0020;
[DllImport("User32.dll", SetLastError = true)]
public static extern IntPtr SendMessageTimeout(
IntPtr hWnd,
int Msg,
IntPtr wParam,
IntPtr lParam,
int fuFlags,
int uTimeout,
out IntPtr lpdwResult);
}
I have never tried to get HTML this way so I really can't help any further without some experimenting - if I get time I will have a look.
Edit: I have had a quick play around. In my tests, lRes (lpdwResult) always sets a zero pointer - I haven't found out what exactly this is supposed to be - MSDN just states:
The value of this parameter depends on the message that is specified.
Have you seen the code here[^] - perhaps that can help?
modified 26-Feb-12 6:18am.
|
|
|
|
|
Thanks for the reply. Still trying to figure it out.
|
|
|
|
|
|
First, the subject line of a post should be short. The body of the post should contain the question, not the other way around.
SQL servers are designed to be managed using SQL query language, including the construction of databases, tables, column definitions, security as so forth.
You build an SQL script that builds the database and when your app is installed, you include custom actions that ask for the server to attach to, the credentials to use, and then you connect to the server and execute the script, just like it would be if you were querying a database instead.
|
|
|
|
|
During install, check if the database already exists.
If it does, don't create it.
|
|
|
|
|
how to loop through Application openforms
and get specified form which is active
with note that may be more than one form with the same name is running
Form ActvFrm = this.ActiveMdiChild;
string cptn = ActvFrm.Name;
FrmNewPatiant FNew = (FrmNewPatiant)Application.OpenForms["FrmNewPatiant"];
foreach (Form FrmNew in Application.OpenForms)
{
if (FrmNew.Text == cptn)
{
FrmNewPatiant actvNewPat = (FrmNewPatiant)Application.OpenForms[cptn];
actvNewPat.tabNewFile.TabPages[2].Enabled = true;
actvNewPat.tabNewFile.SelectedTab = FNew.tabNewFile.TabPages[2];
}
}
|
|
|
|
|
What I used to do was store a value typically the id of the record or individual. I stored this value as the tag value of the child form created. In this way you can make certain not to replicate already created or open form by comparing this value to be created with the values stored in all of the currently open and active forms.
I now use Tabs instead of MDI in most of my applications though which is why I said used.
modified 26-Feb-12 19:14pm.
|
|
|
|
|
can you give me example on how to use tags for each mdi child?
|
|
|
|
|
This is how I did it when using MDI.
I used a Tree View control populated with A-Z subnodes would be names organized last to first with a comma and middle initial, and I would store the id of the record containing the information in the tag element of the Tree View like so.
private void updateTreeview()
{
for (int i = System.Convert.ToInt32('A'); i <= System.Convert.ToInt32('Z'); i++)
{
treeView1.Nodes.Add(Convert.ToString((char)(i)), Convert.ToString((char)(i)));
}
TreeNode childnode = null;
string sContactsName = null;
foreach (DataRow rowContacts in dtContacts.Rows)
{
sContactsName = string.Concat(rowContacts["LastName"].ToString(), ", ", rowContacts["FirstName"].ToString());
if (!(System.Convert.IsDBNull(rowContacts["MiddleInitial"].ToString())))
{
sContactsName = string.Concat(sContactsName, " ", rowContacts["MiddleInitial"].ToString(), ".");
}
childnode = new TreeNode(sContactsName, 0, 1);
childnode.Name = sContactsName;
childnode.Tag = rowContacts["ContactID"].ToString();
string sortnode = sContactsName.Substring(0, 1).ToUpper();
treeView1.Nodes[sortnode].Nodes.Add(childnode);
}
treeView1.Visible = true;
treeView1.Enabled = true;
treeView1.ExpandAll();
}
After the node containing the name was clicked I handled it like this:
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
string nodeName = e.Node.Name;
if (nodeName.Length == 1)
{
return;
}
foreach (Form f in this.MdiChildren)
{
if (f.Name == nodeName)
{
f.Activate();
return;
}
}
string id = e.Node.Tag.ToString();
displayContact(nodeName, id);
}
This checked the form by id to see if it was already displayed and only created a new form if it was not displayed.
|
|
|
|
|
It would be very appreciate if anybody can help me.
Is it possible to pass filter condition in datagrdview.parameter to filter all the records having null value on that column
if (comboBoxOperator.Text == "xxx..") ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " LIKE '" + FilterValue + "%'";
How I can pass FilterValue as null condition .
With Many thanks
Pol
|
|
|
|
|
if (comboBoxOperator.Text == "xxx..") ResultFilterExpression = this.DataGridViewColumn.DataPropertyName + " IS NULL";
?
--edit;
Don't bump[^] your question.
Bastard Programmer from Hell
modified 24-Feb-12 19:32pm.
|
|
|
|
|
|
You're welcome
|
|
|
|
|
every body.. please help me about my problem..
i need exemple of code using c#..
how to access mySql if you made class model, class dao,,and class view.
in class model : you can make "setter getter" of your komponent,,
in class dao: you can make connection and accessing database.. "save,sellect,update,delete".
in class view : you can make some form to access mySql..
please help me..
|
|
|
|
|
Sounds like homework to me: go speak to your teacher.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
i'm sory sir.. i'm a student in high school.. so i'm just new in code to know.. jajajaajjajaajajaja.
sooo please help me sirrr
|
|
|
|
|
|