|
Hi,
I want to display icon for menu items and i am using window application.
I look forward to the reply
-- modified at 3:36 Tuesday 21st February, 2006
|
|
|
|
|
Hi
I am trying to create a ActiveX object from a C# web service. When I create the object I get a "Permission denined" exception.
If I create the same object not from a web service, it works OK.
Here is the code:
V8O_PLU.CPluClass o ; // COM object
o = new V8O_PLU.CPluClass(); // exception occurs
Late biding causes same problem:
Type ObjectType = Type.GetTypeFromProgID("V8O_PLU.CPlu");
object po = Activator.CreateInstance(ObjectType);
Can anyone please advise why is this happening?
as I said, the same code works OK from a non-web-service code (e.g. WinForm).
Thank you.
|
|
|
|
|
The problem was that aspnet_wp.exe runs under the user ASPNET . The ASPNET user is defined as part of the Users group.
For some reason, on my development PC the ActiveX DLL's do not have permision for the Users to access. . Once I added the Users to the security list of my ActiveX's it works OK.
On my QA systems these DLL's do allow the Users group to run them. Strange.
|
|
|
|
|
Hey Howzit?
As you can see in the code below I am generating a Bitmap and saving it to disk, later in my program I display this .tiff file as the backgroundimage of a Panel. My question to you is, how can I generate multiple Bitmaps IN MEMORY (instead of saving to disk) and then display them later when I need to?
Thanks
using (Bitmap bitmap = new Bitmap((int)(scale * page.Width), (int)(scale * page.Height)))
{
Graphics graphics = Graphics.FromImage(bitmap);
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.ScaleTransform(scale, scale);
graphics.Clear(Color.White);
page.Draw(graphics);
bitmap.Save("C:\\" + Convert.ToString(_currentDPI) + "dpi.tiff", ImageFormat.Tiff);
}
|
|
|
|
|
Use class local variables. Create an array of bitmaps (or an arraylist). Create the bitmaps.
class BitmapGenerator {
private ArrayList bitmaps = new ArrayList();
public YourFunction() {
...yourcode..
bitmaps.Add(bitmap);
}
}
------------------------------
A bug in a Microsoft Product? No! It's not a bug it's an undocumented feature!
|
|
|
|
|
Hey, thanks works, but now how to assign one of the bitmaps in the array to the background image of my panel?
|
|
|
|
|
Hi,
I am a newbie to C# and Im trying to redirect standard input, output and error of a console program written in C (MS VC 6.0) to a textbox on a form. The code for the redirecting looks like this:
private System.IO.StreamWriter c_StreamInput = null;
private System.IO.StreamReader c_StreamOutput = null;
private Thread c_ThreadRead = null;
private Process c_Process = null;
private void ReadStdOutputThreadProc()
{
try
{
string str = c_StreamOutput.ReadLine();
while(str != null)
{
txtboxCNF.AppendText(str+"\r\n");
Thread.Sleep(100);
str = c_StreamOutput.ReadLine();
}
}
catch(Exception) {}
}
private void btnStart_Click(object sender, System.EventArgs e)
{
if(c_Process == null)
{
c_Process = new Process();
ProcessStartInfo psi = new ProcessStartInfo("console.exe");
psi.UseShellExecute = false;
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
psi.CreateNoWindow = true;
c_Process.StartInfo = psi;
c_Process.Start();
c_StreamInput = c_Process.StandardInput;
c_StreamOutput = c_Process.StandardOutput;
c_StreamInput.AutoFlush = true;
c_ThreadRead = new Thread(new ThreadStart(ReadStdOutputThreadProc));
c_ThreadRead.Start();
}
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if (c_ThreadRead != null)
{
c_ThreadRead.Abort();
c_ThreadRead.Join();
}
if(c_Process != null && !c_Process.HasExited)
c_Process.Kill();
}
The console application that I am trying to run (console.exe) is a simple C program that prints a line text and then calls the getchar() function. The code is basically this:
#include "stdafx.h"
#include <conio.h>
int main(int argc, char* argv[])
{
printf ("Hello World !!\n");
int ch = getchar();
printf("Character = %s\n", ch);
return 0;
}
I have tried to run the C program without the getchar() function and it works. The problem arises when I use the getchar() function. I have tried getch() and gets() version without any success. I am not sure if I have to do anything special for showing output when using such functions.
Any help/pointers in this direction will be greately appreciated.
Thanks in advance.
Dribble
|
|
|
|
|
I think getchar requires EOL char (aka Enter or ^D i think).
|
|
|
|
|
Leppie,
Im not sure if I understood what you meant by getchar() requires EOL. Could you please ellaborate a little more?
Thank you.
Dribble
|
|
|
|
|
Hi guys,
Repeatedly am posting this question..But each time hopeful of getting solution from you.....
I have to export datas to Excel database...If i want to specify the Format of the data(that's:General,Number,Currency.....)..How can i do it?
Also,now am managed to assign a custom format for the cells like,
mExcelRange.EntireColumn.NumberFormat="#,###";(for integers...)...
Am exporting the data and setting the format for them ,each seperately provided that datas are in a datatable...If i set the range,then asssign the (custom)format for each datacolumn..the result is tht the format that has been set for the lastly iterated column is been set to all other columns too..
Please help me in tackling these two problems...
1.Setting Format for cells..
2.Setting Range...
Thanx
|
|
|
|
|
Hmmmmm...... i don't know much about it, but try:
http://msdn.microsoft.com/vstudio/products/compare/default.aspx
There you can find what options you have in differant versions of VB.
|
|
|
|
|
I want Paging for DataGird in WinForms. i use Dataset/DataTa ble fill Data on DataGird
can u move solve this problem to me. The Best if u give Example to me
So I think to syntex Select Top but it unable.
I try to use syntax ds.table["name"].Select , ds.table["name"].Rows['number'] but unSuccessful
it dose'nt get 10 rows in dataset
thanks
Mr AnhTin
|
|
|
|
|
I am having a problem compiling DirectX in my C# apps. I get the following error during compile time.
type or namespace name 'DirectX' does not exist in the class or namespace 'Microsoft' (are you missing an assembly reference?)
I installed the DirectX 9 SDK after installing Visual Studios. Am I missing something. When I enter "using Microsoft." DirectX does not come up on the list.
Thanks,
Leo T. Smith
|
|
|
|
|
Leo Smith wrote: DirectX
Add a reference in your project references to Microsoft.DirextX.dll
|
|
|
|
|
how do i get the row and column count of an excel file using C#?
Thanks very much!
|
|
|
|
|
|
I try to write a class that extends Form like that:
<br />
public partial class BaseForm : Form<br />
{<br />
<br />
public BaseForm()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void BaseForm_Load(object sender, System.EventArgs e)<br />
{<br />
MessageBox.Show("Hello, World!");<br />
}<br />
<br />
}<br />
And then I write a class that extends class BaseForm
<br />
public partial class MyForm : BaseForm<br />
{<br />
<br />
public MyForm()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
}<br />
I rebuild project and open MyForm to design, it suddenly appears "Hello, World!" message box.
I think it is a stupid feature in VS 2005 (I didn't check it in VS 2002, 2003 yet). How can I turn off this feature?
http://t800t8.blogspot.com/2006/02/thc-thi-s-kin-load-khi-ang-design-form.html
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
-- modified at 19:58 Monday 20th February, 2006
|
|
|
|
|
private void BaseForm_Load(object sender, System.EventArgs e){
protected override void OnLoad(System.EventArgs e){
if (!base.<a href = "http://msdn2.microsoft.com/en-us/library/system.componentmodel.component.designmode.aspx" rel="nofollow">DesignMode</a>[<a href = "http://msdn2.microsoft.com/en-us/library/system.componentmodel.component.designmode.aspx" target = "_blank" rel="nofollow">^</a>]){
MessageBox.Show("Hello, World!");
}
}
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
-- modified at 20:20 Monday 20th February, 2006
|
|
|
|
|
This code, it works. Thanks!
private void BaseForm_Load(object sender, System.EventArgs e){<br />
if (!base.DesignMode){<br />
MessageBox.Show("Hello, World!");<br />
}<br />
}
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
|
|
|
|
|
You think this is a stupid feature? How do you think controls work when you drop them on your form? There's nothing that magically renders them at design time without running the code that's in them. You MUST run code in the controls in order to see them on the form!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Render? Did you forget InitializeComponent() method in constructor?
I just have some questions for you.
+ Do you like it shows a message like in my example at design time?
+ Do you like to get an error message and can not design your form when you only want to load the picture at runtime like this button1.Image = Image.FromFile(Constant.IMAGES_DIRECTORY_PATH + "Back.jpg"); ?
These only some simple cases. If you like them, this stupid feature is for you!
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
|
|
|
|
|
This is exactly why the form exposes a DesignTime property as pointed out above
|
|
|
|
|
If you code your components correctly, this isn't a problem!
Yes, I've written many of my own components, and yes, this "stupid feature" as you call it, is what made developing these components remarkably easy.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can you show me the correct way to write a component? I want to see if it is correct or not.
I'm ...
a fan of Manchester United
a fan of Ozzy Osbourne
a King of Nothing
|
|
|
|
|
Funny! What do you think we've been trying to tell you!?
Why is it so hard to accept that when you drop a component on a form, the code in it runs at design time?!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|