|
Got a project on hand, but they need to implement to the Win32 DLL in order
for the call from the framework. Is it possible or means that I have to
switch to VC++. Nightmire if have to do that.
|
|
|
|
|
No, C# project cannot be compiled to a Win32 DLL. You may build a .NET component, then wrap that within a COM Callable Wrapper, but that would still require .NET run-time to run.
|
|
|
|
|
|
i used WMI to get disk c and set disk["VolumeName"] but it's not working???
help me
|
|
|
|
|
Help Me!!!!
SOS
|
|
|
|
|
I found a solution
see http://www.dotnet247.com/247reference/msgs/24/122501.aspx
string VolumeName= disk.Properties["Volumename"].Value.ToString();
disk.Properties["Volumename"].Value = "Happy_4th";
PutOptions poptions = new PutOptions();
poptions.Type = PutType.UpdateOnly;
poptions.UseAmendedQualifiers = true;
disk.Put(poptions);
|
|
|
|
|
AFTER my application comes up, if there is no file stored in the registry, it needs to popup a dialog asking if the user wants to search for a file to open, create one or exit.
I can't figure out where to put this dialog. I tried in OnActivated, but I can't close the application from there (unless I'm doing it wrong, which wouldn't surprise me.)
NOTE: THE APPLICATION MAIN FORM MUST ALREADY BE DISPLAYED!
Any help would be greatly appreciated.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
if (OpenFileDialog.Show() == DialogResult.Yes)
Applcation.Run( new MainForm(OpenFileDialog.Filename));
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
You misunderstood, the main form of the application MUST already be displayed.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
You can put the dialog into OnLoad and call Show(). The form is already loaded in OnLoad.
private void Form1_Load(...){<br />
this.Show();<br />
<br />
MyDialog dlg = new MyDialog();<br />
dlg.ShowDialog();<br />
}
|
|
|
|
|
That mostly works, thanks.
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
I have a listview that i added with VS.NET, but eventually I want to modify one of the images in the listview when an event handled like this happens
rasClient1.DialStatus += new RasClient.DialStatusEventHandler(DialStatusChg);
the problem is that when im in DialStatusChg and I try to modify the listview like the code below the application stops responding, any idea how can i modify the listview from there, what I'm trying to do is something like a semaphore, so when that event happens, the method below updates the images in the listview
private void DialStatusChg(object sender, DialStatusEventArgs e)
{
try {
switch (e.ConnectionState.ToString())
{
case "AuthNotify":
((ListViewItem)lvLights.Items[2]).ImageIndex = 1;
break;
}
catch (Exception exc)
{
Console.WriteLine(exc.Message);
}
}
Thnx in Advance
Isaac
|
|
|
|
|
Threads, thread, threads...
You will have to use Control.Invoke(object obj, object[] param).
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I want to open an Excel file in my C# application and read the contents . I tried the msdn samples. But most of them deal with writing back values into Excel file.
Also since the range of values that I have to read from the Excel file is dynamic, I would like to know how this can be done.
The foll. is the code that I have written and I get error while instatiating an Excel aplication obejct as it is not able to understand my typecasting.
Excel.Application objApp=null ;
Excel.Workbooks objBooks=null;
Excel.Workbook objBook= null;
Excel.Range range;
string str="";
try
{
// Instantiate Excel and start a new workbook.
objApp = (Excel.Application)new Excel._ExcelApplicationClass();
objBooks = (Workbooks)objApp.Workbooks(1);
objBook = (Workbook)objBooks.Open(DataFile,null,null,null,null,null,null,null,null,null,null,null);
Excel.Worksheet ws= (Worksheet)objBook.Worksheets(1);
if (ws == null)
Console.WriteLine ("ERROR: worksheet == null");
Excel.Range rng=(Excel.Range)ws.Cells(1,1);
str=rng.Value.ToString();
|
|
|
|
|
Hello ....
I have a form of a TextBox control that has a bunch of limitations on it that I need for an app I'm developing.. works well as its own control on a form, etc..
I'd like to use that control as a column in a DataGrid, but I'm not sure how to 'adapt' the custom control to work in the DataGrid (I'm getting a "Cannot implicitly convert type 'CapsText.CapsTestControl' to 'System.Windows.Forms.DataGridColumnStyle'" message).
Any suggestions on what I need to do to fix this?
Thanks!
|
|
|
|
|
The help says the Item function will give me whatever item in the list I want but the complier says there is no definition for this function. What's up with that?
|
|
|
|
|
You mean an element in the arraylist, don't you ?
Can you submit some sample ?
Free your mind...
|
|
|
|
|
You use the indexer "[]"
eg
ArrayList a;
...
object o =a[2];
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Hi!
I want to create a application which have a tab control in where it should host a axwebbrowser for each tab.
So far no problem, but everytime i add a new instance of the axwebbrowser it creates about 10mb more memory usage.
And thats not nice ... i know that you can copy instance with
axwebbrowser2 = axwebbrowser1
but then you have to set the location configs again to them and i mean it's not the nicest and cleaniest way
to do this! And the axwebbrowser1 is gone, so if i go back to the first tab i have to copy it back
axwebbrowser1 = axwebbrowser2
and add the location config again to the first webbrowser.
I searched for this on Google and here at CP but i can't find any solution. Maybe someone can help me out of this
Thanks
Matthias
|
|
|
|
|
Hello,
I have a number of Asserts in my code, ASP.NET application, and all they ever seem to do it show up in the output window.
I'd like when the Assertion fails that the code stops (like in the MFC applications I used to write) Well, I do have a bit of a work around, but it is kludgy and make my code look really inelegant.
From
Debug.Assert(AssertionCondition==false, "Something went wrong");
I now have to write:
#if DEBUG
if (AssertionCondition == false)
{
Debug.Assert(false, "Something went wrong");
}
And stick a breakpoint on the Assert Line.
Is there a simpler way to achieve the same?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
if (AssertionCondition == false)
{
Debugger.Break();
}
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Thanks.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
Hi, I have an interesting problem. I create an input form a while back, and continued development in other areas. Now all are finished, and I went back to test the input, and it does not work. It gives me some error about " not being in the column. You see, I did not touch that section, so am very surprised it reports that, as it did work. However, when I run it by pressing F5 (with debugging), there is no error. I have switched between the two modes a few times, and cannot work out why it runs with debugging, but not without.
Anyway, the final problem, is when I run the executable, it comes up with an error, system.IO.FileLoadException.
Has this happened to you before? I would supply some code, but as I dont know which part it is that causes this, I have not.
|
|
|
|
|
Could you be doing something in code that is conditionaly on the configuration. (i.e. Debug Vs. Release)
Check your code for #if DEBUG blocks that may be doing extra work in debug mode that isn't being done in release. Or Debug.Assert calls because they only get evaluated in Debug builds.
As an example of what I mean. Run the following program in Debug and release mode and note the difference.
using System;
using System.Diagnostics;
namespace WeeTester
{
class Class1
{
private static int _i = 0;
[STAThread]
static void Main(string[] args)
{
Console.WriteLine("_i={0}", Add());
Debug.Assert(Add()==1, "_i != 1");
Console.WriteLine("_i={0}", Add());
Console.ReadLine();
}
private static int Add()
{
return _i++;
}
}
}
You will see that in Debug mode the output is:
_i=0
_i=2
and in Release the result is:
_i=0
_i=1
because the call to Add() in the Debug.Assert is not made anymore.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I am working on a application that uses Direct3D. The problem is that I want to use a vertexshader, but I don't know how !!
Can someone tell me how?
Greetings....
|
|
|
|