It seems like the only way is to rewrite my code.
Thanks for your help.
"Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
meddelandet news:#pNa#XHVDHA.1316@TK2MSFTNGP12.phx.gbl...[color=blue]
> Marcus,[color=green]
> > Yes I set the Build action to Embeded Resource, but it is not exactly[/color][/color]
the[color=blue][color=green]
> > same thing.[/color]
> For bitmaps, other than namespace how is it different? As your found out,
> .resx files are actually compiled and embedded as .resources.
>[color=green]
> > Do you know how to specify witch namespace to put them in?[/color]
> I do not know how to control the namespace that VS.NET uses when it[/color]
includes[color=blue]
> the resource. I wish I did.
>
> The little bit of testing I have done with it, C# seems to behave better
> about it, then VB.NET does. In that the namespaces that C# uses seem more
> natural.
>[color=green]
> > I called "myAssembly.GetManifestResourceNames()" and I found the name
> > "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid[/color][/color]
resX[color=blue][color=green]
> > input. It seems like VS is doing something with the resX-files.[/color]
> VS.NET compiles your .resx files into .resource files, it then embeds the
> .resource file into the assembly. You will need to change your code that
> uses .resx to use .resource. The ResourceManager makes this rather easy.
>
>[/color]
http://msdn.microsoft.com/library/de...us/cptutorials
/html/resourcemanager.asp[color=blue]
>
> Hope this helps
> Jay
>
> "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> news:uX3vxqGVDHA.1172@TK2MSFTNGP11.phx.gbl...[color=green]
> > Yes I set the Build action to Embeded Resource, but it is not exactly[/color][/color]
the[color=blue][color=green]
> > same thing.
> >
> > For the images, it seems like they are included the same way, but they[/color][/color]
are[color=blue][color=green]
> > all put in a namespace like "Marcusoft.TextWrite.res.CommandIcons.bmp"[/color][/color]
but[color=blue]
> I[color=green]
> > want them to exist outside the namespace like "CommandIcons.bmp". Do you
> > know how to specify witch namespace to put them in?
> >
> > I called "myAssembly.GetManifestResourceNames()" and I found the name
> > "Marcusoft.TextWrite.res.MainFrame.resources", but it is not a valid[/color][/color]
resX[color=blue][color=green]
> > input. It seems like VS is doing something with the resX-files.
> >
> > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > meddelandet news:uBbuawFVDHA.2508@TK2MSFTNGP12.phx.gbl...[color=darkred]
> > > Marcus,
> > > That's fine, you do not need to use the WinForm Designer with VS.NET.
> > >
> > > My question still stands: Did you add the MainFrame.resx to your[/color][/color]
> project,[color=green][color=darkred]
> > > and set the build action to Embedded Resource.
> > >
> > > As it sounds like you want to embed the resource in the exactable, to[/color][/color][/color]
do[color=blue][color=green][color=darkred]
> > > this with VS.NET, you add the resx file to your project, and set the[/color][/color]
> build[color=green][color=darkred]
> > > action to embedded resource. Did you do that?
> > >
> > > If you have done the above, and it is still not working, I suspect the
> > > namespace of your resource does not match the namespace you are trying[/color][/color]
> to[color=green][color=darkred]
> > > use to retrieve it. You can use Reflector to verify the namespace. See
> > >
http://www.aisto.com/roeder/dotnet/ for Reflector.
> > >
> > > > Is there any way to send this option to the compiler manually in VS?
> > > Yes there is! ;-)
> > >
> > > Build Action = Embedded Resource. Works for .resx files and any other[/color][/color]
> file[color=green][color=darkred]
> > > type you give it.
> > >
> > > Hope this helps
> > > Jay
> > >
> > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > news:OPM$iaDVDHA.1600@TK2MSFTNGP09.phx.gbl...
> > > > I've added the files to the project and tried different settings for[/color]
> > Build[color=darkred]
> > > > Action. I won't be using the WinForm-designer since my forms are[/color]
> > handmade.[color=darkred]
> > > I
> > > > just want to edit my code in vs and use the build function.
> > > > This problem applies to all my images too, and I just want my[/color][/color]
> resources[color=green]
> > to[color=darkred]
> > > > be included the same way that the "/resource:image.png" option does.
> > > > Is there any way to send this option to the compiler manualy in VS?
> > > > Thanks for trying to help me!
> > > >
> > > > "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@email.msn.com> skrev i
> > > > meddelandet news:ORLcqF9UDHA.2316@TK2MSFTNGP09.phx.gbl...
> > > > > Marcus,
> > > > > Did you include MainFrame.ResX in your project?
> > > > >
> > > > > Did you set the Build Action (in the properties window) for the[/color][/color]
> above[color=green][color=darkred]
> > > file
> > > > > to Embedded Resource?
> > > > >
> > > > > Watch namespaces. Use Reflector to verify the names of the[/color][/color][/color]
resources[color=blue][color=green]
> > in[color=darkred]
> > > > the
> > > > > assembly.
> > > > >
> > > > > Note: If you have a form names MainFrame, VS.NET will create a
> > > > > MainFrame.Resx for you. Use Show All Files in solution explorer.
> > > > >
> > > > > Hope this helps
> > > > > Jay
> > > > >
> > > > > "Marcus Ahlberg" <cable_guy6@swipnet.se> wrote in message
> > > > > news:O4H3oz7UDHA.532@TK2MSFTNGP09.phx.gbl...
> > > > > > I've been coding a C# project in "pure code" and I would now[/color][/color][/color]
want[color=blue]
> to[color=green][color=darkred]
> > > > > import
> > > > > > it into VS.net. I have created a project and imported all[/color]
> > sourcefiles[color=darkred]
> > > > and
> > > > > > it's compiling without problems, except for the resources.[/color][/color][/color]
Before,[color=blue]
> I[color=green][color=darkred]
> > > > built
> > > > > > the program using a batchfile and linked the resources with the
> > > > > > "/resource:MainFrame.resX" option. Then I loaded them with this[/color]
> > code:[color=darkred]
> > > > > >
> > > > > > Assembly myAssembly = Assembly.GetAssembly(this.GetType());
> > > > > > Stream resXStream =
> > > > > > myAssembly.GetManifestResourceStream("MainFrame.re sX");
> > > > > > ResXResourceSet resX = new ResXResourceSet(resXStream);
> > > > > >
> > > > > > The problem is the way VS manages resources. It can't find
> > > > MainFrame.resX
> > > > > > and i get an error because resXStream = null. I've tried to[/color][/color][/color]
change[color=blue][color=green]
> > the[color=darkred]
> > > > > > "Build Action" -property of the files, but it doesn't seem to[/color][/color][/color]
make[color=blue][color=green]
> > any[color=darkred]
> > > > > > difference. It's the same problem with images. Is there any way[/color][/color][/color]
to[color=blue][color=green][color=darkred]
> > > > change
> > > > > > the way the resources is included? I don't want to rewrite the[/color][/color]
> whole[color=green][color=darkred]
> > > > > program
> > > > > > because of incompability between VS and the compiler.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]