|
why are you using win32 for a dialog box anyway?
show us WndProc and the one that create the dialog!
|
|
|
|
|
Sorry I forgot an essential point.
All the function (from App to the Dll ) was at other Thread ("Dll thread").
Not in the main (GUI) thread, but in the same one (using queue)
The init(…) and other function first enter to Q and the pulled by the "Dll Thread")
koby
|
|
|
|
|
hello,
i've got a small problem right now. i started developing a small toolbar for my personal use which is docked at the top of the desktop. now i want to change the workingarea of the desktop, so other window forms cannot overlap my toolbar.
i would be thankful for every solution.
thx a lot
|
|
|
|
|
|
If you're not using a desk band (an "explorer band" is also a desk band, BTW) and instead simulating your bar being docked in the desktop, then you're close to using an app bar, which the task bar is, as well as the old Office shortcut bar. See the article, C# does Shell, Part 3[^], which discusses app bars using C#.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi!
Is it possible to format a string so that a certain part will be displayed as subscript text?
For example a label displays the string "n1 + n2 =" and "1" and "2" should be subscript.
I searched through the documentation but must have missed it, at least i hope so
THX in advance
|
|
|
|
|
There are several ways. One is through markup like with HTML that uses the <sup> and <sub> tags. I doubt that's appropriate here, however.
Another is to get a font that is full of these. It's not uncommon to have a font represent symbols. Microsoft uses several fonts for glyphs in Outlook and other applications.
Since .NET supports Unicode, there is the superscript and subscript diacritics in the U+2070 through U+209F range. The problem is that you need a font that supports them. Tahoma (default font) and Arial Unicode MS currently do not, nor do any of the other common ones. If you had a font that supported this Unicode range and displayed the text in a TextBox (for example), then you could use:
"n\u2081 + n\u2082 =" Finally, about your only other option is to owner-draw the text yourself in parts using Graphics.DrawString and either off-setting the coordinates of the upper-left corner or using a StringFormat with a LineAlignment set accordingly.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi
I wrote a client/server windows application`s
and sending data by convert it into byte`s
NOW
**********
I need to send xml bitween them
if any one has a code to do that please send it to my
thank you for all
|
|
|
|
|
Just use the Encoding class to get the bytes for XML using whatever encoding you want, send the bytes, then use the same Encoding class on the server to get the XML from the bytes. I'd recommend a UnicodeEncoding to allow for the full range of characters.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thank you Heath Stewart
but i know this way and i need to send as xml not by encoding
thank you again
|
|
|
|
|
Everything - even text files like XML - is still just an array of bytes. You must Encode before transmitting it across the wire. Even every web page, Web Service, etc. do that. What do you think the second clause of the Content-Type header (if there) or the Content-Encoding header is? That just the way it works.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Is it possible to show a window form as the child of another window form in an SDI application? It was possible in VC++ 6.0 to show a dialog box as the child of another dialog box such as in property sheets. What I wanna know is that is this possible in C# also?
Its very urgent, any help will be greatly appreciated.
Thx in advance
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
FormName.ShowDialog(this);
I'm not sure if this is what you are trying to achieve. If you want the child window to be contained within the frame of the parent window, I'd suggest either using mdi or putting your child window on a user control and adding it to your parent window's controls.
|
|
|
|
|
|
You can catch the moving of your form and if it goes out ow mainf orm adjuste it.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
The easiest way to do this, in my opinion, is to create a user control. This is basically a form without a border, at least from my understanding. Make your control the size of the client area of your parent window, and then add it to the controls of your parent window.
//This is in your variable declarations
private NameSpace.UserControl ChildControl;
//This is in your method that shows the control
ChildControl = new NameSpace.UserControl();
Controls.Add( ChildControl );
ChildControl.BringToFront();
ChildControl.Show();
Just make sure you have some way of closing your user control, because your frame is still the frame of your parent window, and will close the entire program. Put a button on your user control that will close it or something.
My advice on these is to not get carried away. Remember, you are only covering up the window with your user control, you aren't replacing it. I think this will work how you want it to work. Good luck!
|
|
|
|
|
|
I need help converting this code to C#, its taken from an Media Center SDK Doc.
HRESULT CreateSession([out,retval] IMediaStatusSession** MediaStatusSession);
Another question, since typedef doesnt exist in C# i converted the following code:
typedef SAFEARRAY(MEDIASTATUSPROPERTYTAG) MEDIASTATUSTAGARRAY;
typedef SAFEARRAY(VARIANT) MEDIASTATUSPROPARRAY;
HRESULT MediaStatusChange(
[in] MEDIASTATUSTAGARRAY Tags,
[in] MEDIASTATUSPROPARRAY Properties
);
to just:
void MediaStatusChange( [In, MarshalAs(UnmanagedType.SafeArray)] MEDIASTATUSPROPERTYTAG [] tags,
[In, MarshalAs(UnmanagedType.SafeArray)] MEDIASTATUSPROPERTY [] prop);
is this ok, or is there a way of converting the typedef?
modified 16-May-21 21:01pm.
|
|
|
|
|
this is for CreateSession, from the SDK doc.
IMediaStatusSink::CreateSession
Creates a media status session.
Parameters
MediaStatusSession
[out] Address of a variable that receives the IMediaStatusSession interface pointer.
Return Values
Return values are implemented by the component. The method should return S_OK.
Remarks
When the MSAS calls this method, your component must create an object that implements the IMediaStatusSession interface and place the interface pointer in the address specified by MediaStatusSession.
modified 16-May-21 21:01pm.
|
|
|
|
|
I should've read this message first.
Since CreateSession is a COM object method, you should just instead create a COM interop assembly, a.k.a. a RCW (Runtime Callable Wrapper). In VS.NET, just right-click on your project and select Add Reference. Click the COM tab and find the typelib. Double-click it to add it to the list and click OK. An interop assembly is created with all the interfaces, enums, parameters, etc. defined. All you have to do is use them and make sure that the interop assembly (it will get copied to your build directory) gets deployed as well with your library or application).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If this is a method on a COM object, then you should create an interop assembly using tlbimp.exe, or add a COM reference to your project in VS.NET which does the same thing.
If this is a function exported by a DLL, you can use the following signature:
[DllImport("whatever.dll", PreserveSig=true)]
private static extern int CreateSession(ref IMediaStatusSession MediaStatusSession); IMediaStatusSession would be an interface that you would have declare that matches the native interface using the same order of methods (if inheritted from IUnknown or dual), dispatch IDs (if inheritted from IDispatch or dual), and signatures; or that is declared in an interop assembly created from the typelib.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have an array list with elements.
I am unable to access them through indexing.
Here ia my code:
int index = itemList.Count; Where "itemList" is my "ArrayList".
for (int i=0; i < index; i++)
{
string local = (string)itemList[i];
Console.WriteLine("Printing Array: {0} and I:{1}",(string)itemList[i], i);
}
My "local" string first gets assigned zero th element of "ArrayList", but when i=1,2,3,4 etc. my "local" string still has zero th element only.
I cannot use indexing this way. I have to use "MoveNext()" of Enumerator class to access?
Thanks & Regards,
Raj
|
|
|
|
|
Your code is not very readable - the < symbols have been interpreted as the start of HTML tags.
Please replace the < symbols with < so that when it is posted it will display correctly.
Thanks.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|
|
Hi Sorry for messing up in Copy/paste.
Here is the code again.
int index = itemList.Count; Where "itemList" is my "ArrayList".
for (int i=0; i < index; i++)
{
string local = (string)itemList[i];
Console.WriteLine("Printing Array: {0} and I:{1}",(string)itemList[i], i);
}
Again my problem is
If there are 10 elements I am getting first element printed 10 times.
But If I use
System.Collections.IEnumerator myEnumerator = myCollection.GetEnumerator();
while ( myEnumerator.MoveNext() )
Console.Write( "\n{0}", myEnumerator.Current );
I am getting the correct output.
Thanks & Regards,
Raj
|
|
|
|
|
Out of curiousity. If all your elements are strings, why not use the System.Collections.Specialized.StringCollection class instead?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
Coming soon: The Second EuroCPian Event
|
|
|
|