|
If the icons in are compiled into .resources files, then the MSI package (which I'm well aware of how it works - I've been on the beta testing team since before 1.0) has nothing to do with it. The icons are compiled into the assembly. This is also true if you add an image (or anything, really) to your project and set the build action in the PropertyGrid to "Embedded Resource". Only in this case the file is embedded - not compiled into a .resources file.
So, the next question is: what's the current culture setting for these people with problems? How are you accessing the icons (or are you just using the designer for everything)? Frankly, I've seen this problem, not even when different UI cultures are used since the ResourceManager will fallback to the neutral language resources, which are those resources in your primary assembly (the assembly with modules, which contain the IL).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm developing kind of an explorer-like application, that lists local drives/folders and also network drives, as explorer does. When the user enters a path like C:\folder1\folder2, I can browse the tree to select that tree.
However, when the user enters something like \\computername, or \\computername\shared, then how should I browse the tree to select that one? I can't enumerate all domains to check where that computername can be found (takes hours), so what is the correct approch? Can I, for example, check to which domain a computername belongs, or something like that?
Kind regards,
Ludwig
|
|
|
|
|
lustuyck wrote:
Can I, for example, check to which domain a computername belongs, or something like that?
Yes, you can, but you'll need to P/Invoke NetWkstaGetInfo and declare the WKSTA_INFO_100 structure that goes with it. Lookup this function in the MSDN Library[^] for more information.
Windows Explorer does this using ITEMIDs and monikers to get those IDs. Using this information - a namespace, if you will - it can determine a path rather quickly (of course, a shell namespace provider parses the moniker). While it would be possible to use the necessary shell APIs to do this, you're looking at a huge effort to P/Invoke, interop, and declare all the necessary structs and consts to do this in C#. If you take this route, I recommend you create a mixed-mode Managed C++ assembly (i.e., contains both native instructions and IL that can be used by other managed projects). This way you don't have to worry about interop - just use the native methods, include the headers with the pre-proc defs you need, etc., etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Okay, thanks for the answer, I got it working!
Kind regards,
Ludwig
|
|
|
|
|
Have a look at Furty's FolderTreeView[^] control.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thanks, but this does only support drilling to a folder, not to a UNC...
|
|
|
|
|
I write a component that have a MyDataSet and MyDataAdapter properties and when drag on a form, brows all Datasets and object on the container form.
I also have a main form that contain all datasets and datadapters and in this form,I prepar and fill my datasets. I want when i drop my component on each other forms, it MyDataSet and MyDataAdapter can see and brows DataSet and DataAdapter from MainForm.
please guide to me.
Thanks.
Hadi : hd_ali@yahoo.com
|
|
|
|
|
In your component, you must set the access modifiers (you can do this in the PropertyGrid) to something other than private (the default), like public or internal. This should allow you to click on them and execute custom actions defined by those class's designers.
Otherwise, you may have to implement a custom ComponentDesigner for your component and then attribute your component with the DesignerAttribute that specifies the Type of your designer you implemented.
You can read more about extending design time capabilities in the .NET Framework SDK. Read Enhancing Design-Time Support[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i reply an another question by your "email". please check. thank
|
|
|
|
|
I have a class which wraps some database operations, the following code causes errors:
internal void Close()<br />
{<br />
try<br />
{<br />
if(_dbConnection != null)<br />
{<br />
if(_dbConnection.State == ConnectionState.Open)<br />
_dbConnection.Close();<br />
_dbConnection.Dispose();<br />
_dbConnection = null;<br />
}<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show(ex.StackTrace);<br />
}<br />
}
_dbConnection.Close() - always fails and triggers the catch block which then fails with a System.InvalidOperationException with the message " LocalDataStoreSlot storage has been freed" - what on earth is that all about?
At this rate I am thinking of going back to VC++ - it is so much easier, I never had memory handling issues in C++ yet in C# and VB.NET I spend 80% of my time on memory management and I am getting sick of it.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
PaleyX wrote:
I never had memory handling issues in C++ yet in C# and VB.NET I spend 80% of my time on memory management and I am getting sick of it.
Odd. I spend about 2% of my time on it.
What does the rest of the code look like? How is the connection opened and passed to other objects? Are you opening a connection and keeping it open for the duration of the app? (A horrible idea I might add!) Are you calling Dispose on any objects involved?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Instead of knocking .NET, you should try reading about it before making snap decisions. For example, setting the variable to null after calling Dispose is entirely unncessary.
Also - being a C++ developer - you should know better than to assume a flagged enumeration may have only one enum value set. Instead of _dbConnection.State == ConnectionState.Open , you should use (_dbConnection.State & ConnectionState.Open) != 0) or something similar.
If you're multi-threading this code, it's possible that a command may be executing using that connection, which other ConnectionState values can tell you.
When you're done, all you need to do is call _dbConnection.Dispose() , which will close the connection and free unmanaged resources. Doing all three of those is unncessary. Why is there a Close in addition to Dispose ? Because you may want to re-open the connection later, but if you dispose it, you can't - you'll get an ObjectDisposedException , since it has already been disposed.
If you read and understand the documentation for the .NET Framework, this can be a very good environment, but if you prefer VC++ that's fine, too. Just don't knock something because you did something wrong.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for that. Sorry about the tone of my original post, I was annpyed with myself more than with VS.NET.
The code isn't actually mine, it's something I have "inherited".
The application does keep a connection open but it's a connection to a small Access database and isn't meant to be multiuser. I imagine the original author wanted to squeeze a bit of extra performance out of it but obvioulsy he did at the expense of being correct.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
Hello,
I have a simple question : is it possible in vba( in outlook ) to code something that would load the mailbox of the user that is currently logged to the computer ? This is done in a nt/2000 environment so it is easy to get the username with : Environ("UserName"). But is it possible that when outlook starts to manually code the settings so the user will have access to its mail without having to configure outlook ?
Thanks!
Phil
|
|
|
|
|
Tartampion wrote:
is it possible in vba
This forum is for C# questions, please try somewhere else.
www.troschuetz.de
|
|
|
|
|
1. This is a C# forum, not a VBA or Visual Basic Forum.
2. No. This is because the user that is logged in will not have the appropriate rights to the other users mailbox files stored on the C: drive.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry about the wrong thread guys, i should have posted it in work issues or something...my mistake
1. Thanks for the wise advice
2. Thanks man i will stop searching that way and try to find another solution.
3. next post will be in the right place
Cheers!
Phil
|
|
|
|
|
I have made a custom usercontrol in#, but when I press an arrow key neither the eventhandler for KeyDown, nor for KeyPress or KeyUp are called. Does anyone know how to capture array keys strokes?
|
|
|
|
|
Try overridding the ProcessCmdKey method of your user control.
#include "witty_sig.h"
|
|
|
|
|
I used to struggle with that one too.
Here is snippet of how you can do that:
<br />
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)<br />
{<br />
if (keyData == Keys.Up)<br />
{<br />
return true;<br />
}<br />
return false;<br />
}<br />
|
|
|
|
|
can Anyone educate me on the namespace I can use to read excel file data in ASP.Net(C#)
Tanx
|
|
|
|
|
There is no such namespace native to the BCL. You have to set a reference to the Primary Interop Assemblies for Office (XP and 2003), or the Microsoft Excel Object Library (2000 and below), to use Excel in your app.
There is an article demonstrating this here[^] on CodeProject. It's not done is ASP.NET, but it gets the point acrossed.
Warning, using Excel in a ASP server project like this will consume A LOT of resources, is not very fast, and is NOT recommended because Excel will be launched on a PER PAGE REQUEST basis. So keep your use of Excel to the absolute minimum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You have to reference the Office Excel PIA (Primary Interop Assembly). For Office XP, you can download the official PIAs from Microsoft from http://www.microsoft.com/downloads/details.aspx?FamilyId=C41BD61E-3060-4F71-A6B4-01FEBA508E52&displaylang=en[^]. For Office 2003, these are installed from the Professional CD when you choose to install the .NET Framework something-or-other (don't remember exactly what the feature was called, but it should be obvious).
For older Offices (or even to support older versions, which are backward compatible with newer versions most of the time, at least for the basic stuff like reading data), you can generate the interop assembly (RCW, or Runtime Callable Wrapper) using tlbimp.exe from the SDK - or even easier - right-click on your project, select Add Reference, select the COM tab, then find Microsoft Excel. When you add this to your references, an interop assembly is created for you.
Then you add the (typically - it may be slightly different) Microsoft.Office.Interop.Excel namespace to your C# source file and begin using.
The classes and their members are exactly the same (to use) as what's documented for VBA (Visual Basic for Applications) within Office. The documentation on MSDN[^] is very lacking, but the local help files for Office (if you installed the developer help files) are much better.
There are several articles about using Office applications in your .NET application both here on CodeProject and elsewhere on the 'net. I suggest you try using the search bar above, or use google[^] to find additional articles.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi...I have 2 questions...
1. How i can compile my application that it can run in un .net OS's??
2.when betide a error in my application, show a error message that Continue or Quit ... can i substitution my own error message with that, whithout i want to prevention and definition all of errors maybe betide in my application... ??
|
|
|
|
|
1.
Don't know exactly what you mean here
2.
To display an error message call the static MessageBox.Show method. It has many overloads which give you the possibility to customize it. See the documentation for more info about that. Afterwards evaluate the returned DialogResult .
The following is only a simple example:
if (MessageBox.Show("This is an error") == DialogResult.OK)
{
}
else
{
}
www.troschuetz.de
|
|
|
|
|