|
Member 9678427 wrote: What am I doing wrong here?
..assuming that it'll be filled, because the getter is called. It will not be initialized, unless "set". This should have been a read-only property, initialized in the constructor.
|
|
|
|
|
can you tell the code for converting speech to text using csharp .net?
|
|
|
|
|
Take your pick[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Hi,
I have a word file. And I am trying to modify the content of this file by using C# (via Microsoft.Office.Interop.Word).
For example: My file includes the below lines:
"Full name: ....
Address: ....
City: .... "
And, I want to change the "full name" and "city" to :
"Full name: John Markery
Address: ....
City: London"
How can I do that ?
Thanks and regards,
|
|
|
|
|
|
Thank you,
I am using it. Do you know how to remove a line (that contain a specify word) or remove a symbol (of Font: Wingdings) ?
|
|
|
|
|
Sorry no, but it's just a question of using the interop features to read and rewrite the file, while removing or changing certain information. You could try a Google search for articles on the subject.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Hi all,
I have a textbox with autocomplete set to suggest.
I want to execute my code in the Textbox_KeyDown event on the enter key,
but enter key is also invoked when I select an item from the text box autocomplete items.
That is not what I want.
I want the selected item in the textbox and then execute my code.
code:
private void opdrverwTextbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Enter) && !string.IsNullOrEmpty(opdrverwTextbox.Text))
{
e.Handled = true;
a lot of other code........;
}
opdrverwTextbox.Clear();
opdrverwTextbox.Visible = false;
opdrverwLabel.Visible = false;
dataGridView_Update();
}
}
I don't want to set autocomplete to suggest-append.
is there a workaround for this?
Merry Christmas,
Groover
b>
0200 A9 23
0202 8D 01 80
0205 00
|
|
|
|
|
Hi all,
Found a solution myself after long google search.
It works but can someone explain how?
here is my new code:
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern short GetKeyState(Keys key);
private void opdrverwTextbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Enter) && !string.IsNullOrEmpty(opdrverwTextbox.Text)&&
GetKeyState(Keys.Enter) < 0)
{
e.Handled = true;
a lot of other code........;
}
opdrverwTextbox.Clear();
opdrverwTextbox.Visible = false;
opdrverwLabel.Visible = false;
dataGridView_Update();
}
Groover,
0200 A9 23
0202 8D 01 80
0205 00
|
|
|
|
|
I am developing an c# application and
it uses many .net assemblies. For some
reason i need to move a dll to program
files folder and that dll depends on
many other assembly present in the
application folder and this makes me to copy all dependent dlls to programfiles
folder. This will cause duplication of dll
in both application and programfiles
directory. I know that moving
dependent assembly to GAC will resolve
this issue but i shound not put many assembly in GAC. So please suggest a
way to make .Net dll to reference its
dependent dlls.
|
|
|
|
|
KASR1 wrote: For some reason i need to move a dll to program files folder
No there is no reason you need to do that.
Just as many other programs do not. What they do is create a sub folder and that is where the application goes.
|
|
|
|
|
I am not sure whether i have confused.
Lets put that again, during deployment of my application i need install a particular dll to program files sub directory (eg. C:\program files\test). But my application will be in different directory. Since the dll Installed away from application directory and it uses/references many dlls present in application directory. How do i make that dll to pick dependent dlls from application directory. I dont want to move to GAC. Hope its clear.
|
|
|
|
|
Your application, let us call in it MyApp.exe will live in the following directly.
C:\program files\MyCompany
The dependent dlls will live in the same directory.
|
|
|
|
|
Lets us take an eg., I have MyApp.exe, Test1.dll,Test2.dll,Test3.dll.
MyApp.exe depends/uses Test1.dll
Test1.dll depends/uses Test2.dll, Test3.dll
If i am installing all binaries to same directory say D:\TestAppln\ then my application will work perfectly.
But due to some issues i need to move Test1.dll to programfiles sub-directory always(e.g, C:\program files\MyCompany) irrespective of installation. My application may reside in any directory.
Since Test1.dll depends on Test2.dll and Test3.dll, i need to copy them from application folder to Test1.dll's folder i'e (e.g, C:\program files\MyCompany). Otherwise Test1.dll will not load.
So my question is how to make Test1.dll to refer its dependant dll from application folder.
I am looking for options other than GAC.
|
|
|
|
|
You can load the dlls dynamically.
Also the AppDomain has an option that allows you to specify a search path.
Creating an AppDomain yourself is one option. However I believe it is also possible to set that in the application itself perhaps via one of the properties.
|
|
|
|
|
Your question is pretty unclear. In a normal .net application you add references to .net assembly. So it has to exist in a location known to the application. If you don't wish to do this you can go the MEF (Managed Extensibility Framework) way. Have a look at these links - MEF in .Net[^]
Cheers,
Karthik
|
|
|
|
|
I am not sure whether i have confused.
Lets put that again, during deployment of my application i need install a particular dll to program files sub directory (eg. C:\program files\test). But my application will be in different directory. Since the dll Installed away from application directory and it uses/references many dlls present in application directory. How do i make that dll to pick dependent dlls from application directory. I dont want to move to GAC. Hope its clear.
|
|
|
|
|
Yes this is possible, for strongly named assemblies, with an addition to the configuration section of the application's configuration file ( appname.exe.config ).
In this example we have an assembly StealthLib.dll which has been moved out of the applications's base directory to v:\Temp . Information about this new location is given in the dependentAssembly element where we must specify the assemblyIdentity and the codeBase .
="1.0"="utf-8"
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="StealthLib" publicKeyToken="e0505f3b3553d5af"/>
<codeBase version="1.0.0.0" href="file://v:/Temp/StealthLib.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Be really careful when editing the configuration file as errors are silently ignored. For example the assembly will not be found if the casing of publicKeyToken is changed to PublicKeyToken.
The Assembly Binding Log Viewer (FUSLOGVW.exe) which comes with the .NET SDK is very useful for resolving assembly loading problems as it will log all the locations that have been searched for dependent assemblies.
LOG: Appbase = file:LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MainProg.exe
Calling assembly : MainProg, Version=1.0.4743.26012, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\VC\Projects\CP\AssemblyProbing\MainProg\bin\Debug\MainProg.exe.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: StealthLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e0505f3b3553d5af
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:LOG: Assembly download was successful. Attempting setup of file: v:\Temp\StealthLib.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: StealthLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e0505f3b3553d5af
LOG: Binding succeeds. Returns assembly from v:\Temp\StealthLib.dll.
LOG: Assembly is loaded in default load context.
Good luck
Alan.
|
|
|
|
|
Oh really great!. your input much appreciated. I have another question, Can we use the configfile for a dll to locate its dependent assembly? Or its only applicable for exe?
|
|
|
|
|
That's an interesting question that I don't know the answer to. Why not try it out? I may look at it tomorrow and if I do I'll post another reply.
Alan.
|
|
|
|
|
Did you get any update on this?
|
|
|
|
|
If you have say App.exe -> DllA -> DllB, i.e. DllA uses DllB and App does not directly reference DllB. If DllA and DllB have been moved out of the application base directory then App.exe.config must be edited to provide separate location information for both DllA and DllB and there is no assumption that DllB now resides in the same place as DllA.
Think of it like this: There is one process and the code in DllA executes in the context of that process. When code in DllA needs to call code residing in DllB then that assembly is loaded by 'the process' whose default locations are the GAC and the application base directory. Overrides to this default behaviour are on a per assembly basis.
Any information contained within *.dll.config is not read automatically and will be ignored.
Alan.
modified 2-Jan-13 17:27pm.
|
|
|
|
|
Thanks for the update. Immm... Need to find a way.
|
|
|
|