|
Hello
Well, here is an article about exactly what you want:
Click Here[^]
Regards
|
|
|
|
|
Thanks Nader,
Best Regards!
Charith
jayasshc
|
|
|
|
|
If I have a WinForms application, and I want to store an image in the project, but
- I don't want to bloat the executable (imbed the image there)
- I don't want the image to be an external file (for safety, so other programs can't easily change it)
What are my best other options?
|
|
|
|
|
Maybe, if you add the image as a resource (in a resource.resx file) in another project (other than your executable project) and then compile it as a dll. Thus, your executable project would call whatever you want from this dll.
I don`t know exactly if this works, but give a try.
good luck
|
|
|
|
|
Hello
Beside what has been said, another way is to aggregate several images in a file -call it for example .isf-. Make a project called "Image Packager" for exaple to store these images knowing exactly their sizes by bytes. Now in your main project you can access them by their Filename:Byte location. Read each image in a filestream, then use this stream to make a bitmap object.
PS.
One simple trick is to store them in different names only without aggregation. Like renaming "MyImage.bmp" to "Rfgh.dat". no one will know this is an image file. Stupid, but sometimes works!!;P
Regards
|
|
|
|
|
Hello,
I have the following method to help me in installing some COM
components onto the machine...below is a snippet that is causing the
problem...
Type objType = null; <br />
COMAdminCatalog objCatalog = null; <br />
COMAdminCatalogCollection objApplicationsColl = null; <br />
COMAdminCatalogObject objApp = null; <br />
try <br />
{ <br />
objType = <br />
Type.GetTypeFromProgID("COMAdmin.COMAdminCatalog"); <br />
objCatalog = <br />
(COMAdminCatalog)(System.Activator.CreateInstance(objType));
It is part of setup application...so when I run the setup on my
machine, it works fine....
However, when I try to test it on one of our servers.....I get a
Specified Cast is Invalid exception from this line objCatalog =
(COMAdminCatalog)(System.Activator.CreateInstance(objType));
I am guessing its a problem with either one of the last two
line....forgive me, im new to COM
Thanks in advance
|
|
|
|
|
Hi!
Did you verify that objType is correct on the server?
Is the COM class registered correctly on the server?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
i make ContextMenuStrip
i add four ToolStripMenuItem in ContextMenuStrip
now on run time i want to make for loop to list all ToolStripMenuItem in the ContextMenuStrip
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(ContextMenuStrip))
{
foreach( Control m in c.Controls )
if ( (c).Name.Substring(3).Equals(cellid.ToString()) )
{
(c).Enabled = boolenvalue;
}
}
}
the problem now there is nooo thing name {{ c.Controls }}
Palestine
|
|
|
|
|
what i can do ??
Palestine
|
|
|
|
|
ContextMenuStrip has specific purpose and capability. What is your purpose of using it?
Best,
Jun
|
|
|
|
|
Hello
What I understood is that for some reason you want to iterate through MenuItems present in a ContextmenuStrip. Here is the code:
foreach(TooStripItem MyItem in MyContextMenuStrip.Items)
{
}
If I were wrong, post me some details of what you really wanted.
Regards
|
|
|
|
|
|
I have three projects...
1) An interface definition dll as Project1.
2) An object definition dll as Project2.
3) A test application as Project3.
Class1 in Project2 implements the interface defined in Project1.
The test application uses Class1.
For some reason, I have to add a reference to the interface dll in both Project2 and Project3! I thought it would only be necessary to reference the interface in Project2, and that it would not be necessary to reference the interface in the application that uses Class1 in Project3.
Is this the expected behaviour?
|
|
|
|
|
Have you declared an interface pointer in Project3 code?
Best,
Jun
|
|
|
|
|
No... Project3 creates an instance of Class1.
|
|
|
|
|
Search the boards. I remember that the exact same question was asked not long ago.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
I have a generic class: myclass<T> where I put T as either a float or a double. However whenever I compile I get the error:
Cannot convert type 'T' to 'float'
I know that any of the types I use can be converted to a float. How can I tell the compiler this?
thank you
|
|
|
|
|
You didn't give the code so I'm guessing here...
Did you do an exlicit cast?
myclass<float> x = new myclass<float>(5.6);
double y = (double)x.value;
If that fails, you could always do something uglier:
float z = x.value;
double y = (double)z;
|
|
|
|
|
Use the where clause to add a constraint to the generic type T , so that it has to implement the IConvertible interface. Afterwards you can use the ToSingle method to convert instances of the generic type T to Single (float ) type.
class myclass<T> where T : IConvertible
{
private void Test(T q)
{
float x = q.ToSingle(null);
}
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
Problem 1...
I now have the same problem, but the other way round. How can I convert a float to type T (which is either a float or a double and is iconvertible)?
I get the error:
Cannot convert type 'float' to 'T'
Problem 2...
The error:
Operator '*' cannot be applied to operands of type 'T' and 'T'
when I multiply two numbers
What can I do about this? Does float inherit from some class that defines basic mathematical operations?
All help is greatly appreciated.. I feel the end is in sight!!
thank you
|
|
|
|
|
Hi,
I have a documentstream that i get back from a Reporting Services Render. The stream is valid and holds that data of the report. I want to use this stream in the Webbrowser component so i use webbrowser1.DocumentStream = myStream. The problem is the webbrowser control shows nothing just a blank page. Is this a bug or should i do something else ?
Thanks in advance for any help !
|
|
|
|
|
hi all,
i'm trying to run a url that sends our username and password with a message with a number. This will then send a sms to the client's chosen number.
I tried to use: Process.Start(URL) but this opens the url in the web-browser.
Now i'm trying to figure out what this is doing.
HttpWebRequest Request;
StreamReader ResponseReader;
Request = ((HttpWebRequest)(WebRequest.Create(URL)));
ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
Can somebody take a look at this code and try to explain what this particular code does? I saw it in an example but dont know if it is all i need to be able to run the url...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
NarutoFan#1 wrote: HttpWebRequest Request;
Defines an object of type HttpWebRequest (in the System.Net namespace), but does not actually create the object.
NarutoFan#1 wrote: StreamReader ResponseReader;
Defines an object of type StreamReader (in the System.IO namespace), but does not actually create the object.
NarutoFan#1 wrote: Request = ((HttpWebRequest)(WebRequest.Create(URL)));
This line actually gets an HttpWebRequest object and places it into the variable defined in 1) above. It gets this object by a static call to the WebRequest.Create method. The WebRequest object can be found in the System.Net namespace.
NarutoFan#1 wrote: ResponseReader = new StreamReader(Request.GetResponse().GetResponseStream());
This line creates the StreamReader object defined in 2) above. It does so using one of the standard constructors on this object that takes a Stream (System.IO namespace) object. It gets this Stream object by a call to the HttpWebRequest.GetResponse method.
This code is pretty standard and you can trace through exactly what each line does by stepping over the code and reading the documentation for each object & method used.
|
|
|
|
|
how can i access controls from another form!??
lets say i have:
Form1
Form2 (listView1)
Form3
Form4 (button1)
what do i do so when ever i click button1 on form4 clears items in listview1!??
thank you!
It Is Not That I'm Different!
... I'm Only Making The Difference!
|
|
|
|