|
|
Hy,
I need a little more help . I have a DLL created in C++ which has some methods that interest me. Now I want to use this DLL in C# so I created another DLL in C# which uses the one made in C++. Only I have a few problem. Most of the methods from the C++ DLL need pointers as parameters. For example one method in C++ needs a BYTE* as parameter. I tried from C# to send a BYTE[] but it doen't help me. I also tried with REF but it still doesn't work. If I return a BYTE* from C++ and read it into a BYTE[] an error occurs "Can Not marshal return value".
A little help will be welcomed. Thanks
|
|
|
|
|
could you paste the C++ definition and your c# definition please.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
How can i work with a Timer Control in ASP.NET?
....
....
Thanks
|
|
|
|
|
From what i know only ATLAS gives the ability to work with Timers. Also there always is JavaScript but that is on the client side.
Hope it helps (http://atlas.asp.net - for more details)
|
|
|
|
|
You could use the following:
Use System.Timers.Timer class for your timer and add a static instance of the class to your webform. (Static because you want it to run on the server on not getting initilized when a user requests something on the client). To help you a bit on that here's my code which worked for me:
<br />
public class TimerClass<br />
{<br />
System.Timers.Timer timer = new System.Timers.Timer();<br />
public TimerClass(double interval, bool enabled, params System.Timers.ElapsedEventHandler[] fto)<br />
{<br />
timer.Interval = interval;<br />
timer.Enabled = enabled;<br />
for (int i = 0; i < fto.Length; i++)<br />
{<br />
timer.Elapsed += fto[i];<br />
}<br />
timer.Start();<br />
}<br />
}<br />
<br />
public class WebForm1 : System.Web.UI.Page<br />
{<br />
protected static TimerClass MyTimer = new TimerClass(1000, true, new System.Timers.ElapsedEventHandler(MyTimer_Elapsed));
}<br />
Hope this helps.
Greetings
|
|
|
|
|
:hi all, to attach a file i use the html file field in my web application but it only accept upto 10mb file but i need to allow the user to attach more than 10mb file in my web application..is there any way to do this ...hlp plz....
thanks in advance
Regard,
ayyp
|
|
|
|
|
:hi all, to attach a file i use the html file field in my web application but it only accept upto 10mb file but i need to allow the user to attach more than 10mb file in my web application..is there any way to do this ...hlp plz....
thanks in advance
Regard,
ayyp
|
|
|
|
|
hi,
iam currently working on a winform application using Visual C#,i would like my application to be able to switch between two open forms and work on one without minimizing the other.
eg explore My Computer, while the window is still open explore Desktop (another window opens )
note you can switch between the two windows without minimizing one
is u can refer me to any articles or code examples that work that way please refer me
i hope you understand my question
thanks
regards paula
|
|
|
|
|
I may be missing something but...
Add a second form to your application, assume it is Form2. In some event on Form1 (button click whatever), put the following code
Form2 frm2 = new Form2();
frm2.Show();
Both forms should be open and available. All you have to do is make sure that neither of them is maximized. You can even limit the size with the MaximumSize property so neither of them takes the whole area.
HTH
Gandalf
|
|
|
|
|
thanks for replying
actualy that is not what im looking for
lets say i have two forms ,form2 and form2
and a in my form2 i have button and in the button click event i have the code
Form2 f = new Form2();
f.Show();
my form2 shows
i want to switch between these two forms
currently i can only work with form2 bcause its active i want both of them to be active
so if i want to change something in form1 i should be able to.
regards paula
|
|
|
|
|
If you have created 2 forms in the same project all tou have to do is to open them with the Show method.
Form1 f = new Form1();
f.Show();
Make sure that both of the forms are visible in the System Taskbar(ShowInTaskbar Property).
If you want ony one form at a time use the ShowDialog() method
|
|
|
|
|
thanks for replying
actualy that is not what im looking for
lets say i have two forms ,form2 and form2
and a in my form2 i have button and in the button click event i have the code
Form2 f = new Form2();
f.Show();
my form2 shows
i want to switch between these two forms
currently i can only work with form2 bcause its active i want both of them to be active
so if i want to change something in form1 i should be able to.
thanks
regards paula
|
|
|
|
|
First, I'm trying to clarify your requirements. Correct me if that is not what you want. You want your application to have some virtual desktop feature so that when you switch to next window, you don't see any other windows, but you cannot minimize, hide or disable those unseen windows.
My solution is using virtual screen. Lets say your monitor has a resolution of 1280x1024. Your virtual screen will be 2560x1024.
-----------------------------------
| | |
| | |
| Monitor | Unused |
| | |
| | |
| | |
-----------------------------------
First, position all your windows in the UNUSED area. You can do so by changing the size/location property. Then, whatever window you want to switch to, just reposition that window to the MONITOR area. The key point is that whenever you open a window or draw anything in the UNUSED area, you will not see it, but your rendering logic remains functioning.
You may implement this directly to the screen, or in the memory (double buffering).
Hope this helps.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Hi All
i had made a borderless and shaped window using this code
public Form1()
{
this.FormBorderStyle=FormBorderStyle.None;
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.SmoothingMode=SmoothingMode.AntiAlias;
GraphicsPath GP=new GraphicsPath();
//Codeing to get any shape
this.Region=new Region(GP);
}
it works but i got a problem there is some pixilation on the borders which looks very bad
is there any way to make AntiAliasing between the Form and the screen?
thx all
|
|
|
|
|
yes,
there are two kinds of "layered windows"
one of them is the one that .net uses to mask out a certain color to make it transparent
the other one can make the form antialiased , however that mode messes up the control rendering , so you have to paint every control yourself and if i recall correctly , even handle the mouse events.
so google for layered windows.
//Roger
http://www.puzzleframework.com
|
|
|
|
|
I got answer of my problem in this link http://blogs.msdn.com/mswanson/archive/2005/07/07/436618.aspx
but it gives me another problem that I cant but controls in this form , if any one can help in this problem ,he is welcome
|
|
|
|
|
How can i implement security in my web services other than using encryption decryption explicitly. Please keep in mind that this service is to be accessed from a mobile device.
Any method(the most easiest one) will be accepted...
Regards,
Wasif Ehsan.
|
|
|
|
|
|
hello,
i have a datagrid which i need to create dinamically in my code, whose data will be bound, and i also need the columns that conain the information to be tamplate columns (in order to put drop down lists in the footer). i was able to create the template columns but the data from the database does not populate them - anybody know how to do this?
thanks
mor
|
|
|
|
|
look into dataadapters in particular the fill method.
|
|
|
|
|
hi all,
i have a datagridview with 2 columns. one is StuID and the other is TermGrade. both are number fields.
example:
StuID TermGrade
----- ---------
2000 90
2001 80
2002 70
AVG: 80
i want to add a new row. which should contain the last row above. (AVG: under StuID field and 80 under TermGrade field)
for TermGrade field everything is fine. cos it is a NUMBER field and i add a number in that cell.
but for StuID field, i get type mismatch error since i try to add a STRING into NUMBER field.
how can i get rid of this error ?
is there a way to insert such a string (AVG to a number field ?
help please,
thanks in advance.
bye.
ps: how can i use footer in datagridview in windows forms with C# ? is possible to do what i want above with footer ?
|
|
|
|
|
Seems to me the easiest solution is to make the first column a STRING. All you are doing is using it for displaying data anyway. Verify that it is a valid value, convert it to a string for display in the datagrid. If you need to pull it out, all you have to do is cast it back to whatever numeric datatype you are using.
HTH
Gandalf
|
|
|
|
|
hi all,
i have a datagrid view with a few columns (data in datagrid read from access).
and i added a new row at the bottom to store some result operations like sum of some columns.
if one clicks on a column header to change sort order i want to remove the last row (which i added manually) and do sorting. when sorting completed then i want to add the same column again.
i mean i dont want that lastly added row to be sorted with other rows.
in which event i should write such kind of codes ?
help please,
thanks in advance.
bye.
|
|
|
|
|
If I understood it correctly, you need the last row only for display purposes.
If this is the case, then why to add it to the datagrid at all?
Store it separetely, and add manually when you need.
This way you can use standard sort event.
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|