|
Hi,
I have to build a layer of serviced components over a DAL (data access layer). Now this DAL was written using interop in VC++.
I built my component using a snk - which worked fine till i added the code to access DAL. Now it gives me an error sayin that assemly cannot be created as DAL does not have a strong name.
How do I get rid of this problem? How can i reuse the existing component without having to rewrite it in .net environment?
I recently read an article sayin that i would have to generate a strong key for the interop dll using tlbimp... but i somehow am not able to figure the parameters out ... has anybody done this?
Any help will be appreciated!
|
|
|
|
|
Hi,
I'm developing a remote application, which means a windows application that controls an existing windows application by using the Win32 API (SendMessage, FindWindow, etc.). Problem is the following: The other application, which already runs and has to be controlled, has a button, that opens an OpenFileDialog, when being clicked. My remote application does so by sending the appropriate message to the other form. The OpenFileDialog is shown, but my remote application stops processing its code, it doesn't continue working (easy to see in debugger: code is executed till button click command is sent, then everything stops. If I manually cancel the OpenFileDialog, rest of the code is executed)! This is a situation that I want to avoid, I want the application to work on. Any ideas how to circumvent that?
Greetings
working in visual c# express 2005
developing usual windows application
|
|
|
|
|
Found the problem: I used SendMessage instead of SendNotifyMessage.
|
|
|
|
|
How do I write a "Hello World" string stored in a (*.txt) file to the Console output?
using System;
using System.IO;
//Is this the right idea??
//Please-- show me CODE not the "just use use a "-----" answer....
namespace StreamReaderWriter
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
// TODO: Add code to start application here
//@"C:\Documents and Settings\Desktop\Text01";
string file_name = (@"C:\Documents and Settings\Desktop\Text01");
StreamReader fReader = File.OpenText(file_name);
StreamWriter fWriter =
File.CreateText(@"C:\Documents and Settings\Desktop\Text01");
//Now, how do I get the "Hello World" in the text file
to the console output??
}
}
}
thanks a lot for your help.....
|
|
|
|
|
Console.Writeline(fReader.readline());
I corrected this mistake in another post 2 down
-- modified at 11:49 Friday 18th August, 2006
|
|
|
|
|
...---... wrote: Please-- show me CODE not the "just use use a "-----" answer....
Have you tried reading the documentation for StreamReader?
From MSN Search[^]you can find the top two links will take you to the StreamReader Class documentation[^]. There you will find a table with lots of handy "How to..." links. One of which takes you to Reading Text From A File[^] which shows you step-by-step exactly what you are trying to do.
Does this help?
|
|
|
|
|
Sorry for my mistake, here is the correct line
Console.WriteLine(fReader.ReadLine());
|
|
|
|
|
...---... wrote: show me CODE not the "just use use a "-----" answer....
Are you really that lazy?
|
|
|
|
|
|
Process.Start("type filename"); :p
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
this answer is really fantastic...
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
Stealing my old signatures? Would you steal my grave as quick?
|
|
|
|
|
With apologies, I just rotate through cool stuff I have copied and pasted in a sigs text file. Perhaps you can take it as a compliment rather than an offense
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: With apologies, .... Perhaps you can take it as a compliment
Oh no. I do take it as a compliment.
I guess even the smilies around my very poor joke didn't work. (Since starting to work in Glasgow I'm picking up their very cynical sense of humour - And I move there next month so I guess it is going to get worse!)
|
|
|
|
|
Those damn irish, j/k
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
for heavens sake, when a hint is given to you you should at least try it.
Anyway, I also was happy when people helped me with my probs, so here is my suggestion:
private void InitializeStreamReader()
{
System.IO.FileStream fstream = System.IO.File.OpenRead(@"c:\test.dat");
System.IO.StreamReader sreader = new System.IO.StreamReader(fstream);
string[] filecontent = sreader.ReadToEnd().Split('\n');
sreader.Close();
foreach (string contentTemp in filecontent)
{
Console.WriteLine(contentTemp);
}
}
Here is a short explanation what is done in this example:
A Filestream is created
A Streamreader which uses the Filestream
the streamreader reads all the content of the file an splits it by the new lines
(every new line is a new element)
these elements are used in a string array
the streamreader is being closed
and now to the interesting part:
every line in the string array is being displayed via console.writeline
Of course it can be done easier, but I think you´ll like it this way as well
|
|
|
|
|
Ezazel
Thanks a lot. I think I see the "why" ...
|
|
|
|
|
Ive been trying to find an example on how to make a progress bar progress with the copying of a file using the copyTo command. does anyone know how to make it work?
|
|
|
|
|
You won't be able to do a real progress bar with File.Copy because it is synchronous and does not give any feedback as to the overall progress of the operation.
You could easily do this yourself, however. Open the file you want to copy, and create a destination file you want to copy the file to. Read in the source file byte-by-byte, and write those bytes to the destination file. Every few bytes, raise an event indicating the overall progress of the operation. Interested components would simply listen to that event and could update the value of a progress bar if they wanted.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: And in this corner, the Party of Allah
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
How would I go about doing this? Im still pretty new to C# and havent learned alot of things yet
|
|
|
|
|
|
Up
I am a chinese I love my country.
|
|
|
|
|
there is a much simpler option. Simply add the reference, Microsoft.VisualBasic dll to your c# references project.
Within the Microsoft.VisualBasic dll is the VB.NET file copy routine which displays a copy progress dialog much like the windows one. Here is an example.
Microsoft.VisualBasic.FileIO.FileSystem.CopyFile("c:\helloworld.txt","c:\temp\helloworld.txt",UIOption.AllDialogs,UICancelOption.DoNothing);
|
|
|
|
|
Hi,
i tried ur way but cought in probs.
i gives me with error
"the type or namespace name 'FileIO' does not exists in the class or namespace 'microsoft.visualbasic' (are you missing ans assembly reference?)"
i have also included the reference in the project of microsoft.visualbasic
dont know wats the prob.
can u help?
Nitin...
|
|
|
|
|
Are you using visual studio 2005? As it works for me under that IDE. Apart from that I cant work out what could be your problem.
|
|
|
|