What's a JSON string? It is a representation of a serialized object.
What's a Datagrid? It is a UI element for showing data.
What have you to do now? Deserialize the JSON string to get the object. Define how to bind the object to the Datagrid. Then do it.
I got a situation that's driving me insane: In order to work together with a third-party suite of applications, we have created a kind of addon.
This addon is being loaded without any problems into several third-party applications as well as into a MS Word addon the other party wrote.
Our addon creates its own AppDomain, so that there should be no interference with the host application.
All of this works nicely when using .NET 4.0 up to .NET 4.5.2.
Recently, a customer tried running the same setup with .NET 4.6.1 and all of a sudden, the addon crashes when it's being loaded into the Winword-Addon.
The crash happens as soon as our addon tries to access ConfigurationManager.AppSettings.
The call stack shows that there's a NullReferenceException at System.Xml.XmlCharType.get_Instance() that's happening while the configuration system is being initialized.
It only happens there and only with .NET 4.6.1.
I'm out of ideas, can anyone help?
-- Black holes are the places where God divided by 0...
Thanks for the reply, Richard!
I also had taken a look at the code in System.Xml.dll from 4.5.2 and from 4.6.1 using ILSpy, but couldn't find any significant difference.
Both versions had the "XmlCharType.bin" resource embedded inside the assembly.
When our addon is being loaded, it's creating a separate AppDomain to avoid any side effects the host application might have, so I have no idea what they could actually do to make our addon fail so miserably.
I even looked at the assemblies loaded into our AppDomain when initializing the configuration system fails and System.Xml.dll is already loaded at the very beginning, so I really cannot see what could keep the assembly from finding its own embedded resource... To my understanding, even fiddling with CAS cannot influence access to an assembly when it's already loaded, can it?
-- Black holes are the places where God divided by 0...
I am Murthy, I am try to developing cursive data recognization on image. I downloaded your project, It was a great project. But unable to get the individual character from the image. Please help sir
The article is not "our" article. It belongs to the person who wrote it. Articles are contributed by the volunteer community, not necessarily by The Code Project. At the bottom of the article you're talking about you'll find a forum dedicated to that article. Articles are supported by the people who wrote them.
Hi I wrote a dvd burning utility using the code from imapi2Interop.cs by Eric Haddan in Code Project. It works fine. Thank Eric for posting the code.
I write my data in three sessions (on purpose)so that I can (hopefully) generate a unique id (Sha1 hash using the physical starting and ending offsets of each of the sessions + other stuff), according to what I read the offsets could change if the disc is copied.
I tried using MsftDiscFormat2Data.MultisessionInterfaces but it looks like it is not valid for closed dvd.
Any pointer or idea as to how I may be able to get the start and ending offsets of each of the sessions in the DVD?
We have a Windows Forms application called "CallMultiple" which accepts e.g. one string parameter in the Main method.
Now - via a command input - this application is tiggered the first time. It gets the input string "first", and sets a static variable "invocation count" to zero as well as the parameter "first" into a static variable called "invocation type". Both static variables should be public.
With parameter "first" a GUI Window is presented.
The process only ends if somebody clicks the "Terminate" button in displayed GUI Window.
Now there happens a second invocation with parameter value "second".
(The case, that the value "first" is coming again shall not be handled for this question).
Question: is it possible to compare the parameter of this invocation ("second") to the parameter already stored in the first invocation "invocation type" = "first" ?
and if it is not "first" will do something different, e.g bump the static counter "invocation count" and then ends (that is: dispose the process).
Can the waiting process (first invocation) get the counter and display e.g. a message like "application called x times" before it will end (triggered by the "terminate" button in the GUI Windows)
That means: can two processes of the same assembly share data via public static variables ?
Can somebody answer this question.
Many thanks in advance
What you want is IPC (Inter process communication). There is a section here on CP about that, and one project I like is NetMQ[^], a C# port of ZeroMQ. NetMQ can be used as an IPC system, and handles a lot of the things needed for that for you, making it a lot simpler to, for example, send messages with multiple parts (refered to as 'Frames' in NetMQ).
Depending on the size and complexity of the project, this may be overkill, but it may be useful in other places as well.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
many thanks for the quick answers.
They gave me valuable hints which I think will allow me
to solve my problem.
Just for your information: the problem is:
I want to control a flatbed scanner (any make).
I want to scan strips of a cine film which should be moved
through the scanner (in sections of about 4 to 20 cm - depending on the width of the scanners TPU) using a (custom built) transport mechanism with a stepper motor controlled by an Arduino UNO board.
The controlling program (FeederControl), which can be invoked by most scanning programs via a function that allows to show just scanned images with a defined image viewer (e.g. IrfanView) by triggering the specified program (in this scenario it will be not an image viewer but the FeederControl) providing the URL/URI of the just scanned image.
If the FeederControl program is invoked, it has to do the move and than has to press the "SCAN" button of the idling scanning program to start a new scanning process.
Than it has to wait until a new request is coming from the ScannerProgram and start the whole thing over again.
if you are interested:
I have to do the new program, because the old ScanController mentioned in the Wiki does not work successfully under Windows 10 and I have no idea why. It must be a TWAIN problem. And the envisaged solution would avoid to invoke the twain driver as it is done by the ScanController.
This will then only be done by the various Scanner programs.
Another advantage would be: the Scannerprogram can stay open and must not be invoked seperately for each scan, as currently the ScanController does. That means: the whole workflow is driven by the ScannerProgram and not by the FeederControl (which will be a pretty small program).
staticvoid Main(string args)
Console.WriteLine("Enter Any Number");
a = Int32.Parse(Console.ReadLine());
(a <= 0)
Console.WriteLine("Number must be greater than 0");
while (a > 0) ;
Console.WriteLine("Enter Second Number");
now question is that I want to repeat code until the value of "a" is greater than "0" (zero. how to do this?