Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
GeneralRe: iterate over datagrid Pin
kloepper23-Jul-04 4:28
kloepper23-Jul-04 4:28 
GeneralRe: iterate over datagrid Pin
DougW4822-Jul-04 15:41
DougW4822-Jul-04 15:41 
GeneralRe: iterate over datagrid Pin
kloepper22-Jul-04 16:00
kloepper22-Jul-04 16:00 
GeneralRe: iterate over datagrid Pin
DougW4822-Jul-04 16:09
DougW4822-Jul-04 16:09 
GeneralMultiple icons compiled within an .exe Pin
cdengler22-Jul-04 14:58
cdengler22-Jul-04 14:58 
GeneralRe: Multiple icons compiled within an .exe Pin
Roman Rodov22-Jul-04 15:42
Roman Rodov22-Jul-04 15:42 
GeneralRe: Multiple icons compiled within an .exe Pin
Heath Stewart23-Jul-04 5:41
protectorHeath Stewart23-Jul-04 5:41 
GeneralRe: Multiple icons compiled within an .exe Pin
Heath Stewart23-Jul-04 5:49
protectorHeath Stewart23-Jul-04 5:49 
The other reply wouldn't work. Embedded resources are stored differently than Win32 resources (in C/C++, these would be referenced in the .rc file).

There are many ways you can do this. You can use the command-line compiler (csc.exe) and specify the /win32res: switch along with the path to a .res file that contains your win32 resources. In Visual Studio 2005, you will be able to specify this in the environment, which wasn't available in Visual Studio .NET 2002 and 2003.

You can also - after compiling - open the executable (.EXE or .DLL) in Visual Studio. That will show you your resource section. You can import icons and other resources types into the PE/COFF executable (the executable format on Windows).

If you sign your assemblies (and there's no reason not to - it's easy), you should resign them to make sure the hash is correct (shouldn't be a problem, but follow along anyway). Use sn.exe -R MyApp.exe KeyPair.snk, where MyApp.exe is the assembly to be signed (of course) and KeyPair.snk is the path to the key pair you used to sign the assembly in the first place. Usually it's a good idea to enable delayed signing (using the AssemblyDelaySignAttribute) and sign it later anyway, and if you use Authenticode to sign the assembly (the PE/COFF executable, actually) then you'll definitely need to resign it after modifying it (or just don't sign it before modifying it anyway).

Again, Visual Studio 2005 will include this functionality into the IDE, which will be nice.

Alternatively, you might consider just using a native resource-only DLL with the icons you want. Create a new (unmanaged) C or C++ DLL project, add your resources (icons, bitmaps, AVIs, etc.), compile and distribute. The only problem with this approach is that Fusion (the assembly binder which can work seemlessly over the Internet) won't grab it - it only works with .NET assemblies. With installation deployments or (presumably) ClickOnce - a new touchless deployment in .NET 2.0 - this won't be a problem.

 

Microsoft MVP, Visual C#
My Articles
GeneralExporting Crystal Reports to Excel Pin
KSEI22-Jul-04 14:27
KSEI22-Jul-04 14:27 
QuestionSearching for opponents, what do I need? Pin
Link260022-Jul-04 13:04
Link260022-Jul-04 13:04 
AnswerRe: Searching for opponents, what do I need? Pin
TalkingBabb0t22-Jul-04 16:13
TalkingBabb0t22-Jul-04 16:13 
AnswerRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak22-Jul-04 16:33
mveDave Kreskowiak22-Jul-04 16:33 
GeneralRe: Searching for opponents, what do I need? Pin
Link260022-Jul-04 16:45
Link260022-Jul-04 16:45 
GeneralRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak22-Jul-04 16:53
mveDave Kreskowiak22-Jul-04 16:53 
GeneralRe: Searching for opponents, what do I need? Pin
Link260022-Jul-04 16:58
Link260022-Jul-04 16:58 
GeneralRe: Searching for opponents, what do I need? Pin
Colin Angus Mackay22-Jul-04 23:56
Colin Angus Mackay22-Jul-04 23:56 
GeneralRe: Searching for opponents, what do I need? Pin
Link260023-Jul-04 7:13
Link260023-Jul-04 7:13 
GeneralRe: Searching for opponents, what do I need? Pin
Bill Dean23-Jul-04 8:25
Bill Dean23-Jul-04 8:25 
GeneralRe: Searching for opponents, what do I need? Pin
Dave Kreskowiak23-Jul-04 10:40
mveDave Kreskowiak23-Jul-04 10:40 
GeneralReceiving NoNullAllowedException setting SelectedValue from code. Pin
Brett Slaski22-Jul-04 12:01
Brett Slaski22-Jul-04 12:01 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Heath Stewart22-Jul-04 12:11
protectorHeath Stewart22-Jul-04 12:11 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Brett Slaski23-Jul-04 9:30
Brett Slaski23-Jul-04 9:30 
GeneralRe: Receiving NoNullAllowedException setting SelectedValue from code. Pin
Heath Stewart23-Jul-04 10:00
protectorHeath Stewart23-Jul-04 10:00 
Generalnon-static class referencing Pin
Wolfman3222-Jul-04 12:00
Wolfman3222-Jul-04 12:00 
GeneralRe: non-static class referencing Pin
Heath Stewart22-Jul-04 12:29
protectorHeath Stewart22-Jul-04 12:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.