|
Don't worry about the one vote. You had me doubting my memory though, which at my age, I can't afford.
|
|
|
|
|
Pete O'Hanlon wrote: Don't worry about the one vote.
Cool
Just noticed that one can only flag it as a good/bad answer. A bad answer translates to a one-vote. I'm off to the suggestions-forum; it'd be nice to have a "hold on" or "say what?" indicator.
Pete O'Hanlon wrote: You had me doubting my memory though, which at my age, I can't afford.
You already forgotten that kids forget things too? You were more alert than I was when answering the TS.
Bastard Programmer from Hell
|
|
|
|
|
neodeaths wrote: is this possible?
Only in theory, as we have yet to find a CPU that can do OCR for different fonts at high speed.
In pratice, there are controls that can hold text, and controls that don't hold the text but who are simply displaying drawn pixels.
neodeaths wrote: i am trying to make a school project.
Too complicated for a school-project. First, it's not always possible to read the "word" under the cursor, as it might not be saved in memory as a text; as said, it might have been drawn. Although it's possible to have the computer guess what words there are in the picture, it's slow and error-prone.
Bastard Programmer from Hell
|
|
|
|
|
its my suggestion to my teacher for my school project as we are supposs to think of an application to do, i have not talk to him about it yet, just want to see how complex and what i should know before i decide what to do.
from what i have read about ocr its pretty deep, and will probably have a very long time complexity to run.
still considering though
|
|
|
|
|
neodeaths wrote: its my suggestion to my teacher for my school project as we are supposs to think of an application to do
What kind of application where you planning? Perhaps there's another way to get the required input, like the ClipBoard ?
neodeaths wrote: just want to see how complex and what i should know before i decide what to do.
A good project would be any project that has been done already. Ask the students of the previous year; at least you'll now it's viable within the given time.
neodeaths wrote: from what i have read about ocr its pretty deep, and will probably have a very long time complexity to run.
With some people (like me) doing a lot of travelling by mouse, with the cursor hitting a lot of words when I'm working.
Bastard Programmer from Hell
|
|
|
|
|
While you are deliberating, you should consider whether Eddie has actually answered the question you asked. In my opinion, he's interpreted your question - you need to decide whether his interpretation is actually what you were asking.
|
|
|
|
|
hi i am using window 7, and vs2008.net c#
to create a simple
to use my mouse to click a certain area of my desktop when like
every 12pm click on the 50,50 of my screen
is this possible? if so please give advice on the website and class file i should check out. thanks
|
|
|
|
|
This StackOverflow question[^] has the answer to your question.
using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
public class Form1 : Form
{
[DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
private const int MOUSEEVENTF_LEFTDOWN = 0x02;
private const int MOUSEEVENTF_LEFTUP = 0x04;
private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
private const int MOUSEEVENTF_RIGHTUP = 0x10;
public Form1()
{
}
public void DoMouseClick()
{
int X = Cursor.Position.X;
int Y = Cursor.Position.Y;
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
}
}
0100000101101110011001000111001011101001
|
|
|
|
|
In order to control a PLC with a "complex data structure" the PLC class expects a structure that is unmanaged.
This structure runs fine:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class PinStructureQuality
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public int[] iPinValues = new int[24];
public PinStructureQuality()
{
iPinValues = new int[24];
}
}
The problem I have is that I don't know at the time this Class is constructed whether I have 10, 24 or any other number of pins. I would like to read this from a settings file or an XML file containing a parameter telling what the size the array is.
The line
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
causes the problem, since the value 24 must be known in front.
Does anybody have an idea on how to solve this?
|
|
|
|
|
What's the C declaration? I suspect you want to marshal as a pointer not as a fixed size array within the structure.
|
|
|
|
|
the structure is directly used in the API provided with the PLC. This is the declaration of the wrapper:
public void WriteAny(int variableHandle, object value);
and my call to it is:
public void SetAllLow()
{
for (int i = 0; i < iNrIO; i++)
_PinStructureQuality.iPinValues[i] = (int)(65535);
try
{
if (e._ErrorCode == 0)
adsClient.WriteAny(hcomplexStruct, _PinStructureQuality);
}
catch
{
e._ErrorCode = 1;
e._ErrorMessage = "Could not write pinning data to PLC";
ErrorEvent(this, e);
e._ErrorCode = 0;
e._ErrorMessage = "";
}
}
The reason I want to use this WriteAny call is that it allows me to sent also strings and other types in the same structure.
|
|
|
|
|
Member 7889751 wrote: I don't know at the time this Class is constructed whether I have 10, 24 or any
other number of pins. I would like to read this from a settings file or an XML
file containing a parameter telling what the size the array is.
Why does the second preclude the first?
|
|
|
|
|
The easiest way to deal with variable length arrays with P/Invoke is to create your array as a normal .NET array where variable length is no issue.
When you need to pass it you can use GCHandle[^] to pin the data and pass the GCHandle's pointer. Make sure you free the GHHandle after you are done with it! This assumes the native code can somehow work out the length of the data being passed - if it attempts to read outside of the allocated memory, strange things will happen
|
|
|
|
|
Hi Experts
can u please guide me how to download a file which is in Network location( \\10.101.....)where we pass credentials OF particular server and downloading a file from that server to local Machine in asp.net
Regards
venu
|
|
|
|
|
On the local network? You can just use File.Open etc (any of the normal ways to read a file from System.IO), if you have permissions to read it. Remember that ASP.net runs as its own user, though, so setting up the network permissions might be tricky.
|
|
|
|
|
ya i dont have permissions to read it but i have a user name and password who has the permission to read so i have to pass this parameters in the code and to read the file
|
|
|
|
|
Getting network resources under a different user name is (on Windows anyway) pretty tricky. You'd probably do better asking your network admin for read permissions on that file.
|
|
|
|
|
I am working in a c# code generator project. This first version was mostly hacked out in a couple of weeks.
, Now I am having qualms , regarding if I should publish it or simply keep it for myself ( I mean , not out of selfishness , but due to the fact that a comercial product needs a lot more work than an only-for-your-eyes tool, plus I get the impression that code generators are not very popular these days ).
Currently the tool generates the following :
Stored procedures for the tables (SQL Server only)
Business objects
Data Access Layer
A basic navigation menu
A list view for the objects.
Any feedback will be greatly appreciated.
|
|
|
|
|
Most developers worth paying build their own code generator as part of their "framework". Most of us also run up against this same question, should I publish? I predict that almost no one will actually pay money for it if/when you do publish (remember we all built our own).
There is one benefit you will gain from it if you do go on to publish it. You will learn the difference between corporate and commercial grade software. What a corporate or you will accept to get the job done and what you can actually sell are very different animals.
Good luck!
[edit]
By all means you should write an article and publish that way, this will also be instructive without the staggering burden of trying to make a commercial product. It may get ragged mildly as being like many others but so what!
[/edit]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks for the feedback.
One of my thoughts was to polish it enough so that even a non-programmer could use it ( but that is an altogether different creature which would probably take months to complete ).
As-is it would probably be usefull only for novice programmers ( < 1 year experience ).Anyhow , I started this project because the company I'm in makes everything by hand and I couldn't stand the tedium of writting n-tier apps by hand.
|
|
|
|
|
Armando de la Torre wrote: I couldn't stand the tedium of writting n-tier apps by hand.
Yup thats why we wrtie em. Mine started life in VB5 back in the 90s and even then I snaffled it from another dev I was working with. It's been rewriten in 3 different languages using different protocols and targetting different databases, currently Oracle and SQL Server. Still does basically the same thing for the database but now does all the WCF model and DAL stuff with an initial ViewModel shell but this is not really valid any more.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That's fair enough, but there are already code generators on the market. Some are paid for, and some are free. It would be worth taking a look at what they have to offer and see how they are packaged.
|
|
|
|
|
Mycroft Holmes wrote: I predict that almost no one will actually pay money for it if/when you do publish (remember we all built our own).
Hmmm... I was thinking in selling it at a VERY affordable price ( e.g USD $20 - 25 , trainning videos included ). My bet is that it will draw the attention of novice programmers, but mostly it will be done just for the experience of getting a comercial product on-line.
Once again , thanks for the feedback.
|
|
|
|
|
Publish it here, at least it's like a code review with many experts with many years experience in a wide variety of scenarios giving you feedback.
|
|
|
|
|
I am doing a project which requires me to have a link from one page that will direct/take me to another page. How can i do this..?
|
|
|
|