thanks for your suggestions.
i choose GetDIBits function for i need to get bits info from hBitmap or hDC and to transfer them on the net.
i think transfer bits quicker than this way: get image first and convert into bits,then to send.
but i do have a subsequent problem : the size may be too large.
You realize there's much easier ways that don't require unmanaged functions? If you're using a TcpClient or some other connection, just get the NetworkStream and write your Bitmap to the stream. Simple. If you want to convert it first (a waste of time), then use either write to a memory stream and then send the bytes, or use the ImageConverter like so:
I am writing my first 'real' C# control. It's a taskbar that can be positioned to Top/Bottom/Left/Right. What I need to know is which event do I need to use to position it to the bottom when it's initially created.
I tried putting the code in the constructor but you cannot get the parent's properties until after creation.
Can someone please point me in the right direction?
You mean docked to a container, like a Form? See the Dock property, which can be set in the constructor.
Also, you can support initialization after instantiation by implementing the ISupportInitialize interface. The VS.NET designer will automatically call the BeginInit method after instantiating your control, and will call EndInit when done in the InitializeComponent call (you can do this yourself, too - I'm just telling you how VS.NET handles controls that implement this interface).
This way, in your implementation of the EndInit interface, you should have a valid Parent reference (so long as your control was added to the parent's Controls collection property) and can do what you need to. Implementing this interface is a great way to suport initialization of your control in steps.
PS: You could do this using your own implementation without implementing the interface, but VS.NET won't care. Implementing the ISupportInitialize interface is a good way to add designer support for your control. There are other designer-oriented things you can do, which are handy for a lot of programmers. Read Enhancing Design-Time Support[^] in the .NET Framework SDK for more information.
Hi all hope all are good
i make a project which i use a neural network iin it so i need to export a DLL file from the nero solution and link it to the C# need help i just found to link nero soultion with C++ 6
hope anyone can help me
thanks in advance
Also, we can't help you if you don't provide specifics. If you have problems declaring a managed method to P/Invoke an unmanaged function, that's something we could help you with. You need to at least learn and try to P/Invoke the functions needed from this nero DLL you're talking about.
Hi Thanks alot for ur replay
but the problem is the nero solution pacakge make a train and test and it can generate a DLL but this DLL is supported by c++ 6 or pervious only i wanna to know if there is a way to link this DLL with C# or if there is a way or an update which make the nero solution generate a DLL file which allow to be linked with an application by C#
byebye for now
There is no linking as you think of it in terms of C/C++. The DLL must export functions (either C-style or C++-style) and the DllImportAttribute is used to configure the metadata necessary for the CLR to P/Invoke those calls. Read that link I sent you for more information.
I am working on a new project.
Basically, I want to implement a Window Form that mimics Internet Explorer.
So, it would consist of two parts.
A Window Shell with a browser capabilties, and the menu will be like a window explorer file-structure style (tree-like structure). And when clicked on the menu, it will call some aspx page (rendered inside the app).
Any hints welcomed.
I would like to know what class to use for those 2 components. Thanks.
There are many articles on Windows Explorer-like interfaces here on CodeProject. I suggest you do a search.
As for Internet Explorer, you need to right-click on your toolbox and customize it. Click on the COM tag and find the "Microsoft Web Browser" or something like that (shdocvw.dll). When you add that to your toolbox and then to your form, two interop assemblies are created: Interop.SHDocVw.dll (contains the interfaces for the WebBrowser control) and AxInterop.AxSHDocVw.dll, which contains the AxHost-derived control you can put on your form. You can use these two together, and there are also plenty of articles about this here on CodeProject. Just use the Navigate or Navigate2 methods (the latter is recommended) to browser to the URL of your ASP.NET page.
I have the following situation: I serialize an object, let's say ob, and later on I deserialize it and when I try to do this I get an exeption that tells me the following additional information: The constructor to deserialize an object of type ob.subOb was not found. subOb being another object contained in the main object ob.
How do I have to do the Serialization in this case to get it right?
This is documented in the ISerializable interface documentation in the .NET Framework SDK. Note that you do not have to implement ISerializable for your class to be serializable, only to attribute it with the SerializableAttribute. Implement the interface when you want more control over what gets serialized (the default is all private and public fields).
I'm posting this with the risk of Heath getting angry at me because for this one instance I'm not using the parameters in the dataAdapter...not because I like the old way of constructing a long select command, but because I don't know how to use the parameters in this circumstance. I am querying a database, no big deal. But, there are like 7 or 8 different "filter" parameters the user may choose from...and they can also choose to not use any of them. I didn't know how to tell the adapter to ignore that particular parameter, so I resorted to constructing my own select command. However (and Heath will probably say I told you so ) two of these parameters are dates...I am trying to search BETWEEN Date1 AND Date2. This is giving me some really strange results though. First of all, I have to set Date1 all the way to the day before if I hope to get the correct results. Also, sometimes a perfectly good date range will return nothing, whereas a ridiculous range that hasn't even happened yet, will return rows with dates that don't fall anywhere in between my specified range. I'm sort of confused by it, so if anybody has faced this issue before, I'd like to know how it was solved....or, if I can somehow "turn-off" parameters at run time, or if I can see a small example, one or two lines is all, of how to create a parameter to the adapter at run time (peferrably a BETWEEN AND parameter), I'd be much obliged. And Heath, I know you get really frustrated when people don't use the adapter parameters, cause that's what they are there for, sorry about that.
Putting pound signs around the Date like Heath suggested made my query a little better...I no longer have to subtract a day from Time1 to get the correct results. But here is the strange result I'm getting:
A row with a date column of 5/4/2004 is being selected when the date value of Time2 is 5/11/2004 and Time1 is anything from 5/4/2004 to 5/10/2004, but it's not selecting my row when Time1 is before 5/4/2004, and it should. Here is the statement I'm using to select my rows. I hope you can find something, because I sure can't:
I won't badger you this time, but I still suggest you try it. Once you do, I suspect you'll never turn back.
Dates in SQL Server are single-quoted like strings. When referring to Date fields, SQL Server knows what to do. For Access (and some other's I've seen, but don't remember) you encase them in pounds (or hashes - #). If you don't, they will be treated like strings (IIRC) so you won't get the result you'd expect.
Even with the pound signs, the adapter is treating the dates as strings. It is acting like 5/11/04 should go BEFORE 5/4/04. If using the parameters will fix this, I'll change to them as long as I can add them to the adapter programmatically, because in truth I would prefer to use the parameters...I just didn't know how in this situation. What would you suggest? Thank
I'm pretty embarrassed to admit this, but I discovered that the date column in my database was set to text. At any rate, I did convert things to parameters, so your efforts weren't in vain. Thanks for the help!
I am zipping up a bunch of files and "Modified" date on the files always turns out to be 1/1/1980 12:00AM
The date I have is in DateTime format, and I tried
Nothing works!!! It keeps on getting 1/1/1980 12:00AM
Do you have any idea why this is not working?