|
1. There is a specific forum for WPF questions.
2. Please explain what you mean by "build navigation tree from XPS document"?
|
|
|
|
|
The first thing you need to do to build any form of tree (and I'm assuming you are talking about a feature similar to the document outline in Word), is to parse out the document so that you can relate the structure together. I would start with this[^] if I were you.
|
|
|
|
|
I'm currently reading a book to learn about creating a compiler and/or interpreter for your own language (Writing Compiler and Interpreters by Ronald Mak). I've been learning a lot from this book, however the author uses Java to create the entire framework and the compiler emits Java byte code.
As I've been working though the samples I'm porting the Java code to VB.NET since I use VB.NET for all my other programming. I haven't reached the chapter on building the compiler but when I do I would rather have the compiler emit CLI code just as Visual Studio does when you build a .NET application.
Unfortunately I don't know CLI code but this seems like a good time to learn. I already downloaded the ECMA standard but I learn must better and quicker from books that give concrete examples and implementations.
Does anyone have any recommendations for any books that teaches about CLI code and preferably have example code that I can work with as I'm reading?
As a side note (since this has been brought up to me by other on numerous occasions) I'm not creating this custom language expecting it to take off and be the next big thing. I'm doing it for two reasons: 1) Academic purposes; 2) My company uses specialized measurement tools that produce large data sets that is hard to program for just because unique nature of the data. So I'm looking to create a domain specific language to handle some manipulation of the data.
Thanks in advance for any recommendations.
|
|
|
|
|
DisIsHoody wrote: My company uses specialized measurement tools that produce large data sets that is hard to program for just because unique nature of the data. Data is data, and can be handled by any language that currently exists. Your time would probably be better spent writing the code to do it, particularly as VB.NET emits CLI code, which is what you are hoping to do with your new language, so the end result will be the same.
That being said, you may like to look at some of these links[^].
|
|
|
|
|
As a starting point, what you are looking at is commonly known as a Domain Specific Language. I'd suggest that you start by having a look at this[^] article. Read it through a few times to make sure you fully understand it.
|
|
|
|
|
Mak generates "intermediate code" from the scanning / parsing phases which he eventually interprets or compiles.
For the intermediate code phase, I would suggest you swap in the .Net framework's System.CodeDom classes for building language independent code graphs and ultimately generating assemblies (instead of bothering with MSIL).
|
|
|
|
|
DisIsHoody wrote: I'm currently reading a book to learn about creating a compiler and/or interpreter for your own language (Writing Compiler and Interpreters by Ronald Mak).
Presumably you already know about the Dragon book (google 'compilers dragon book')
As for CLI examples you can look to the Mono project and the Mono compiler
http://www.mono-project.com/CSharp_Compiler[^]
Presumably the book you have also discusses Yacc/Lex which might be more useful if you are creating multiple languages.
|
|
|
|
|
@Richard: I've actually already written software to handle the data. I was going to use this data for this academic project just so I'm working with something real instead of just working with an abstract idea.
@Gerry: I've read about that feature, however I wanted to work with MSIL directly simply because I feel it will give me a deeper understand of the .NET Framework and hopefully, in the long run, help me written better and more efficient code.
@jschell: I was torn between getting the book I did and the Dragon book, but I decided to go with this book first and leave the Dragon book for second. The Dragon book seemed to deal mostly with theory, whereas this book doesn't go so much into theory but gives you actually code to demonstrate how to accomplish the different items. I tend to learn better with actually examples and exercises instead of theory and pseudo-code, however I plan on reading the Dragon book once I finish this one.
In the end I'm looking for a book that will work through MSIL similar to how this book does it. Each chapter building on the previous ones with actually code examples that write MSIL that in the end will lead to a fully functioning program; for me this is the best way to learn.
|
|
|
|
|
Hi
I'm working with an application that can extract or export an MDE File data to CSV, can someone give me a pointers how to do this.
I'm using VB.NET 3.5.
Thank you!
|
|
|
|
|
Depending on the format of the MDE file you can use the
StreamReader [^] or BinaryReader [^] class to read the data. Then it is just a matter of formatting each line of data into the correct CSV format and writing it out with a StreamWriter [^].
|
|
|
|
|
Hi
I'd like to ask you about book recommendations for MS course 20486A, primarily doing MVC 4.
Course description: http://www.microsoft.com/learning/en/us/course.aspx?ID=20486A[^]
I found a couple of titles, but I'd like your recommendations.
http://www.asp.net/mvc/books[^]
Book Review: Practical ASP.NET MVC 4.0[^]
I have been doing the aspx .NET C# solution for the past 3years now. (aspx/sep. c# codebehind - bll - dal - stored procedures). I am schooled in the old OOP days (OOA, OOD) that was hip around 2000. It was shortly before C# .NET was widely accepted. We were told about .NET, but never saw it. From what I have researched on MVC, it looks very promising and OO.
|
|
|
|
|
Hi, I am a new learner using the google maps. I am stopped by adding Ajax framework. I could not find the reference as shown on Part1. Please help. Thank you.
|
|
|
|
|
Part 1 of what? Is this something to do with an article? Perhaps you should post this on the article itself.
|
|
|
|
|
|
hi,
will u plz tel me how to use string array as perameter in postgresql and in that sp how to use loops.
|
|
|
|
|
You may receive better feedback if you actually post in the appropriate forum - Database forum[^].
Also, when you do, please avoid txt speak and use proper English.
2A
|
|
|
|
|
I have two C# .NET applications, AppA (located in folder A) and AppB (located in folder B). AppB is also using a lot of 3rd party dll:s and configuration files located in folder B. If I start AppB from folder B the application is working as expected.
The problem is when I start appB from appA using Process.Start(), and Process.StartInfo.FileName is pointing to appB. AppB is now starting up, but it seems like it is trying to load resources from folder A instead of folder B. How can I solve this? appB shall always load resources and dll:s from folder B.
modified 21-Jan-13 8:08am.
|
|
|
|
|
Have you tried setting the WorkingDirectory property of ProcessStartInfo?
|
|
|
|
|
Yes but is is still not working.
From AppB i print System.IO.Directory.GetCurrentWorkingDirectory() and that path is alright. I Also print all loaded dll:s and when AppB is started through Process:Start, some dlls are not loaded
|
|
|
|
|
OK I can't think of an obvious reason then. The only time I have seen the working directory set to that of the launching process is when ProcessStartInfo.UseShellExecute is true and Process.StartInfo.WorkingDirectory has not been set.
You say some dlls are not loaded. What is the mechanism for loading these and why doesn't AppB crash if it can't find them?
|
|
|
|
|
|
Thanks for all help. I got this working. The problem was timing problem in the 3rd party dll's. AppA is starting appB in a sandbox and adds overhead (=> timing problem). Because of this timeing problem a exception was throwed before all dll:s were loaded.
(difficult to give a precise explanation of a few short lines here)
|
|
|
|
|
Hi Fellow Developers,
I have created a Dot Net Windows application for my brother. It reads .jpg files and extracts exif information from them and then saves that information into a .csv file.
I have written it on a 64 bit machine. He either has a 64 bit, or a 32 bit machine. I'm not sure which. He runs Microsoft Vista. I run Windows 7.
I have built the dot net application using the target platform of x86, so I don't think that is why I am getting the following error.
Any and all advice on how to get the app to run on his system, is greatly appreciated.
All the Best to You!
Anne
ERROR IS:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {5F90E37C-44A0-47AF-A4CC-CCA80F0EBC83} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
at Microsoft.ImageMetadata.NativeAccess.loadWic()
at Microsoft.ImageMetadata.NativeAccess.get_WicAccess()
at Microsoft.ImageMetadata.NativeAccess.initImageTypes()
at Microsoft.ImageMetadata.MetadataPolicy.initImageTypes()
at Microsoft.ImageMetadata.ParseXml.load()
at Microsoft.ImageMetadata.MetadataPolicyManager.loadPolicy(String xmlFilename)
at OEE.DataAccess.ProcessTheData(String imgPath, String logFile) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\DataAccess\DataAccess.cs:line 102
at OEE.DataAccess.ProcessDir(String sourceDir, Int32 recursionLvl, String logFile) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\DataAccess\DataAccess.cs:line 82
at OEE.DataAccess.ProcessDir(String sourceDir, Int32 recursionLvl, String logFile) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\DataAccess\DataAccess.cs:line 92
at OEE.DataAccess.ProcessDir(String sourceDir, Int32 recursionLvl, String logFile) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\DataAccess\DataAccess.cs:line 92
at OEE.DataAccess.ProcessDir(String sourceDir, Int32 recursionLvl, String logFile) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\DataAccess\DataAccess.cs:line 92
at OEE.Form1.btnLoadBCTphotos_Click(Object sender, EventArgs e) in C:\VS\OtherDotNetApps\OrionExifExtractor\OEE\OEE\Form1.cs:line 100
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.239 (RTMGDR.030319-2300)
CodeBase: file:
----------------------------------------
OEE
Assembly Version: 1.0.3.0
Win32 Version: 1.0.3.0
CodeBase: file:
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.235 built by: RTMGDR
CodeBase: file:
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.236 built by: RTMGDR
CodeBase: file:
----------------------------------------
Microsoft.ImageMetadata
Assembly Version: 2.2.912.3
Win32 Version: 2.2.0912.03
CodeBase: file:
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR
CodeBase: file:
----------------------------------------
Interop.PptNative
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
|
|
|
|
|
Hi Fellow Developers,
After some searching, we found the solution.
I simply had my brother install the following:
http:
His system did not have
Microsoft.ImageMetadata
references in it.
All the Best to You!
Anne
|
|
|
|
|
I am developing a dynamic XPATH function for a MS XSLT transform. I am running the transform under a VB.NET (4.5) wrapper:
Public Function evaluate1(Context As XPathNodeIterator, Expression As String) As XPathNodeIterator
Context.MoveNext()
Dim nsXmlNamespaceManager As XmlNamespaceManager
nsXmlNamespaceManager = New XmlNamespaceManager(Context.Current.NameTable)
Return Context.Current.Select(Expression, nsXmlNamespaceManager)
End Function
The document to transform is XHTML with:
<!DOCTYPE html SYSTEM "file:C:/..path../parse1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
The XSLT document has:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:vb="urn:vb-script:xslt"
xmlns:http="http://www.w3.org/1999/xhtml"
I can successfully use XPATHs with the http namespace from the XSLT, but not in the function code's Select method.
Within the XSLT, the function is used as
<xsl:value-of select="name(vb:evaluate(., '/http:html[1]'))"/>
The function works with unqualified elements (no http: ), but if the namespace is used the "Namespace prefix 'http' is not defined." error is caught. I listed the contents of nsXmlNamespaceManager and see
xmlns=http://www.w3.org/2000/xmlns/
xml=http://www.w3.org/XML/1998/namespace
I know I should be able to add a namespace to the nsXmlNamespaceManager, but that would not be a general solution. It would seem logical to find the @xmlns:* attributes on the XSLT and add those to nsXmlNamespaceManager (assuming I could pass a reference to some XSLT object that would allow me to navigate to the xsl:stylesheet node (or pass a nodeset of those attributes to the function)).
Anyway, the search results on this subject are getting a little thin and I wanted to know if anyone had ventured down this path before and what they did?
|
|
|
|