I *think* your problem is that you are doing the drawing on the load event which actually occurs before the form is displayed.
Try taking the stuff in the draw event and putting it in the paint event instead and see if that works.
First I like to say I appreciate your attempt to help, however, please read a post and understand it before you reply.
Okay I will try to state this again. As I said, I understand how to access functions from a DLL. Which is what you just provided an example for.
What I asked for in the post, and what is also stated in the subject is how to access CLASSES from a NON-COM DLL. That would be a DLL that is not a COM library. That would be C++ classes, not C classes which are really just a struct.
If you know how to do this or have a link to a tutorial or sample code great that would be appreciated. How to access just global functions from a DLL is not needed.
Coding is a way of life. It's in the air we breath. It pumps through our veines. Without it we soon crumble to dust. - Rodney S. Foley
Nishant S wrote: I seriously doubt if you can access native C++ classes from a C# program.
Nope, you can't. The problem is that each vendor compiles its C++ code differently, which is the main reason why COM was created (so that a binary standard existed for sharing OOP code without having to produce a version for every compiler version in existance)
As you said the best option is to use an MC++ wrapper for the native class.
I have been only a few hours on C# and I am loving it.
I have created a program that downloads a web page, and i am trying to extract the keywords meta tag. I tried using the MSHTML stuff, but it was sooo slow! I figured that I will parse the meta keyword thing myself, thats when i discovered "regular expressions".
I have managed to the keywords from this kind of string:
However, the same pattern will not work on
(content and name are switched).
How cuold i make my query not care where CONTENT and NAME are located, as long as they ARE present in the string?
I think string parsing would be better for that. Use the Split method of the string class to get the initial array, then do parsing on each item to see if it contains more keywords (like 3 and 4 above).
Ummm. If you are writing a control, you should be inheriting from the control class. Thus, you should have the ability to call the InvokePaint method.
Some more specifics might be nice if we're going to solve your problems.
Norm Almond: I seen some GUI's in my life but WTF is this mess Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children Leppie:My sister is 25
-Norm on the MailMagic GUI
That's what I don't want it to be at the moment...
I know I have to inherit the control class in order to
use it (because it's protected method...)
Currently, I'm writing many custom controls that each of
them requires this functionality. Therefore, I think
it's a good idea to "extract" this method as an external
one so that every control I've written could use it by
calling this external function, something like:
public static void DrawParentBackground(Graphic g, Control parent, Control callerControl)
No inheritance is involved in order to use these protected method...
It's a small button that draw everything from scratch. I plan a
few features for this button:
- support theme automatically. done! (Thanks for help from James T. Johnson)
- support shadowed text. done! (Thanks for great tutorials from Christian Graus)
- to able to draw underlying control, so it looks like transparent background is supported.
Well, that's why I come up with this question.
Though, I am able to use InvokePaint, InvokePaintBackground to redraw the
underlying parent control. Suddenly this question comes to my mind. If
I want to write another custom control that use this feature by using
InvokePaint. There is no way but inheriting it from Control Class.
Wouldn't it be better if I can write a static function, passing the caller
control and caller's parent control as parameter, then the function will
repaint caller control with the underlying parent's background.
Thanks in advance...
P.S. there's also another painting problem I found. illustrated in the included image.
the result is that ui = 1. But the Textbox stays empty.
I also tried it by doing the union inside the INPUT and making structs for hardware and mouse input, and I got that to the same point, where ui=1 but the textbox stays empty. This always what happens to me with com interop I get to the point where there's no errors but doesn't work.
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."