Thread View: borland.public.csharpbuilder.graphics
7 messages
7 total messages
Started by Mitch
Thu, 21 Sep 2006 16:57
Exception Loading A Cursor
Author: Mitch
Date: Thu, 21 Sep 2006 16:57
Date: Thu, 21 Sep 2006 16:57
16 lines
1389 bytes
1389 bytes
I'm creating a DLL Assembly for ArcGIS and I'm getting an exception
("Value cannot be null." "Parameter name: dataStream") when creating the
cursor with the following line form an ArcGIS CSharp sample which has
the same problem.
m_cursor = new
Cursor(GetType().Assembly.GetManifestResourceStream("GIS_LINK.move.cur"));
I've also tried:
m_cursor = new Cursor(GetType(),"move.cur") ;
The cursor has been added to the project and is valid. Any ideas?
Mitch Wolberg,
RockWare, Inc.
Re: Exception Loading A Cursor
Author: Marc Rohloff TeamB
Date: Thu, 21 Sep 2006 23:22
Date: Thu, 21 Sep 2006 23:22
22 lines
1935 bytes
1935 bytes
On Thu, 21 Sep 2006 10:57:24 -0600, Mitch wrote:
> I'm creating a DLL Assembly for ArcGIS and I'm getting an exception
> ("Value cannot be null." "Parameter name: dataStream") when creating the
> cursor with the following line form an ArcGIS CSharp sample which has
> the same problem.
>
> m_cursor = new
> Cursor(GetType().Assembly.GetManifestResourceStream("GIS_LINK.move.cur"));
>
> I've also tried:
>
> m_cursor = new Cursor(GetType(),"move.cur") ;
>GetType().Assembly.GetManifestResourceStream("GIS_LINK.move.cur")
Is obviously returning null. I suggest that you get a copy of Lutz
Roeder's reflector (it's free) and look at the assembly and see
exactly what has happened to your resources.
--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: Exception Loading A Cursor
Author: Mitch
Date: Fri, 22 Sep 2006 15:56
Date: Fri, 22 Sep 2006 15:56
30 lines
2178 bytes
2178 bytes
Marc Rohloff [TeamB] wrote:
> On Thu, 21 Sep 2006 10:57:24 -0600, Mitch wrote:
>
>
>>I'm creating a DLL Assembly for ArcGIS and I'm getting an exception
>>("Value cannot be null." "Parameter name: dataStream") when creating the
>>cursor with the following line form an ArcGIS CSharp sample which has
>>the same problem.
>>
>>m_cursor = new
>>Cursor(GetType().Assembly.GetManifestResourceStream("GIS_LINK.move.cur"));
>>
>>I've also tried:
>>
>>m_cursor = new Cursor(GetType(),"move.cur") ;
>
>
>>GetType().Assembly.GetManifestResourceStream("GIS_LINK.move.cur")
>
> Is obviously returning null. I suggest that you get a copy of Lutz
> Roeder's reflector (it's free) and look at the assembly and see
> exactly what has happened to your resources.
>
I'll give it a try but I'm pretty new to .NET and not sure what I'll be
looking for. Is there a "better" (read more reliable) way to add
resources to a project? I amd some trivial changes to the project and a
bitmap resource that was being loaded in the same manner no longer
worked. I see Roeder has a resource editor as well and will look into it.
Mitch
Re: Exception Loading A Cursor
Author: Mitch
Date: Fri, 22 Sep 2006 17:33
Date: Fri, 22 Sep 2006 17:33
8 lines
1555 bytes
1555 bytes
Looked at the DLL in the Reflector and the cursor isn't being added. I looked at the resource file in Roeder's Resourcer and it doesn't seem to recognize the cursor format as its listed as Byte. I tried creating a new one in the ImageEditor (D7) but it still comes in as Byte even though Windows Explorer recognizes it and can read it. Can I typecast it to a cursor? Mitch
Re: Exception Loading A Cursor
Author: Mitch
Date: Fri, 22 Sep 2006 19:16
Date: Fri, 22 Sep 2006 19:16
12 lines
1659 bytes
1659 bytes
Mitch wrote: > Looked at the DLL in the Reflector and the cursor isn't being added. I > looked at the resource file in Roeder's Resourcer and it doesn't seem to > recognize the cursor format as its listed as Byte. I tried creating a > new one in the ImageEditor (D7) but it still comes in as Byte even > though Windows Explorer recognizes it and can read it. Can I typecast it > to a cursor? > > Mitch PS: I can load the Cursor if I do it as a file but this isn't a good solution.
Re: Exception Loading A Cursor
Author: Mitch
Date: Fri, 22 Sep 2006 19:52
Date: Fri, 22 Sep 2006 19:52
19 lines
1708 bytes
1708 bytes
Semi-solved. I created an rsp file and then added the cursor as:
/res:"C:\ArcGIS Samples\My GIS Link\move.cur",MY_GIS_LINK.move.cur
and then did a command line compile:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /noconfig
@"C:\ArcGIS Samples\My GIS Link\cmdMY_GIS_LINK.rsp"
For some reason the cursor wasn't added unless it proceeded a bitmap
resource that I'm also using. And the actual loading code:
m_cursor = new
Cursor(GetType().Assembly.GetManifestResourceStream("MY_GIS_LINK.move.cur"));
There's got to be an easier way. Maybe I need to buy a copy of VS if I'm
going to continue doing C# programming.
Mitch
Re: Exception Loading A Cursor
Author: Claude Daneluzzo
Date: Mon, 16 Oct 2006 13:27
Date: Mon, 16 Oct 2006 13:27
24 lines
2094 bytes
2094 bytes
Mitch <mitch.ABB@rockware.com> wrote:
>Semi-solved. I created an rsp file and then added the cursor as:
>
>/res:"C:\ArcGIS Samples\My GIS Link\move.cur",MY_GIS_LINK.move.cur
>
>and then did a command line compile:
>
>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /noconfig
>@"C:\ArcGIS Samples\My GIS Link\cmdMY_GIS_LINK.rsp"
>
>For some reason the cursor wasn't added unless it proceeded a bitmap
>resource that I'm also using. And the actual loading code:
>
>m_cursor = new
>Cursor(GetType().Assembly.GetManifestResourceStream("MY_GIS_LINK.move.cur"));
>
>There's got to be an easier way. Maybe I need to buy a copy of VS if I'm
>going to continue doing C# programming.
>
>Mitch
Same problem for me to embed easily image resources in the Principal Assembly with BDS C#.
VS is much better since when you add an image resource you can declare it 'as resource' and it is automatically embedded. Then you load it with GetManifestResourceStream and that's done.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads