|
Do you mean that i can't call DLL or OCX from MDI form
|
|
|
|
|
No, you can!! Just like any other form can.
Just the documention you want doesn't exist, because there are no functional differences.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for your help
if you have any papers or link talk about how to use DLL and OCX in C#.Net please tell me
thanks again
|
|
|
|
|
There are examples all over the place.
For OCX, or ActiveX, controls, add it to the Toolbox or add a Reference to it.
For using .DLL's, checkout DllImport, or look on http://www.pinvoke.net[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi to all,
how can i assign a BackGroundImage to a RichTextBox
best regards and thanks in advance
fady
|
|
|
|
|
You can't using the normal RichTextBox.
The underlying control that the RTB class wraps doesn't support it. You can try creating your own, inheriting from the RTB, and owner-drawing the control with the background, but I've been hearing that even that doesn't work as expected.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to check out if the point is in region or not, does C# have the same function as C++ PtInRgn??? And another conditions - point on line, point on point...
|
|
|
|
|
For a point in a Region: Region.IsVisible
For a point in a GraphicsPath: GraphicsPath.IsVisible or GraphicsPath.IsOutlineVisible
For a point in a Rectangle: Rectangle.Contains
For a point on a Point: Point.Equals
For a point on a line: dunno, maybe add a line to graphicspath and then GraphicsPath.IsOutlineVisible ?
Hope this helps!
|
|
|
|
|
Hi,
What I would like to do is have an MDI form 'look' to see what components are available and set-up a menu accordingly. I guess I would like it to be like a framework so I can use it for anything and just make available the components I want the users to use.
How can I do this?
I am not sure how to load the component and then show it in the MDI?
Any links to articles that cover this or any help would be appreciated.
Thanks
|
|
|
|
|
Hello,
I have a strange problem. I have to write a regular expression which should match a line which is a comment (//) in a source file. I'm using Expresso to test my expressions. It is not complex, //.+?\n . When I copy from the file and test it with expresso it works. But when I read the file in a string in my program there are no matches found. I copy the content of the string in Expresso and it also finds nothing. Can you help please?
Thanks
|
|
|
|
|
What's the string ? Have you tried copying a string from Expresso into your file ? ( I've had a sitation with some characters where unicode has a couple that look the same, and I get the wrong one ).
Also, make sure your regex settings are the same as the ones being used in Expresso.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The string is the files content. When I copy it from the file and paste it in Expresso it is formatted, but when I paste it from the program's string it is not but the text contains \r\n . I try the following //.+?\r\n , but it doesn't work, expresso selects the whole string and not the different comment lines.
|
|
|
|
|
"// EditReportsDlg.cpp : implementation file\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"resource.h\"\r\n#include \"SPSystem.h\"\r\n#include \"EditReportsDlg.h\"\r\n\r\n#ifdef _DEBUG\r\n#define new DEBUG_NEW\r\n#undef
This is a part of the string. The expression \r\n doesn't return matches. Could you explain why?
Thanks
|
|
|
|
|
Ooops,
very dumb on my part. I should use \\r\\n.
|
|
|
|
|
I'm copying the input I give to regex.Matches and regex.Pattern in Expresso and get match results, but not in my program, the matchcollection object's count property remains 0. Any suggestions?
|
|
|
|
|
Perhaps post the string and the code, so I can have a look at it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi All,
Whats the best way to draw graphics to the console. I am looking at drawing a complete interface and having controls. Something similar to the Norton Ghost Command prompt interface.
I understand that this is a big project and it is most likely beyond my capabilities as a programmer, but if anyone can point me in the right direction to get started I would be most thankfull.
Timbobsteve
|
|
|
|
|
Can I ask why you would want to build such an archaic interface in the age of Windows and Unix/Linux GUI's?
I mean, they do all of the work for you. Unless someone still has a library for this laying around, you're going to build this from scratch. It will probably take more time to build the interface than it will to build the app that's going to use it. Is a DOS interface really a requirement?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
No Not really..... but damnit it would be fun to do!
|
|
|
|
|
Hi,
I am new to COM and .NET development. One of our client gave as Interface definitions as MIDL file and We are trying to develop the COM server using .NET framework using C#. I am wondering what is the right approach. Any help would be greatly appreciated.
Thanks,
Akth
|
|
|
|
|
Although you can create COM components in C#, I am pretty sure they do not use MIDL. However, the MIDL file gives you the interface you need to provide, so just use it for that. assuming they know you're doing it in C#, and not expecting it to be C++.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian,
Thanks for your response,
Exactly the same way I am trying to do, Creating C# interface from the MIDL file but some of the data type like DWORD, BYTE, I could not find a way to define in C# using MarshalAs attribute. and also enumerations created from C# prefix the each enumeration value with name
e.g
enum A{
A1,
A2
}
is converted as
enum {
A_A1,
A_A2
} A;
but I need to expose the C# interfaces, methods, enumerations exactly defined in MILD file, because other people also developing server using the same MIDL.
Please let me know, how I can resolve this problem.
Thanks,
Kuthbul
|
|
|
|
|
DWORD == unsigned int
BYTE == unsigned char.
any type that is all captials is a #define in Microsoft C++. The easiest thing is, open a C++ project, type in the type and hover the mouse over it to find out what it is.
Akth wrote:
enum A{
A1,
A2
}
is converted as
enum {
A_A1,
A_A2
} A;
I'm not sure what you can do here, because enums in C# are always a class, and I've never done this conversion, so I don't know if you can hack it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey guys,
got a friend who is still stuck on vb6(says he loves it ) anyhow he passed me some code that i need to convert, i got it to .net with the VS.net03 tool. But now i need it to C#, i'm not a vb programmer so i'm struggling to understand why it isn't working right. i've tried using a few different code converters but they all fail!
I've enclosed the code... any help is auesome.... oh, and anything quick is even better. My deadline got bumped from next week to tomorrow am. (which is why i had my friend "help" me.)
k,
one more thing.. it WILL run in vb.net once i upgraded it from vb6, but i can not get it to compile in C#!
'UPGRADE_NOTE: Text was upgraded to Text_Renamed. Click for more: 'ms-help:
Private Function Crypt(ByVal Text_Renamed As String, ByVal Key As String) As String
Dim KeyLen, i, KeyPtr As Integer
Dim KeyChr, TextChr As Short
KeyLen = Len(Key)
For i = 1 To Len(Text_Renamed)
TextChr = Asc(Mid(Text_Renamed, i, 1))
KeyChr = Asc(Mid(Key, KeyPtr + 1, 1))
Mid(Text_Renamed, i, 1) = Chr(TextChr Xor KeyChr)
KeyPtr = ((KeyPtr + 1) Mod KeyLen)
Next i
Crypt = Text_Renamed
End Function
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
txtText.Text = CStr(Now)
txtPath.Text = VB6.GetPath & "\DateTest.bin"
End Sub
just in case it helps here is the vb6 code...
Private Function Crypt(ByVal Text As String, ByVal Key As String) As String
Dim i As Long, KeyLen As Long, KeyPtr As Long, KeyChr As Integer, TextChr As Integer
KeyLen = Len(Key)
For i = 1 To Len(Text)
TextChr = Asc(Mid(Text, i, 1))
KeyChr = Asc(Mid(Key, KeyPtr + 1, 1))
Mid(Text, i, 1) = Chr(TextChr Xor KeyChr)
KeyPtr = ((KeyPtr + 1) Mod KeyLen)
Next i
Crypt = Text
End Function
Private Sub Form_Load()
txtText.Text = Now
txtPath.Text = App.Path & "\DateTest.bin"
End Sub
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
wetrivrrat wrote:
says he loves it
Kudos to you for sticking with your friend through this difficult time....
Your code converters suck, they are still calling old VB6 functions.
The core issue here is that you should not be writing your own cryptography functions, you should use the ones that .NET provides. However, what would help here is for you to show us the C# code you're ending up with and telling us what is going wrong.
Christian Graus - Microsoft MVP - C++
|
|
|
|