|
Hi,
I'm not absolut sure, but if you use .NET2.0 there should be an editor where you can edit the ressource file's and the GUI. But I havent worked with it yet (just having a quick look).
I wrote my own ressource file parser that creates an excel file wich I can send to our customers.
Actually i cant send this parser to you because its company restricted (sorry) and offcourse a bit buggy (lol). But its not that hard to do on your own. You simply need to watch out for Attributes that ends with ".Text". I saved the control text along with the control name to the excel file so that I am able to write the modified excel table back to the ressource.
Thats all... a simple recompile and the software is localized (of course you need to check the GUI *hehe*).
Good luck,
Snow
|
|
|
|
|
If you are using professionel translation just send the compiled EXE file, and you should get satallite DLL's back. Can't say it for sure though as we wrote our own translation tools (the commercial available solutions sucked so big time when you ran them at enterprise level), but I would be surprised if they can't handle it. Talk to a few translation vendors to find out what they support.
The editing feature built into Visusal Studio is just for small hobby projects where you manually maintain a language or two - it can't be used for anything serious. But if you only need a language or two translated by someone you know then send them the VS project and let them use VS to translate.
|
|
|
|
|
Please I want to know how to register dll com component in C# using windows API not shell command.
Please I need it very urgent.
-- modified at 11:55 Monday 15th May, 2006
|
|
|
|
|
Umm, AFAIK, you can do this only using the regsvr32 executable. Thus, you will have to pass it a shell command. What's wrong with that? You can still use C# code to execute the shell command:
Process proc = new Process();
proc.StartInfo.FileName = "regsvr32";
proc.StartInfo.Arguments = "myComDll.dll";
proc.Start();
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Thank you for your help
I know that I can still use C# code by using shell commands. But actually I am doing it for someone that asked me to do it using windows API without using the shell commands!
So please if you/anyone have any ideas please send it.
Thank you
|
|
|
|
|
As far as I know, COM dlls are registered on the system using regsvr32. I've never seen an API that registers a COM dll manually. That said, I'm no COM expert.
I mean, dll registration is simply adding the dll to the system and making it known throughout the registry; all things that can be done with the Win32 API of course. In the end though, I see no reason not to simply use the regsvr32 executable; that's what it's there for.
I suppose you might want to try the COM forum instead, as this more pertains to COM than C#.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
There is no one API call that does this. You have to open the component file, parse and get the ALL of the GUIDs and names for each object, method, property, ...whatnot.... Then write each GUID and name to the registry in the appropriate locations.
You can try to implement something like this, probably taking you 6 months of work as you figure out the internals of COM and the API's involved. Or, do it the easy way, and shell out to RegSrv32, and have it done in 5 minutes.
Which option do you think would be more cost effective?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'm sending data from my server app to my client app via TCP socketing...
The data I send is the content of a file, which I know is not larger than 8k.
Thus I fit the entire file content into one pack.
This is my function which handles incomming data, and writes it to the file(Buffer and Pack are classes written by me):
private void myDataArrivalFunction(Buffer bf)
{
while (bf.PacksCount > 0)
{
Pack p = bf.GetNextPack();
string fileName = "blablabla the path to my file";
File.WriteAllBytes(fileName, p.Data);
Application.DoEvents();
try
{
File.Delete(fileName);
}
catch (Exception ex)
{
}
}
}
Once the file has been opened once, File.Delete() fails, saying the file is being used by another process.
I originally used a FileStream object and tried to gain some additional access rights and stuff, but nothing worked.
Even after closing the FileStream object I received the same exception.
Any ideas?
-- modified at 11:16 Monday 15th May, 2006
|
|
|
|
|
Did you close the file after writing to it?
|
|
|
|
|
Yes, I did...
shyagam wrote: Even after closing the FileStream object I received the same exception.
|
|
|
|
|
Could you please post the whole code for the method? The method as it is posted will work fine. My guess is there's something in the "analyze the new file" part that is opening the stream again.
Otherwise, if you're using multiple threads, perhaps another thread is calling this same method or accessing the file somewhere else?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Judah Himango wrote: Otherwise, if you're using multiple threads, perhaps another thread is calling this same method or accessing the file somewhere else?
Indeed, I am using multiple threads.
Though the method IS accessed by multiple threads at the same time, every thread has its own fileName...
Thus, there is no chance (I hope I'm not wrong ) that one thread is accessing another's file.
Taking this a bit further, I've got an array of sockets.
All sockets call this method.
The files I'm sending are jpg files...
I have a class with a Bitmap field, and an array of objects of this class.
On "Analyze the new file" part, I have a call to a method located inside this class, which loads the file into the Bitmap object.
I obtain the index of the socket received the data, and use it as the index in the other array, to load the jpg file into the appropriate object.
public void FromFile(string fileName)
{
bmp.FromFile(fileName);
}
Before posting my original message, I've guessed this might be the problem.
So I've attempted the following:
public void FromFile(string fileName)
{
Bitmap tmp = (Bitmap)Bitmap.FromFile(fileName);
bmp = tmp.Clone();
tmp.Dispose();
tmp = null;
GC.Collect();
}
Didn't work either...
Is it possible that loading the jpg file into the Bitmap object causes a lock of the file?
-- modified at 13:30 Monday 15th May, 2006
|
|
|
|
|
I'm not sure if this helps, but:
Open the file using a stream, load the bitmap from the stream and close the stream.
---
b { font-weight: normal; }
|
|
|
|
|
Damn! I can't beleive it!
It worked!
public void FromFile(string FileName)
{
Stream s = new FileStream(FileName, FileMode.Open, FileAccess.Read);
content = (Bitmap)Bitmap.FromStream(s);
s.Close();
s = null;
GC.Collect();
} Simple, yet deadly...
Thanks Guffa.
Shy.
|
|
|
|
|
shyagam wrote:
s.Close();
s = null;
GC.Collect();
This should give you the same results as the above without abusing the GC. Any object implementing IDisposable should be disposed as soon as you're done with it to free resources.
s.Close();
s.Dispose();
|
|
|
|
|
I'll keep that in mind...
Anyway... I've read somewhere that Close() is the same as Dispose().
What's the difference?
|
|
|
|
|
If you're using multiple threads and something weird is going on, assume multiple threads are modifying/reading the same resource (in this case, a file stream). I'd suggest doing some debug work to verify that 2 threads aren't trying to access the same file.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Islamic Domination: Coming to a Jewish state near you!
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I'm somewhat new to threading...
Could you tip me as for how to check stuff like that?
I know there's the "Debug Location" toolbar, which can help...
But is there anything other than that which might be useful?
|
|
|
|
|
|
Thanks a lot you guyz!
Been hacking at it for more than a week!
Almost gave up! (HAHA! No chance of that happening )
Thanks again...
PS
Judah... Would you still give me those tips please?
Shy.
|
|
|
|
|
Hi. I've a NotifyIcon and a ContextMenu with some options. The problem is that I want to press Left Click (primary button) to open the contextMenu.
I resolve that in this way, may be someone have a better idea (it'll be welcome !!
private void notifyIcon_MouseClick(object sender, MouseEventArgs e){
Control ctrl = new Control();
ctrl.CreateControl();
Point pos = Cursor.Position;
pos.Offset(0,-30);
this.contextMenuAplicacion.Show(ctrl, pos,LeftRightAlignment.Left);
}
The problem is if I press the left button over the icon I see the menu, but if I press the button and then I move out and I click in another window for example the internet explorer, the contextmenu is still there and it's like it's there forever, I must select one option of the menu to close it.
Any ideas? Any of you have an example of use left click button to this notify icon to show me a contextmenu??
Thanks a lot people !!
|
|
|
|
|
Why get so hard?
if (e.Button == MouseButtons.Left)
contextMenuStrip1.Show(MousePosition);
as simple as it gets as simple as it needs!
this will show the contextmenustrip on the mouseposition when left button will be clicked.
and if you must incist:
contextMenuStrip1.Show(MousePosition, ToolStripDropDownDirection.Left);
|
|
|
|
|
Thanks NaNg15241, but if you click another window, you'll see that the contextmenu is still there.
Thanks a lot.
|
|
|
|
|
Well, you can solve it in many ways, one of them is implementing the "mouse leave" event in the context menu to hide it or dispose it. something like this:-
private void contextMenuStrip1_MouseLeave(object sender, EventArgs e)
{
contextMenuStrip1.Visible = false;
//or maybe contextMenuStrip1.Close();
//or any other code to hide or dispose the menu
}
This way, the menu will stay hanging on the screen until the user moves his mouse over it and then out of it, then we will know that he noticed the menu, but doesn't want to make a choice now, and the menu will close.
Another way is to se the contextMenuStrip1.Show() method in the MouseUp of the notifyIcon event to check the position of the mouse first, like:
private void notifyIcon1_MouseUp(object sender, EventArgs e)
{
if(e.Button == MouseButtons.Left)
conextMenuStrip1.Show();
}
This way the menu will not show unless the mouse button has been released over the notify icon.
If this doesn't solve it and you still need help, just post.
Programming is like sculpturing, cutting your way through the rock until you see a shape of your work.. It needs patience.
-- modified at 20:14 Monday 15th May, 2006
|
|
|
|
|
Hi Nader, is there a mouseLeave event for the contextMenu? I'cant see it.
Thanks a lot.
|
|
|
|