|
It's a long running job!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Trying to extend tutorial code without first studying the basic aspects of the topics it covers is, usually, going to result in problems. In this case, we can't "see" the tutorial, and be more specific.
There are lots of good resources for understanding threading in C#; for specific issues, like thread-thread interaction, and UI thread interaction with created threads, start here: [^], and, [^]
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
Hi.
I have created an app that modifies the config file of another app and modifies some data in SQL Server. I'm using Visual Studio 2019 with forms in C# . When I run it in my computer it works fine, but when I run it on another computer (without Visual Studio) it gives the message: "To run this application you must install .NET. Would you like to download it now?"
Does anyone know what I must include in my app to resolve this issue?
Thanks.
|
|
|
|
|
It's telling you to install the .NET Framework version you wrote the app against.
|
|
|
|
|
|
The obvious requirement is to install the framework and other essentials the development machine uses on the 'other' machine. Strategies;
1) synchronize windows updates: as of the May 2019 update Win 10 includes FrameWork 4.8
2) get the 'other' machine user to install the missing whatevers, which may require power-user skills and access permissions: [^]
3) use an installer that will ensure the missing whateve4s are installed, like ClickOnce [^] , or, dotNetInstaller [^], or a commercial installer like InstallShield.
3a) compare ClickOnce with the Win installer: [^]
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
If you are using .NET Core or .NET 5 or 6 you can create a self-contained exe which includes all of the .NET Core/5/6 framework required.
"Time flies like an arrow. Fruit flies like a banana."
|
|
|
|
|
I want to make a virtual camera with C#. It will pass the images it takes from the camera through a few simple filters. Other programs (like Zoom, Skype) will see it as a camera. Is it possible to make such a program?
|
|
|
|
|
Maybe this is a reasonable starting point:
[^ DirectShow Virtual Video Capture Source Filter in C#]
It doesn't read from a camera, but will give you some idea on what is required. It's quite old, so might not be up-to-date, but if nothing else it might give you some words to google for newer examples.
I would not recommend this for a beginner.
|
|
|
|
|
It's been done. Search for virtual camera / webcam "drivers".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
HI,
I am curios to know all the new features introduced in .net core & in c# regarding various version. i was searching this site to get few good article on this topic but no luck. so anyone can share few links of good codeproject articles which talk about C# & .Net core new features version wise and their advantages with example code to show usage.
Thanks
|
|
|
|
|
|
Hi, i find Jonathan Allen's articles on InfoQ about new C# features very helpful: [^], [^]. Some of Steve Gordon's posts also: [^], and [^]
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
modified 21-Oct-21 6:29am.
|
|
|
|
|
Hi,
I want to ask how to send a messages to a customer WhatsApp from windows forms applications.
Please hep me ASAP
Thank You
|
|
|
|
|
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
A very quick search using your subject as the search term gave 11 million results, including document,s videos, and source code: send a messages to a customer WhatsApp from windows forms applications - Google Search[^]
In future, please try to do at least basic research yourself, and not waste your time or ours.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi,
I did many search but all of them is third-party apis, I need a free one if it is available
Thank You
|
|
|
|
|
There isn't a free client API for WhatsApp.
You need a business account with a line of credit.
|
|
|
|
|
I need verification code on WhatsApp
|
|
|
|
|
Hello friends, I want to do SQL Dependency capability in a database file without SQL management The default file address is also in (c:\database.mdf)
I run the service broker in the file, unfortunately I apply a record in the database, it will not be updated in another system, please help
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
Typing as little as possible doesn't help much as we can't help you if we don't properly understand your problem! And at the moment, all I can see are buzzwords and mistakes.
The principle mistake is trying to store a database file in the root of any drive, much worse when it's the boot drive: as from Windows 7 the root of the boot drive was protected from non-admin activity, and this was extended in later revisions to cover non-boot drives as well.
Never store "normal files" in the root - always use a subdirectory!
This may help: Where Should I Store My Data?[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Given a large number of shapes that can be defined by vertices and edges how would you design the class structure for that?
|
|
|
|
|
 Hi, i happen to be working on a shape library for WinForms C# right now; i'll eventually publish it here, but, can't predict when. Let me offer some general ideas:
1) choice of Framework is important: a lot depends on what you want to do with your shapes. my usage is for custom ring design; for example, i need to calculate equally spaced points along a path like an oval, and that point's tangent (requires calculus); i deal primarily with polygons, circles and ellipses; my goal is to have mock-ups i can take to my manufacturers. so, i'm not concerned with 3d rendering on screen, texturing, etc. and i'm not concerned with interacting with selecting/moving/duplicating shapes on-screen as you expect in a drawing program,
2) for other purposes, like the ones i just said i'm not concerned with, WPF offers a superior graphics engine and facilities; and, for 3d; use Unity. if you do need to select/move/duplicate/dock etc., shapes on-screen: don't use WinForms, use WPF.
3) the interface i am using now: the use of System.Windows requires your WinForm project to have a reference to WindowsBase.dll
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows;
using SdPoint = System.Drawing.Point;
using SwPoint = System.Windows.Point;
using SdSize = System.Drawing.Size;
using SwSize = System.Windows.Size;
using GraphicsPath = System.Drawing.Drawing2D.GraphicsPath;
using GReg = System.Drawing.Region;
using GMat2d = System.Drawing.Drawing2D.Matrix;
using GMatMed = System.Windows.Media.Matrix;
namespace GeomLib_August_2021_III
{
public enum ShapeType
{
Line,
Arc,
Rectangle,
Parallelogram,
Circle,
Ellipse,
RegPolygon,
IrregPolygon,
Grid,
Star
}
public interface IShape
{
string ShpName { get; }
string ShpComment { get; }
DateTime ShpTimeStamp { get; }
ShapeType ShpType { get; }
Rect SwRect { get; }
SwPoint CenterF { get; }
SwPoint[] PathPoints { get; }
double GetArea();
double GetPerimeter();
SwPoint GetCenter();
GraphicsPath GetGPath();
Region GetRegion();
IShape GetUnion(IShape s1, IShape s2);
IShape GetIntersection(IShape s1, IShape s2);
IShape Translate(IShape s1, Matrix m1);
IShape Rotate(IShape s1, Matrix m1);
IShape Scale(IShape s1, Matrix m1);
SwPoint[] Flatten();
void Render();
void Save();
void Load()
}
} Each shape name listed in the ShapeType Enum is implemented as a class that inherits from IShape, and implements its fields, and methods.
4) typical OO shape modeling uses "nested" inheritance; you might have:
class Poly : IShape
class Triangle : Poly
class Rectangle : Poly
class Parallelogram : Rectangle
class RegularPolygon : Poly
class EqTriangle : RegularPolygon // or EqTriangle : Triangle
class Square ; RegularPolygon // or Square : Rectangle
class Circle : IShape
class Ellipse : Circle
5) there any number of ways you can organize the top level hierarchy to meet your goals.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
modified 18-Oct-21 3:18am.
|
|
|
|
|
Good morning Bill. Thanks for posting this code - it's great to see people sharing code like this. I have a couple of comments that I'd like to address.
The code sample here has a lot of shorthand in it so things like GetGPath have to be interpreted. Is there a reason why this isn't called GetGraphicsPath or just GetPath ? On that note, why have you chosen to implement Get methods over property getters? I'm just curious as to your reasoning here.
The Shp properties all feel like they should be in a separate class. Again, it feels to me like these are metadata items, rather than being intrinsic parts of the base interface. I would probably move these out into a separate metadata class and drop the Shp parts of the name.
The Union and Intersection methods also appear to be wrong, unless you are looking to determine whether this shape intersects with more than one shape - the first parameter of these methods is probably going to be the current instance so why pass it in? I would expect to see a method that looks more like this
IShape Union(IShape shape);
|
|
|
|
|
Hi Pete, i'm delighted to have feedback like this ! I'll study it carefully, and respond in more detail later.
current version calculating equally spaced points points on an ellipse: [^]
Context: currently this is very much in initial development, and, "final polishing" may address your concerns about my use of short aliases instead of longer, more mnemonic, names. For unknown reasons, my memory, at age 78, handles such short aliases without cognitive effort (just don't ask me where i left my house keys) ... and, it saves typing time
Quote: The Shp properties all feel like they should be in a separate class. Again, it feels to me like these are metadata items, rather than being intrinsic parts of the base interface. I would probably move these out into a separate metadata class and drop the Shp parts of the name. Excellent points ! As the design progresses, i may "break out" the IShape interface into component interfaces like IIdentity for ShpName, ShpComment, ShpTimeStamp (those i would call "metadata"). Right now, things like SwPoint, CenterF seem essential.
"Shp" as prefix: I often "go Hungarian" simply because when i view an object's contents at run-time when a breakpoint is hit, they appear grouped together in the alpha-ordered inspector dropdown, Same idea with public Properties i want exposed in a design-time PropertyGrid.
'Get methods instead of Property getters: somewhere along the line years ago (influenced by Richter ?), i decided to never do extensive calculations, or call external methods, in Properties (except for OnPropertyChanged). That "feels right," and, i believe that contributes to maintainability in the long run ... perhaps i should reevaluate that "habit/decision" ? Quote: The Union and Intersection methods also appear to be wrong, unless you are looking to determine whether this shape intersects with more than one shape - the first parameter of these methods is probably going to be the current instance so why pass it in? As of now, i have not implemented any "current ..." state/object facility. That is something I really like ever since my little career led me into specializing in PostScript.
My intent is to take two shape instances as input, and return a new shape which is the intersection/union of the two inputs: that syntax doesn't reflect that ?
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch
|
|
|
|
|
I find that "super" controls that you can morph at run time (color, scale, content) are more manageable than trying to build things from lots of primitives.
You need a "focus"; e.g. military units already have many predefined shapes and derivatives. In architecture, there are door, window, etc. "patterns".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|