|
The easiest thing to do would be to wrap your C# dll with COM (C# classes can be exposed as COM objects), then you can use COM to call into your C# dll...
In MC++ you might be able to #using your dll like you would the system dlls.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
The easiest way is to write an unmanaged C++ library that exports the functions you want. It then contains managed C++ that calls your C# classes directly. This gives you the best of both worlds, but requires two files. One for C++ and one cor C#.
|
|
|
|
|
ohhh! I forgot about that
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hello everybody,
Does anyone know how to trap the arrow keys in a class derived from usercontrol?
I noticed that the arrows keys don't fire a keyup, keydown or keypress event,
instead they move the focus to other controls on the form like the Tab key does.
I want the control itself to be able to process the arrows keys without having to add code to the form that is it in.
Thanks in advance
Paul
|
|
|
|
|
Look at the IsInputKey protected method on the usercontrol.
protected override bool IsInputKey(Keys keyData)
{
this control,
if (keyData == Keys.Left ||
keyData == Keys.Right ||
keyData == Keys.Up ||
keyData == Keys.Down)
return true;
else
return base.IsInputKey(keyData);
} Then I think the OnKey* events will fire for it, the docs aren't too clear on that aspect.
Your control will have to have the UIPermission.AllWindows security permission to run that code however.
HTH,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Hi everyone,
I have a web forms page, which contains a dropdownlist. The dropdownlist posts back to an event handler which adds a new button to the controls collection of a PlaceHolder. The text property of this button is set to the text of the DropDownList's selected item. My problem is that after the first time I select my dropdownlist, it changes the text of the existing button in the PlaceHolder, as apposed to adding a new Button to the placeholder.
How can I do that?
I very much appreciate any help I can get this on this.
Thanks.
|
|
|
|
|
Try searching the DOTNET mailing list archives; here is one post that might help a little bit, though I could have sworn I've seen more similar to what you're trying to find.
Sorry I can't be of more help,
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
I need implement a singleton in C#. I have tried making a static class but I seem to be getting members that go out of scope. What is the best was to do this? Thanks.
Steve
|
|
|
|
|
|
Here is a really good article on the Singleton Design Pattern.
Is show it in C++ and then the code convert as is to C# and then a better way of doing it in C# that takes advantage of the language. The C# way is easier. Take a look at the URL
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/singletondespatt.asp
Odis Wooten
odis@msn.com
|
|
|
|
|
Can anyone tell me how i get the controls on my C# form to display in an XP style, when the form is running on XP?
Any ideas welcome!
kenbloke
|
|
|
|
|
When you run your application on XP it display in XP style,even it is C#,VC or VB programs.Maybe you change your Appearence to classic style in control panel
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
To clarify. XP style in terms of displaying the controls in the updated XP style as defined by XP's Common Control library and XP's current theme setting.
I'm new to C# and does not appear to be obvious how to achieve this. Or have i missed something?
Kenbloke
|
|
|
|
|
I don't get what you really want(sorry for my poor english ),but according to my knowledge it is something refer to your windows not your programming language
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
In order to enable the XP Style controls you need to include a manifest either as a resource or as a separate file.
The manifest is nothing more than an xml document
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
processorArchitecture="x86"
version="5.1.0.0"
type="win32"
name="myapp.exe"/>
<description>your application description</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
(manifest taken from Colin's VMTU since I can't find mine here)
If the manifest is included as a separate file (the easiest way to do it), it should be named myapp.exe.manifest
I can't remember the steps off hand for putting the manifest in the resource, i think resgenx was the command that was used to generate the resource, then you include the resource with the compiler.
HTH,
James
Sonork ID: 100.11138 - Hasaki
<small>"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002</small>
|
|
|
|
|
And as Mazdak said, set the Appearance property to standard
James
Sonork ID: 100.11138 - Hasaki
"Not be to confused with 'The VD Project'. Which would be a very bad pr0n flick. " - Michael P Butler Jan. 18, 2002
|
|
|
|
|
Thanks for that info James and Mazdak!!! pointed me in the right direction.
Anyway for anyone who is still having problems displaying XP style controls. i found the following site on msdn useful.
http://msdn.microsoft.com/library/?url=/library/en-us/dv_vbvcstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp?frame=true
Kenbloke
|
|
|
|
|
hi,
I'm new to C#,I have this problem and would apriciate if someone would give me an idea .
I have a object initilazed in a Windows form and i wold like to use the same oject in some components and the way I was thinking was to get the address of this object. But since it's a managed object the compiler doesn't alow me to take it's address.
Please give me any ideas to overcome this,
thanks a lot for your time
Endri
|
|
|
|
|
Like this:
SomeObject obj = new SomeObject();
Component1.Prop1 = obj;
Component2.Prop2 = obj;
All objects are refered to through "object references". You can freely pass this object reference to any part of your system.
--
Peter Stephens
|
|
|
|
|
Ok, quick question here -- I have VS.NET Beta 2 .. I've decided to start to get into C# and don't know much about it yet. Should I be using VS.NET Beta 2 or should I uninstall Beta 2 and install the latest release of the .NET Framwork SDK with the V1 of C# (since the C# language namespaces and the like have been re-arranged, I'm thinking that I should avoid learning the already outdated version).
On another note -- does anybody have the V1 C# compiling in their Visual Studio 6 IDE? If so are there some step-by-step instructions for implementing this?
Thanks in advance to all who reply,
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
I've started c# recently,and I use latest version of it,but the book I use for it is for Beta2 time.Up to now there were no problem and there is no difference.
I know that lots of namespace and ... changed from Beta1,not from Beta2
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
Ok, thanks .. I wasn't sure how much change there was between the Beta2 and V1 conversion, but apparently not as much as I thought.
Travis D. Mathison ---
--- After three days without programming, life becomes meaningless ...
|
|
|
|
|
Yes,I think for begining,it is not necessary to upgrade
Travis D. Mathison wrote:
--- After three days without programming, life becomes meaningless ...
nice
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|
|
Hi all,
I've a problem with Interoperability with Win32 unmanaged code; my C# program call an unmanaged function in a Win32 DLL and pass a pointer to delegate. This DLL every 20 milliseconds call my C# delegate but the win32 thread finish immediatally after createted. In the win32 function there is one FOR cycle that print a string in output debugger window.
Can you have some suggestion for solve my problem ?
Thanks
|
|
|
|
|
In PrintDialog I changed the "AllowSomePages" to "true".
How can I determine the maximum page number?
Mazy
You can find a solution (even a foolish one) for all problems (even big ones)
|
|
|
|