|
Google[^] says you can create an Automation Add-in that does the job.
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
www.JacksonSoft.co.uk
|
|
|
|
|
check this:
http://blogs.msdn.com/eric_carter/archive/2004/12/01/writing-user-defined-functions-for-excel-in-net.aspx
richta
|
|
|
|
|
my first dll is
using System;
namespace myfirst
{
public class demo
{
public string getmessage()
{
return "Hi!How Are You";
}
}
}
in folder e:\prac
and more dll is
using System;
using myfirst;
namespace mysecond
{
public class demo1
{
public string getmessage1()
{
demo d=new demo();
string str1=d.getmessage();
Console.WriteLine(str1);
}
}
}
and now i am using csc /t:library mysecond.cs
then i have following error and problem was same.please help me
mysecond.cs(2,7): error CS0246: The type or namespace name 'myfirst' could not
be found (are you missing a using directive or an assembly reference?)
|
|
|
|
|
vikas shukla wrote: are you missing a using directive or an assembly reference?
that tells you what is missing.
csc.exe has a lot of switches, try "csc /?" to get its help, and discover what "/r" does for you.
FYI: csc is part of .NET, hence look in a folder such as C:\Windows\Microsoft.NET\Framework\v2.0.50727
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
|
|
|
|
|
Just because you have the assemblies in the same folder, C# compiler does not automatically resolve referenced assemblies for you. You have to specify the referenced assemblies using the '/r' switch.
|
|
|
|
|
Hi,
I am using the connected Socket communication to send and receive messages from one application to another application. i will send or receive the messages by serializing the objects.
how can i differentiate the different messages received.
Thank you.
|
|
|
|
|
k3rkiran wrote: how can i differentiate the different messages received.
The obvious way is to put an identifier at the beginning of each message.
|
|
|
|
|
I think the absolute simplest way is to lead each message with
a message size field of a known size. Receive that field then use
that count to know how many bytes of message to receive. When you've
received the message bytes, you're ready to read the next message
length field....and so on.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Is it possible to hook the events of a WebBrowser navigation events further than just Navigating? I want to intercept certain types of events, like clicking on a webpages form-control (textarea or submit button)?
Seems to me that I can only hook the rather generic Navigating event which apparently does not allow for me to know the type of event.
Thanks in advance!
|
|
|
|
|
Hi all,
In VB.NET project, I'm trying to add an attachment to MailItem. Visual Studio 2008 timeout after around 60 seconds
A fatal error has occured.....please see Microsoft.....HRESULT=0x80131C8 ErrorCode=0x0
My code is failing at myMailItem.Attachments.Add line. it seems that i cannot add any attachment.
Failing SUB
Sub AddAttachment(ByVal MailId As String)
Dim myOlApp As Olk.Application
Dim myOlkNS As Olk.NameSpace
Dim myMailItem As Olk.MailItem
Dim myAttachments As Olk.Attachments
Dim myAttachment As Olk.Attachment
Const OlkCatExt As String = ".OlkCat"
myOlApp = New Olk.Application
myOlkNS = myOlApp.GetNamespace("MAPI")
myMailItem = myOlkNS.GetItemFromID(MailId, PSTStoreID)
Debug.WriteLine(myMailItem.Subject)
Debug.WriteLine(myMailItem.ReceivedTime)
Dim MyOlCat() As String = Split(myMailItem.Categories, ";")
If MyOlCat Is Nothing Then
'
'
'
Else
For Each OlkCat In MyOlCat
myAttachment = myMailItem.Attachments.Add((OlkCat + OlkCatExt), Olk.OlAttachmentType.olByValue)
myAttachment.DisplayName = OlkCat
'myMailItem.Save()
Next
End If
End Sub
All ideas are welcome
Best
Jean
|
|
|
|
|
Does anyone have any idea how to take a PDF and set this property using iTextSharp or any other free open source tool? Basically the idea is that we have a program generating PDF's and we want to be able to have someone in the office sign the document and then pass it down the line to the next person. Everything I have found has pointed to buying one tool or another, but we would really like to be able to do this without buying any tools.
Thanks in advance for any help!
--
"Keyboard not found. Press < F1 > to RESUME. "
Source unknown (appears in many common BIOSes as a real error message)
|
|
|
|
|
I know its a bit late, but here is a very nice article i found about signing of PDFs using iTextsharp and hence stopping others from tempering it. I hope its helpful for you.
|
|
|
|
|
Salve Michela,
grazie in partenza per l'attenzione. Ho un problema da risolvere abbastana urgentemente.
Premetto che sono una programmatrice .NET autodidatta, per cui presumo che il mio problema dipenda da un'ignoranza di fondo, cmq proverò a spiegarmi nel modo più chiaro possibile.
Sto sviluppando un'applicazione desktop in .NET 2005 (C#) che crea dei report in Word e li memorizza sul disco del client. L'esigenza è che l'applicativo funzioni su pc che abbiano un O.S. che va da Windows 98 a Vista, e di conseguenza che funzioni con tutte le versioni di Office.
Sul pc di sviluppo (XP) è installata la versione di Office 2007, per cui nell'applicazione punto alle seguenti librerie (v. 12.0.0.0)
- Microsoft.Office.Interop.Word
- Microsoft.Vbe.Interop
- office.dll
e per creare i report mi baso su dei modelli (.dot) creati sempre con word 2007, ma salvati con formato Word 97-2003.
Aggiungo che per puntare alla directory su cui vengono salvati i .doc, utilizzo la variabile Application.StartupPath + "percorso relativo all'interno della dir di installazione".
Ovviamente sul pc di installazione va tutto bene, ma se mi sposto su un altro pc, anche sempre con XP ma con una versione differente di Office, le cose nn quadrano più.
Trattandosi di oggetti COM, nel progetto di setup ho aggiunto la registrazione delle librerie (opzione VsdraCOM) e la registrazione nel Registry Key delle dll. Ho creato i file reg appositi con l'utility RegAsm delle dll su menzionate.
Fatto sta che la situazione è la seguente:
Nel GAC sono registrate le versioni 11.0.0.0 e 12.0.0.0 delle librerie suddette
Nel Registry Key ho un errore dovuto al caricamento dei tipi dll.
E non ho impostato nulla di particolare riguardo i diritti di lettura/scrittura su disco.
Dovrei forse creare una zona "trusted" con AppDomain o sbaglio qualcosa nella registrazione delle COM??? o altro!??!??!
Ho le idee un po' confuse su quanto ci sia da fare per risolvere questo problema, ma mi chiedo (e giro la domanda): è possibile raggiungere l'obiettivo prefisso senza l'ausilio di librerie ad hoc, come ad es CrystalReport? Cioè, possibile creare dei report validi per tutte le versioni di word, ceh giri su pc che hanno anche OS datati?
Nel caso in cui si possa fare, ti sarei grata se almeno potessi indicarmi degli articoli di riferimento.
Purtroppo sono arrivata ad avere davvero poco tempo a disposizione per risolvere questo problema.
Grazie ancora e buon lavoro,
Daniela.
|
|
|
|
|
This is an English speaking board.
|
|
|
|
|
Signor Pallini can probably deal with it.
|
|
|
|
|
Cara Daniela,
perché non scrivi la tua richiesta in inglese?
---
Dear Daniela,
why don't you write your request in English?
Michela
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
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?
|
|
|
|
|