|
Hello,
I work on the same think. To make DDE working for C#. It is very difficult.
For getdata I use following declaration
[DllImport("user32.dll")]
public unsafe static extern int DdeGetData(IntPtr hData, sbyte *pDst, int cbMax, int cbOff);
and in the code I do
arry = new Byte[cb];
fixed(Byte result = arry)
{
User.DdeGetData(hData, result, cb, 0);
ppsz = new StringBuilder(new string(result));
}
Did you have some progress or did you gave up.
So far my class is working for some time, but fails later with a illegal memory access error, which is probably caused by the GC in C#.
Hope that helps,
Wolfram
wolfram.rinke@inode.at
|
|
|
|
|
look for http://www.codeplex.com/ndde.
jiugarte brasil
|
|
|
|
|
this one might be alittle easy....im just having a little trouble. I have a form..that has 2 tab pages embeded into (and tbcontrol) on the second tab .. i have a PictureBox (pbox1). Inside that picture box (pbox1)i have put other picture boxes (pbox2) that move to diffrent locations at diffrent times. i need to find a way to get (pbox2) to display its own tool tip. I cant seem to event get a OnMouseMove override to work on (pbox2). Is there something i need to do before hand to get the tooltip class to be noticed by (pbox2). Thanks alot for your time. I can make this work fine on the form its self. But as soon as i add the pictureBox(pbox1) to a tabpage all of the functions (i.e OnMouseOver) dont respond. Is there some kind of command i need to enable on the tabpage / tabcontrol to get it to show my tool tips or respond to mouse over events ? thanks alot
If you have any further questions reguarding this one...please post them here...i will get back to them ASAP.
Jesse M
The Code Project Is Your Friend...
|
|
|
|
|
It might be helpful if you included some code...maybe ftp the code somewhere so that we can all look at it. The form sounds like it's a mess.
[edit]Also, if you have MSN Messenger, e-mail me a response to this message and we can chat about this. Might help you get it done faster.[/edit]
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
i can email it to. you its about 300+ lines... It is part of a project for school. The project is to create a traffic simulation with cars randomly generated...with random types....cars changing lanes , random speed and space buffers. I choose to use picture boxes because instead of using just drawing graphics i could assing the picture box its own tool tip. the text of the tool tip would reflect the speed,lane postion ect of thta car. It works as suspected. but as soon as i draw the "cars" on a tabcontrol/tabpage the tooltip of the "cars" dont work. But if i draw them onto the form itself. it works fine. Anyways give me your email and ill send you that class as well as the main class.
Jesse M
The Code Project Is Your Friend...
Actual on the other hand i set this thing up at yahoo..and i think it will work... http://briefcase.yahoo.com/bc/cuteone_97058/lst?.dir=/[^]
|
|
|
|
|
Is there a way to change the Title Bar font? I don't want to change the fonts from Display Properties cause it changes all the Windows Title Fonts. I am looking for a C# function or maybe a WinAPI to achieve this.
Thanks in advance
|
|
|
|
|
Hi. Is it possible to do something like this? :
res = Response;
res.Write("hello world");
|
|
|
|
|
Well, the Response class is of type HttpWebResponse. So what you would really do is this:
HttpWebResponse res = Response;
res.Write("hello world");
This works because HttpWebResponse is a reference type, so all you are doing is creating a new reference to the same Response type.
Hawaian shirts and shorts work too in Summer.
People assume you're either a complete nut (in which case not a worthy target) or so damn good you don't need to worry about camouflage...
-Anna-Jayne Metcalfe on Paintballing
|
|
|
|
|
Hi all,
i've got an form with a series of comboBoxes placed at intervals vertically. if i scroll down the form to one of the lower comboBoxes and then click on it, it tries to display the drop down list at the original location of the comboBox. Does anyone know if this position can be offset by the scroll position???
any suggestions welcome!!
Thanks
Paul
Paul Griffin
|
|
|
|
|
Hi all,
Are there any possibilities to get frame from wmv or live stream to still image (e.g. jpg)?
Can you suggest me what kind of solution may be here?
Is it directX or something?
Actually, I am making program that wraps WM Encoder 9 as object.
It would be wonderful to have feature to grab frame to jpg file.
I think I am not the only one with this problem, may be somebody
solved it and can give some ideas where to start.
Thank you in advance
Age
|
|
|
|
|
Alright,
Im out of the programming mode and into form design mode, which is so much fun, right. Heres my question, is there an easy way to change the forms border color? Ive looked around and it seems like all I can find are some sketchy answers. Any help would be greatly appreciated.
Thanks,
Ryan
|
|
|
|
|
I am developing a set of desktop apps using C# with wrappers for existing unmanaged c++ code. The unmanaged c++ code creates its own threads. The application runs fine as individual processes but each one takes a large amount of memory (~30M). To reduce the memory usage, I am trying to run all of the apps in a single process with multiple AppDomains.
The problem I have right now is that when I created multiple appDomains using the same unmanged dll. But all the unmanaged threads were created under the first AppDomain I created and not to AppDomain that created them.
Can someone help me out with this problem?
|
|
|
|
|
First of all there is never a one to one correnspondence b/w app domains and threads. Code from two different appdomains can execute in the same thread. When you create a new app domain and call AppDomain.ExecuteAssembly the execution is on the same thread. So in your case after creating the thread create a new app domain on each of the thread and execute the assemblies.
Meg Rules
|
|
|
|
|
Salamo 3alekom,
i'm doing a program like windows explorer.. things are going great except that i faced 2 problems that i couldn't solve.
1- i couldn't get the labels of drives (for ex. drive c:\ label is system) also the lable of "my computer".
2- i couldn't get the icons of the files & folders & drives .
anyhelp?
thanks
plextoR
|
|
|
|
|
Hello
I have a smal problem you, maby you can help me.
I got two forms, form1 is loaded on start, and in form1 there is a new form2 loaded cals form2.
when i then take hide on form1 and show on form2 i dont know what the objekt of form1 is named.
ex:
in Form1 i use
form2.show();
this.hide();
now i dont know the objekt of Form1 an there by i cant use show() on form1.
How do i Show form1 again?
//Jimmy
|
|
|
|
|
What you describe happens because Visual Studio instantiates Form1 in the following way.
<br />
static void Main() <br />
{<br />
Application.Run(new Form1());<br />
}<br />
As you can see, it does not create a variable to hold the object, it just
creates an instance of itself.
But you can declare a public static variable in Form 1 class to hold the reference to your form:
<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
public static Form1 mainForm;<br />
<br />
(...)<br />
Then, before hiding your main Form you would store its reference in the mainForm variable:
<br />
mainForm=this;<br />
Since mainForm is a public static variable of the class Form1, you are now able to access your object in any Form your project has through this variable.
<br />
Form1.mainForm.Show();<br />
|
|
|
|
|
Thanks alot for the help =D
It solved my problem and i understand now why it dident work before=)
Best Regards
Jimmy
|
|
|
|
|
Hello all,
I am new to C# and I need to be able to cast from a byte array to a struct. What is the best approach to map the bytes into my structure?
I have:
struct Record
{
char a;
char b;
char c;
}
I want to be able to do this:
string myString = "123";
byte[] myData = System.Text.Encoding.ASCII.GetBytes(myString);
Record myRecord = (Record)myData;
Thanks in advance
|
|
|
|
|
Look at the Marshal class
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Is it possible to create a new dBASE IV .dbf (one that does not already exist) using C#?
Mark Sanders
sanderssolutions.com
|
|
|
|
|
For those who are interested...
string columnString = "NAME varchar(50), NUMBER int";
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory + ";Extended Properties=dBase IV";
string sqlString = "CREATE TABLE " + tableName + " (" + columnString + ")";
OleDbConnection connection = new OleDbConnection(connectionString);
OleDbCommand command = new OleDbCommand(sqlString, connection);
command.Connection.Open();
command.ExecuteNonQuery();
command.Connection.Close();
Mark Sanders
sanderssolutions.com
|
|
|
|
|
Hi All,
Does anybody know the way, how to change datagrid scrollbars style into flat, similiar to MFC CListCtrl pmyListCtrl->SetExtendedStyle(pmyListCtrl->GetExtendedStyle()|LVS_EX_FLATSB); ?
Best Regards
|
|
|
|
|
in a pictureBox.Image, i put an picture by using memoryStream from a dataset connected to Sql Server.
when i navigate by a scrollBar from one record to another, picture is well displayed in the control
(setting to null value if no image in datarow, or reading memorystream if present)
if i modify picture by paste a new image or by reading a disk picture, saving it to another memorystream (or direct to disk also) by using image.save(stream,ImageFormat.xxx) or Image.Save("filename") is OK
but if i DON'T change picturebox.image and try an Image.Save() i get this :
System.InteropServices.ExternalException
generic error in GDI +
image length is zero kByte on disk (not writing) or corrupted in memoryStream...
I don't understand !!
an Idea ?? thanks
Bruno Ferec (bferec@eni-consulting.fr)
Technical manager
|
|
|
|
|
While working on an Image Processing App I encountered the same kind of
generic error while using the Bitmap.Save() method. I did some searches in the www and it turns out that the Image/Bitmap class uses some type of on-demand loading scheme that requires the file to be open all through the object's life (therefore minimizing the amount of memory being used by big images)
This creates several problems. For instance, when you call the Image.Save("filename") to save the image to same file from where it was loaded, your program crashes because it is trying to overwrite an open file.
One workaround for this would be to save the changes to another file or to use unmanaged code to load all the image to memory.
|
|
|
|
|
There is a much simpler solution.
// Create a memory stream
MemoryStream mStream = new MemoryStream();
// Save the image to the memory stream
Image.Save(mStream, ...);
// Then write the buffer to a file.
fileStream.Write(mStream.GetBytes(), 0, mStream.Length);
I'm doing this off the top of my head, so the syntax may be slightly off, but the concept is solid. I use it all the time.
Thanks,
Steven
|
|
|
|