|
Daniela - if you turn the gromit sideways, and lubricate your flange, you should have no problems.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Cara Daniela,
interfacing with different versions of Word on different Windows version isn't easy.
I normally try and avoid it by creating RTF files by code inside my app; RTF files can be opened by WordPad and, when available, by all versions of MS Word. RTF is a tricky language, it cannot do everything Word can, it can however do more than WordPad allows you to create, e.g. you can create tables in RTF which you can look at in WordPad, but WordPad would not let you create them.
I have no particular references on this; all I did is based on a "Rich Text Format (RTF) Specification" document (huge Word document) I've once found through Google, and some experiments.
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hello to everybody and thanks for your faster reply, nevertheless my the question of the language.
It's the first time I submit a question on codeproject site, and
I didn't know that the "default language" was english. I saw that Michela is italian and (with my very happiness )I wrote my question in italian too...sorry really
Anyway...
I don't know if - in this moment - manage rtf is the solution,
because I've a large amount of reports to create in a very few time.
Infact I have to produce documents that have the same content (text, images, etc)
except for 2 or 3 fields. So, for every doc, I create a correspondant dot where I bookmarked the variabile portion of text that I write
with a very simple code. I don't know if there is a similar fast way using rtf instead of doc.
I read that deploy PIAs for Office 2007 is possible also if on the client pc there is another version of Office installed.
Now the error that I got is (I'm going to translate the message error)
"Can't execute the cast of the COM object "Microsoft.Office.Interop.Word.ApplicationClass" in interface type "Microsoft.Office.Interop.Word._Application"
because the QueryInterface call on COM component with IID {0020970-0000-0000-C000-000000000046} does not function, because it's impossible to load
the type library (HRESULT: 0x80029C4A TYPE_E_CANTLOADLIBRARY)"
I use the following libraries:
Office.ddl, Microsoft.Office.Interop.Word.dll and Microsoft.Vbe.Interop.dll
In the setup project I set the property Register on "vsdraCOM".
After, I create reg files with RegAsm utility and I import these files in the setup project (Registry Keys)
Moreover, I see that some keys in the mentioned reg files, points to
- 00020424-0000-0000-C000-000000000046
- 00020905-0000-0000-C000-000000000046
that are not created by RegAsm, so I export the correspondant reg files from the registry key on my pc,
and add them in setup project too.
I don't know what's wrong. Do you have any idea???
Today I'm going to some other test, but if I'll not find a solution I'll look for other solutions.
Thanks, Daniela.
|
|
|
|
|
Hi everybody
I solve the problem
All the articles I found till now saw me that to deploy COM object I need to register them into GAC registry and update Registry Keys on the client pc, because it's the only way to use COM objects.
It's not true, at all
And this article give me the solution
http://blogs.msdn.com/andreww/archive/2007/06/08/why-is-vs-development-not-supported-with-multiple-versions-of-office.aspx
read the following text
"So, if you really insist on having multiple versions of the PIAs on the box (and I can't think of a good reason, and we certainly don't support this scenario), then you can workaround the problem by simply adding a reference to the specific PIA you want by its path not by its COM registration. Note, if you do this, you should not use the path to the PIA in the GAC. Instead, you should copy the relevant PIAs to some known location and reference them there. So, let's say we go back to our Excel 2003 project, and change the PIA references in this way. We could explicitly set references to the (path to the) Excel 2003 and Office 2003 PIAs. This will build ok, and you'll end up with an assembly whose metadata specifies that it should use the 2003 PIAs. If you then deploy this to an end-user machine which only has 2003, you're good. However, if you try to run it on your dev box, it will again use the 2007 PIAs – because that's the version that was registered last. So, fixing the PIA references only ensures you build the correct assembly that will work on the end-user's machine which has the matching version of the host app. It does not help you on the dev box. If you have multiple versions on the dev box, all bets are off. "
So, in my project, I create a folder where I put my 3 relevant dll, set the property "Always Copy" to true and when I add the reference I select them directly from the tab "Browse" (not .NET nor COM)
In the setup project the dll are loaded automatically when I add the Primary Output in the Application Folder. Here I leave the property Register on the default value vsdraNotRegister and....voila!!!
when I deploy the project to a client pc with xp and office 2003....everything work!!!!!!!! more simple than I think...
so it's possible to deploy an application developed with PIAs 2007 on every pc with every Office version ))
thanks again all and...I hope that everything is clear, due to my not so good english ))
(moreover last post is the product of many cut and past eheheh)
good night everybody
|
|
|
|
|
Wht is F# .... what is advantage of f# ....
have any relation between c# and F#
Give Some valid article
|
|
|
|
|
F# is a programming language[^]. It's focus is on functional programming[^]. It is based on ML[^] but targets the .net framework (so compiles to MSIL). Functional programming is useful in many mathematical domains where it's the functions and their application that is important as opposed to state.
The only similarity between F# and C# is that they both target the .net framework, their syntax is very different. (And they have a sharp sign in their name)
Simon
|
|
|
|
|
|
Hello!
I'm building an application for communication with several devices (not PCs) over Network, using both TCP and UDP protocols.
For this I need two kinds of connexions:
- a connexion (one at the time) with the targeted device, initiated only for parameters setting and device servicing purposes;
- simultaneous multiple connexions with several devices for collecting data (by polling devices).
First one was solved using asynchronous sockets methods, and a timer to periodically check connection status and some other relevant parameters.
See below the basic code for initiating connexion:
'Initialize Socket
Private testSocket As Socket
'Open connexion
Public Sub OpenConnexion(ByVal addressIP As String, ByVal portNo As String, ByVal IPportType As String)
Dim remoteIP As IPAddress = IPAddress.Parse(addressIP)
Dim remotePort As Int32 = CInt(portNo)
If IPportType = "TCP" Then
testSocket = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
testSocket.BeginConnect(remoteIP, remotePort, AddressOf CheckConnection, Nothing)
ElseIf IPportType = "UDP" Then
testSocket = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
testSocket.BeginConnect(remoteIP, remotePort, AddressOf CheckConnection, Nothing)
End If
End Sub
'Connexion result event
Public Sub CheckConnection(ByVal ar As IAsyncResult)
Try
testSocket.EndConnect(ar)
'CallDeviceConnected()
Catch ex As Exception
'CallDeviceDisconnected()
End Try
End Sub
For the second one, using the the same way by simply repeating the code and manually indexing each Sub, the code will become rapidly too large, too complicated and not productive at all.
I've tried a different approach building an Array of Sockets but then I encountered another issue: how to pass the connexion index to connexion result, in order to determine which connexion is active or not.
See below the attempt of code:
'Maximum no. of simultaneous connections
Private maxConnexions As Int32 = 10
'Initialize Socket
Private testSocketArr(maxConnexions) As Socket
'Open connexion
Public Sub OpenConnexionArr(ByVal index As Int32, ByVal addressIP As String, ByVal portNo As String, ByVal IPportType As String)
Dim remoteIP As IPAddress = IPAddress.Parse(addressIP)
Dim remotePort As Int32 = CInt(portNo)
If IPportType = "TCP" Then
testSocketArr(index) = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
testSocketArr(index).BeginConnect(remoteIP, remotePort, AddressOf CheckConnectionArr, index)
ElseIf IPportType = "UDP" Then
testSocketArr(index) = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
testSocketArr(index).BeginConnect(remoteIP, remotePort, AddressOf CheckConnectionArr, index)
End If
End Sub
I have found on Web a lot of examples about dealing with multiple connexions or building a server which can manage hundreds of clients. What I need is a kind of reverse job: to build a client which connects to multiple servers and then poll each of them.
Please help me with some ideas for putting this application on the right track.
Thanks!
Cristian
|
|
|
|
|
I want to write a keylogger in C#.NET.
Also I want it to be executed in a target machine without alerting the user of that machine.
Since .NET languages are dependant on the Framework, I think it will be hard to predict that the executable will get properly executed. Is there any way to make a C#.NET program to a native exe working without the need of the .NET framework?
|
|
|
|
|
There is a very expensive professional one, where you buy a tool to do the conversion and include all required .NET code (probably resulting in a huge EXE file).
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
modified on Sunday, November 15, 2009 7:56 PM
|
|
|
|
|
yeah rewrite it in c++
|
|
|
|
|
It is like building a 100 floor skyscrapper without a foundation
|
|
|
|
|
Gjm wrote: I want to write a keylogger in C#.NET.
Also I want it to be executed in a target machine without alerting the user of that machine.
Get lost dipshit. This is illegal in the United States. Anyone helping you write this can be considered an accomplice in your crime.
|
|
|
|
|
example as: Product has 'Category' property, it's a class, the following code can update the product's simple property(such as string, int, etc), but cannot update it's navigation property.
public void UpdateProduct(Product product, Category category, Model model)<br />
{<br />
Product target = _context.Product.FirstOrDefault(a => a.ProductID == product.ProductID);<br />
_context.ApplyPropertyChanges("Product", product);<br />
_context.SaveChanges();<br />
}
|
|
|
|
|
A number of questions:
1. What is _Context? clearly it is a custom class of some sort.
2. What does ApplyPropertyChanges do? that would be the code to show us.
3. If you try to update the Navigation property what error occurs?
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
1 & 2 are self explanatory if you know about Enitity Framework.
3 is ridiculous to ask if you don't know anything about 1 & 2.
I know the language. I've read a book. - _Madmatt
modified on Monday, November 16, 2009 7:27 AM
|
|
|
|
|
Thanks very much.
1. _context is System.Data.Objects.ObjectContext
2. ApplyPropertyChanges(string entitySetName, object changed) is the method of System.Data.Objects.ObjectContext
In my tests, the ApplyPropertyChanges method don't do its job for EntityReferences.
finally, I modify the code as following, It work fine.
public void UpdateProduct(Product updated, Category category, Model model)
{
Product original = _context.Product.FirstOrDefault(a => a.ProductID == updated.ProductID);
if (category != null && original.ProductCategory.CategoryId != category.CategoryId) original.ProductCategory = category;
if (model != null && original.ProductModel.ModelID != model.ModelID) original.ProductModel = model;
_context.Attach(original);
_context.ApplyPropertyChanges("Product", updated);
_context.SaveChanges();
}
modified on Monday, November 16, 2009 11:18 PM
|
|
|
|
|
Please use pre tags when posting code. I think you meant to reply to the other poster.
I know the language. I've read a book. - _Madmatt
modified on Monday, November 16, 2009 10:06 AM
|
|
|
|
|
Try having a look here[^]. Look for ApplyReferencePropertyChanges
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,How do I Export data from SQL Server to Excel by vb.net codes
|
|
|
|
|
A few seconds of search would have given you: [This]
|
|
|
|
|
1>connect to the server (sqlserver)
2>go to the database
3>right click to the database the task->export..
4>wizard will pop up
5>then go throught that wizard.....
|
|
|
|
|
hi i'm creating a program with two listview.
one get the "Group" and other get the "members of the selected Group"
but i have problem
only get the first member .
Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
lstestacoes.Clear()
lstestacoes.View = View.LargeIcon
Try
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ind As Integer
Dim temp As String
For Each item As ListViewItem In ListView1.SelectedItems
If item.Selected = True Then
temp = item.SubItems(0).Text
itemSelected = item.SubItems(0).Text
Dim cmd As New OleDbCommand("select * from Estacao WHERE idGrupo= '" & temp & "'", con)
Dim drdr As OleDbDataReader
drdr = cmd.ExecuteReader
If drdr.Read() Then
ind = ind + 1
Dim i As New ListViewItem(ind)
i.Text = drdr.Item("Nome")
i.ImageIndex = 0
lstestacoes.Items.AddRange(New ListViewItem() {i})
Else
cmd.Cancel()
con.Close()
End If
End If
Next item
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
My database have two tables "Grupo" and "Estacoes"
obs : "Grupo" is the Group and "Estacoes" is the members
at the group i have = id,name
and in Estacoes i have = id,name,ip,descricao,grupo
how can i set to get all members ?
SORRY LONG TIME I'M NOT SPEAK ENGLISH
modified on Friday, November 13, 2009 6:09 PM
|
|
|
|
|
Hi,
1.
please use PRE tags instead of CODE tags to make things readable.
You can still edit your original message...
2.
I doubt Dim i As New ListViewItem(ind) is correct.
Try Dim i As New ListViewItem()
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
ok i will use.
but in the data base the colunn idGrupo is "Lab1" for exemple not number.
in group the items are inserted correctly but foe members no, why ?
the problem is when the code are debugin only get one member "the first"
is because i'm searching for string at database for example "Lab1" in colunn "idGrupo" ?
i don't know why he get only the first provabily the code is wrong ^^"
|
|
|
|
|